Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer - Version 3.3.2

Version Description

Release date: November 14, 2022

Changelog: - Fix: Fixed an issue with our snippet not loading in

If you experience bugs, problems or you just have some feedback, let us know on our Buttonizer community!

Download this release

Release Info

Developer buttonizer
Plugin Icon wp plugin Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer
Version 3.3.2
Comparing to
See all releases

Code changes from version 3.3.1 to 3.3.2

Files changed (3) hide show
  1. buttonizer.php +2 -2
  2. init.php +13 -16
  3. readme.txt +9 -1
buttonizer.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Buttonizer - Smart Floating Action Button
4
  * Plugin URI: https://buttonizer.io
5
  * Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
6
- * Version: 3.3.1
7
  * Author: Buttonizer
8
  * Author URI: https://buttonizer.pro
9
  * License: GPLv3
@@ -24,7 +24,7 @@
24
  */
25
 
26
  // Define current Buttonizer version
27
- define('BUTTONIZER_VERSION', '3.3.1');
28
  define('BUTTONIZER_PLUGIN_FILE', __FILE__);
29
 
30
  // Get environment vars
3
  * Plugin Name: Buttonizer - Smart Floating Action Button
4
  * Plugin URI: https://buttonizer.io
5
  * Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
6
+ * Version: 3.3.2
7
  * Author: Buttonizer
8
  * Author URI: https://buttonizer.pro
9
  * License: GPLv3
24
  */
25
 
26
  // Define current Buttonizer version
27
+ define('BUTTONIZER_VERSION', '3.3.2');
28
  define('BUTTONIZER_PLUGIN_FILE', __FILE__);
29
 
30
  // Get environment vars
init.php CHANGED
@@ -14,7 +14,6 @@
14
  use Buttonizer\Admin\Admin;
15
  use Buttonizer\Utils\Settings;
16
  use Buttonizer\Api\Api;
17
- use Buttonizer\Utils\PageLanguage;
18
  use Buttonizer\Utils\PermissionCheck;
19
 
20
  /**
@@ -114,11 +113,11 @@ if (
114
 
115
  gtag('config', '" . Settings::getSetting("google_analytics") . "');");
116
  }
 
117
 
118
- // Add integration script
 
119
  if (Settings::getSetting("site_id")) {
120
- wp_register_script('buttonizer_integration_script', '');
121
-
122
  // Get current page language
123
  $pageData = [
124
  "language" => getCurrentLanguage()
@@ -144,30 +143,28 @@ if (
144
  // Define page data
145
  $buttonizerData = "if(!window._buttonizer) { window._buttonizer = {}; };var _buttonizer_page_data = " . json_encode($pageData) . ";window._buttonizer.data = { ..._buttonizer_page_data, ...window._buttonizer.data };";
146
 
147
- wp_register_script('buttonizer_data', "");
148
- wp_add_inline_script('buttonizer_data', $buttonizerData);
149
- wp_enqueue_script('buttonizer_data');
150
 
 
 
 
151
  // Buttonizer integration script
152
  $buttonizerSnippet = "(function(n,t,c,d){if(t.getElementById(d)){return}var o=t.createElement('script');o.id=d;(o.async=!0),(o.src='https://cdn.buttonizer.io/embed.js'),(o.onload=function(){window.Buttonizer?window.Buttonizer.init(c):window.addEventListener('buttonizer_script_loaded',()=>window.Buttonizer.init(c))}),t.head.appendChild(o)})(window,document,'" . Settings::getSetting("site_id") . "','buttonizer_script')";
153
 
154
  // GDPR Compliance check
155
  if (Settings::getSetting("wait_until_consent", false)) {
156
- wp_add_inline_script(
157
- 'buttonizer_integration_script',
158
- "// Buttonizer snippet container
159
  function enableButtonizer() {" . $buttonizerSnippet . "};
160
 
161
  // Buttonizer consent given, load content
162
- if(window.buttonizer_consent_given){ enableButtonizer(); }"
163
- );
164
- } else {
165
- wp_add_inline_script('buttonizer_integration_script', $buttonizerSnippet);
166
  }
167
 
168
- wp_enqueue_script('buttonizer_integration_script');
169
  }
170
- });
171
 
172
  // Add admin menu
173
  add_action('admin_bar_menu', function ($bar) {
14
  use Buttonizer\Admin\Admin;
15
  use Buttonizer\Utils\Settings;
16
  use Buttonizer\Api\Api;
 
17
  use Buttonizer\Utils\PermissionCheck;
18
 
19
  /**
113
 
114
  gtag('config', '" . Settings::getSetting("google_analytics") . "');");
115
  }
116
+ });
117
 
118
+ // Add page data
119
+ add_action('wp_head', function () {
120
  if (Settings::getSetting("site_id")) {
 
 
121
  // Get current page language
122
  $pageData = [
123
  "language" => getCurrentLanguage()
143
  // Define page data
144
  $buttonizerData = "if(!window._buttonizer) { window._buttonizer = {}; };var _buttonizer_page_data = " . json_encode($pageData) . ";window._buttonizer.data = { ..._buttonizer_page_data, ...window._buttonizer.data };";
145
 
146
+ echo '<script type="text/javascript">' . $buttonizerData . '</script>';
147
+ }
148
+ }, 10);
149
 
150
+ // Add integration script
151
+ add_action('wp_footer', function () {
152
+ if (Settings::getSetting("site_id")) {
153
  // Buttonizer integration script
154
  $buttonizerSnippet = "(function(n,t,c,d){if(t.getElementById(d)){return}var o=t.createElement('script');o.id=d;(o.async=!0),(o.src='https://cdn.buttonizer.io/embed.js'),(o.onload=function(){window.Buttonizer?window.Buttonizer.init(c):window.addEventListener('buttonizer_script_loaded',()=>window.Buttonizer.init(c))}),t.head.appendChild(o)})(window,document,'" . Settings::getSetting("site_id") . "','buttonizer_script')";
155
 
156
  // GDPR Compliance check
157
  if (Settings::getSetting("wait_until_consent", false)) {
158
+ $buttonizerSnippet = "// Buttonizer snippet container
 
 
159
  function enableButtonizer() {" . $buttonizerSnippet . "};
160
 
161
  // Buttonizer consent given, load content
162
+ if(window.buttonizer_consent_given){ enableButtonizer(); }";
 
 
 
163
  }
164
 
165
+ echo '<script type="text/javascript">' . $buttonizerSnippet . '</script>';
166
  }
167
+ }, 11);
168
 
169
  // Add admin menu
170
  add_action('admin_bar_menu', function ($bar) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Buy plugin: https://buttonizer.io
4
  Tags: Conversion, action button, call, marketing, Social Sharing
5
  Requires at least: 4.7
6
  Tested up to: 6.1
7
- Stable tag: 3.3.1
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -236,6 +236,14 @@ Languages can have a different direction of writing and reading? While languages
236
 
237
  == Changelog ==
238
 
 
 
 
 
 
 
 
 
239
  = 3.3.1 =
240
  Release date: October 27, 2022
241
 
4
  Tags: Conversion, action button, call, marketing, Social Sharing
5
  Requires at least: 4.7
6
  Tested up to: 6.1
7
+ Stable tag: 3.3.2
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
236
 
237
  == Changelog ==
238
 
239
+ = 3.3.2 =
240
+ Release date: November 14, 2022
241
+
242
+ **Changelog:**
243
+ - Fix: Fixed an issue with our snippet not loading in
244
+
245
+ If you experience bugs, problems or you just have some feedback, let us know on our [Buttonizer community](https://community.buttonizer.pro/)!
246
+
247
  = 3.3.1 =
248
  Release date: October 27, 2022
249