WordPress Button Plugin MaxButtons - Version 8.3

Version Description

  • New - When external Javascript crashes Maxbuttons, an error is displayed
  • Review notice updated
Download this release

Release Info

Developer basszje
Plugin Icon 128x128 WordPress Button Plugin MaxButtons
Version 8.3
Comparing to
See all releases

Code changes from version 8.2.1 to 8.3

blocks/basic.php CHANGED
@@ -198,7 +198,6 @@ class basicBlock extends maxBlock
198
  $url = apply_filters('mb-url-' . $button_id, $url, $data['url']);
199
 
200
  $anchor->href = $url;
201
- //do_shortcode( esc_url($url, $this->protocols) );
202
 
203
  }
204
  else // fixing an iOS problem which renders anchors without URL wrongly.
198
  $url = apply_filters('mb-url-' . $button_id, $url, $data['url']);
199
 
200
  $anchor->href = $url;
 
201
 
202
  }
203
  else // fixing an iOS problem which renders anchors without URL wrongly.
classes/controllers/supportController.php CHANGED
@@ -72,9 +72,9 @@ class supportController extends MaxController
72
  // Finally get the correct version number
73
  $known = array('Version', $browser_name_short, 'other');
74
  $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
75
- /*if (!preg_match_all($pattern, $user_agent, $matches)) {
76
  // We have no matching number just continue
77
- } */
78
 
79
  // See how many we have
80
  $i = count($matches['browser']);
72
  // Finally get the correct version number
73
  $known = array('Version', $browser_name_short, 'other');
74
  $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
75
+ if (!preg_match_all($pattern, $user_agent, $matches)) {
76
  // We have no matching number just continue
77
+ }
78
 
79
  // See how many we have
80
  $i = count($matches['browser']);
classes/maxbuttons-admin-helper.php CHANGED
@@ -103,7 +103,8 @@ class maxAdmin
103
  if ($review == '')
104
  {
105
  //$created = get_option("MBFREE_CREATED");
106
- $show = time() + (7* DAY_IN_SECONDS);
 
107
  update_user_meta($current_user_id, 'maxbuttons_review_notice', $show);
108
  return;
109
  }
@@ -264,7 +265,9 @@ class maxAdmin
264
 
265
  public static function mb_review_notice() {
266
  if( current_user_can( 'manage_options' ) ) { ?>
267
- <div class="updated notice maxbuttons-notice">
 
 
268
  <div class='review-logo'></div>
269
  <div class='mb-notice'>
270
  <p class='title'><?php _e("Rate us Please!","maxbuttons"); ?></p>
@@ -278,6 +281,20 @@ class maxAdmin
278
  </div>
279
  <a class="dashicons dashicons-dismiss close-mb-notice" href="javascript:void(0)" data-action='off'></a>
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  </div>
282
  <?php
283
  }
103
  if ($review == '')
104
  {
105
  //$created = get_option("MBFREE_CREATED");
106
+ //$show = time() + (7* DAY_IN_SECONDS);
107
+ $show = time() + (2* DAY_IN_SECONDS); // Changed
108
  update_user_meta($current_user_id, 'maxbuttons_review_notice', $show);
109
  return;
110
  }
265
 
266
  public static function mb_review_notice() {
267
  if( current_user_can( 'manage_options' ) ) { ?>
268
+
269
+ <?php /* OLD REVIEW NOTICE
270
+ <div class="updated notice maxbuttons-notice">
271
  <div class='review-logo'></div>
272
  <div class='mb-notice'>
273
  <p class='title'><?php _e("Rate us Please!","maxbuttons"); ?></p>
281
  </div>
282
  <a class="dashicons dashicons-dismiss close-mb-notice" href="javascript:void(0)" data-action='off'></a>
283
 
284
+ </div>
285
+ */ ?>
286
+
287
+
288
+ <div class="updated notice maxbuttons-notice">
289
+ <div class='review-logo'></div>
290
+ <div class='mb-notice'>
291
+ <p class='title'><?php _e("Is there a feature you would like for us to add to <b>MaxButtons</b>? <br> Let us know.","maxbuttons"); ?></p>
292
+ <p><?php printf(__("Send your suggestions to %s","maxbuttons"), '<a href="mailto:support@maxfoundry.com">support@maxfoundry.com</a>'); ?></p>
293
+
294
+
295
+ </div>
296
+ <a class="dashicons dashicons-dismiss close-mb-notice" href="javascript:void(0)" data-action='off'></a>
297
+
298
  </div>
299
  <?php
300
  }
classes/maxbuttons-class.php CHANGED
@@ -484,7 +484,6 @@ class maxButtonsPlugin
484
  protected function load_plugin_scripts() {
485
  // only hook in maxbuttons realm.
486
 
487
-
488
  wp_enqueue_script('jquery-ui-draggable');
489
  wp_enqueue_script('wplink');
490
 
@@ -512,6 +511,16 @@ class maxButtonsPlugin
512
 
513
 
514
  wp_register_script('maxbutton-js-init', $this->js_url . 'init.js', array('maxbutton-admin'),$this->version, true);
 
 
 
 
 
 
 
 
 
 
515
  wp_register_script('maxbuttons-tabs', $this->js_url . 'maxtabs.js', array('jquery') ,$this->version, true);
516
 
517
  wp_enqueue_script('maxbutton-alpha-picker');
484
  protected function load_plugin_scripts() {
485
  // only hook in maxbuttons realm.
486
 
 
487
  wp_enqueue_script('jquery-ui-draggable');
488
  wp_enqueue_script('wplink');
489
 
511
 
512
 
513
  wp_register_script('maxbutton-js-init', $this->js_url . 'init.js', array('maxbutton-admin'),$this->version, true);
514
+
515
+ wp_localize_script('maxbutton-js-init', 'maxbuttons_init', array(
516
+ 'initFailedTitle' => __('Maxbuttons detected an Error', 'maxbuttons'),
517
+ 'initFailed' => sprintf(__('MaxButtons has detected Javascript not loading as expected. Often this is caused by other plugins conflicting or crashing. %s
518
+ - Disable other plugins and see if this error goes away %s
519
+ - Check developer console (F12) on your browser to check which script is causing the issue %s
520
+ - Contact our support %s
521
+ ', 'maxbuttons'), '<br>','<br>','<br>','<br>'),
522
+ 'initFailedDetectedErrors' => '<h3>' . __('Detected Errors:', 'maxbuttons') . '</h3>',
523
+ ));
524
  wp_register_script('maxbuttons-tabs', $this->js_url . 'maxtabs.js', array('jquery') ,$this->version, true);
525
 
526
  wp_enqueue_script('maxbutton-alpha-picker');
js/init.js CHANGED
@@ -6,6 +6,8 @@ jQuery(document).ready(function(jq) {
6
 
7
  function runMaxInit()
8
  {
 
 
9
  if (typeof window.maxFoundry === 'undefined')
10
  window.maxFoundry = {};
11
 
@@ -39,3 +41,41 @@ jQuery(document).ready(function(jq) {
39
  runMaxInit();
40
 
41
  }); /* END OF JQUERY */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  function runMaxInit()
8
  {
9
+ //console.log('** INIT MAXADMIN ** ');
10
+
11
  if (typeof window.maxFoundry === 'undefined')
12
  window.maxFoundry = {};
13
 
41
  runMaxInit();
42
 
43
  }); /* END OF JQUERY */
44
+
45
+ var mbErrors = [];
46
+
47
+ window.setTimeout(function () {
48
+ if (typeof window.maxFoundry === 'undefined')
49
+ {
50
+ console.error('Detected MaxButtons load failure');
51
+
52
+ if (typeof maxbuttons_init === 'undefined' || typeof maxbuttons_init.initFailed === 'undefined')
53
+ {
54
+ console.error('Detected MaxButtons is not loaded, but can\'t find the text to express it');
55
+ return false;
56
+ }
57
+ // el = document.getElementById('maxbuttons');
58
+ var el = document.querySelector('h1.title');
59
+ var errormsg = document.createElement('div');
60
+ errormsg.className = 'notice notice-error';
61
+ errormsg.innerHTML = '<h1>' + maxbuttons_init.initFailedTitle + '</h1><p>' + maxbuttons_init.initFailed + '</p>';
62
+
63
+ if (mbErrors.length > 0)
64
+ {
65
+ errormsg.innerHTML += maxbuttons_init.initFailedDetectedErrors;
66
+ for(i =0; i < mbErrors.length; i++)
67
+ errormsg.innerHTML += mbErrors[i];
68
+ }
69
+
70
+ el.parentNode.insertBefore(errormsg, el.nextSibling);
71
+
72
+ }
73
+ }, 8000);
74
+
75
+ window.addEventListener('error', function (event)
76
+ {
77
+ // console.log(event);
78
+ var note = event.message + ' - ' + event.filename + ':' + event.lineno + '<br>';
79
+ console.log('Adding error' + note);
80
+ mbErrors.push(note);
81
+ });
js/maxbuttons-admin.js CHANGED
@@ -14,7 +14,6 @@ maxAdmin.prototype = {
14
  }; // MaxAdmin
15
 
16
  maxAdmin.prototype.init = function () {
17
-
18
  this.button_id = $('input[name="button_id"]').val();
19
  // Prevents the output button from being clickable (also in admin list view )
20
  $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); e.stopPropagation(); });
14
  }; // MaxAdmin
15
 
16
  maxAdmin.prototype.init = function () {
 
17
  this.button_id = $('input[name="button_id"]').val();
18
  // Prevents the output button from being clickable (also in admin list view )
19
  $(document).on('click', ".maxbutton-preview", function(e) { e.preventDefault(); e.stopPropagation(); });
js/min/init.js CHANGED
@@ -1 +1 @@
1
- var $=jQuery;jQuery(document).ready(function(n){$=n,void 0===window.maxFoundry&&(window.maxFoundry={}),"function"==typeof maxLivePreview&&(window.maxFoundry.livePreview=maxLivePreview),window.maxFoundry.maxadmin=new maxAdmin,window.maxFoundry.maxadmin.init(),window.maxFoundry.maxmodal=new maxModal,window.maxFoundry.maxmodal.init(),window.maxFoundry.maxAjax=new maxAjax,window.maxFoundry.maxAjax.init(),window.maxFoundry.maxTabs=new maxTabs,window.maxFoundry.maxTabs.init(),$(window).trigger("maxbuttons-js-init-done")});
1
+ var $=jQuery;jQuery(document).ready(function(n){$=n,void 0===window.maxFoundry&&(window.maxFoundry={}),"function"==typeof maxLivePreview&&(window.maxFoundry.livePreview=maxLivePreview),window.maxFoundry.maxadmin=new maxAdmin,window.maxFoundry.maxadmin.init(),window.maxFoundry.maxmodal=new maxModal,window.maxFoundry.maxmodal.init(),window.maxFoundry.maxAjax=new maxAjax,window.maxFoundry.maxAjax.init(),window.maxFoundry.maxTabs=new maxTabs,window.maxFoundry.maxTabs.init(),$(window).trigger("maxbuttons-js-init-done")});var mbErrors=[];window.setTimeout(function(){if(void 0===window.maxFoundry){if(console.error("Detected MaxButtons load failure"),"undefined"==typeof maxbuttons_init||void 0===maxbuttons_init.initFailed)return console.error("Detected MaxButtons is not loaded, but can't find the text to express it"),!1;var n=document.querySelector("h1.title"),e=document.createElement("div");if(e.className="notice notice-error",e.innerHTML="<h1>"+maxbuttons_init.initFailedTitle+"</h1><p>"+maxbuttons_init.initFailed+"</p>",mbErrors.length>0)for(e.innerHTML+=maxbuttons_init.initFailedDetectedErrors,i=0;i<mbErrors.length;i++)e.innerHTML+=mbErrors[i];n.parentNode.insertBefore(e,n.nextSibling)}},8e3),window.addEventListener("error",function(n){var i=n.message+" - "+n.filename+":"+n.lineno+"<br>";console.log("Adding error"+i),mbErrors.push(i)});
maxbuttons.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MaxButtons
4
  Plugin URI: http://maxbuttons.com
5
  Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
6
- Version: 8.2.1
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
@@ -16,9 +16,9 @@ namespace MaxButtons;
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
- define('MAXBUTTONS_VERSION_NUM', '8.2.1');
20
 
21
- define('MAXBUTTONS_RELEASE',"6 October 2020");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
3
  Plugin Name: MaxButtons
4
  Plugin URI: http://maxbuttons.com
5
  Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
6
+ Version: 8.3
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
16
  if (! defined('MAXBUTTONS_ROOT_FILE'))
17
  define("MAXBUTTONS_ROOT_FILE", __FILE__);
18
  if (! defined('MAXBUTTONS_VERSION_NUM'))
19
+ define('MAXBUTTONS_VERSION_NUM', '8.3');
20
 
21
+ define('MAXBUTTONS_RELEASE',"10 November 2020");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: maxfoundry, basszje, arcware, johnbhartley
3
  Tags: wordpress button plugin, share button, wordpress buttons, css3 button generator, responsive buttons, css wordpress button
4
  Requires at least: 4.8
5
- Tested up to: 5.5.1
6
  Requires PHP: 5.6
7
- Stable tag: 8.2.1
8
 
9
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
10
 
@@ -264,6 +264,15 @@ Secondly, please use latin only characters for button name ( Basic settings) and
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
 
 
 
 
267
  = 8.2.1 =
268
 
269
  * Fix - Preview axis showed 'pxpx' on new buttons
2
  Contributors: maxfoundry, basszje, arcware, johnbhartley
3
  Tags: wordpress button plugin, share button, wordpress buttons, css3 button generator, responsive buttons, css wordpress button
4
  Requires at least: 4.8
5
+ Tested up to: 5.5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 8.3
8
 
9
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
10
 
264
 
265
  == Changelog ==
266
 
267
+ = 8.3 =
268
+
269
+ * New - When external Javascript crashes Maxbuttons, an error is displayed
270
+ * Review notice updated
271
+
272
+ = 8.2.2 =
273
+
274
+ * Fix - PHP notices on support page
275
+
276
  = 8.2.1 =
277
 
278
  * Fix - Preview axis showed 'pxpx' on new buttons