WordPress Button Plugin MaxButtons - Version 9.2

Version Description

  • Works with PHP 8.1 / WordPress 5.9.3+
  • Fix - Extra check for database tables in case activation didn't run
  • Fix - Returns to last screen active after saving.
  • Fix - Add new different size of editor viewport than edit mode.
Download this release

Release Info

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

Code changes from version 9.0 to 9.2

assets/integrations/gutenberg/gutenberg.php CHANGED
@@ -19,7 +19,7 @@ class gutenBerg{
19
 
20
  wp_register_script(
21
  'maxbuttons_gutenberg-js', // Handle.
22
- plugins_url( 'blocks.build.js', __FILE__ ), // Block.build.js: We register the block here. Built with Webpack.
23
  array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above.
24
  $version,
25
  true // Enqueue the script in the footer.
@@ -30,12 +30,13 @@ class gutenBerg{
30
  'icon_url' => MB()->get_plugin_url() . '/images/mb-32.png',
31
  ));
32
 
 
33
  wp_enqueue_script('maxbuttons_gutenberg-js');
34
 
35
  // Styles.
36
  wp_enqueue_style(
37
  'maxbuttons_block-editor-css', // Handle.
38
- plugins_url( 'blocks.editor.build.css', __FILE__ ), // Block editor CSS.
39
  array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
40
  $version
41
  );
19
 
20
  wp_register_script(
21
  'maxbuttons_gutenberg-js', // Handle.
22
+ MB()->get_plugin_url() . 'assets/integrations/gutenberg/blocks.build.js', // Block.build.js: We register the block here. Built with Webpack.
23
  array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above.
24
  $version,
25
  true // Enqueue the script in the footer.
30
  'icon_url' => MB()->get_plugin_url() . '/images/mb-32.png',
31
  ));
32
 
33
+
34
  wp_enqueue_script('maxbuttons_gutenberg-js');
35
 
36
  // Styles.
37
  wp_enqueue_style(
38
  'maxbuttons_block-editor-css', // Handle.
39
+ MB()->get_plugin_url() . 'assets/integrations/gutenberg/blocks.editor.build.css', // Block editor CSS.
40
  array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
41
  $version
42
  );
classes/admin-class.php CHANGED
@@ -115,6 +115,7 @@ class maxButtonsAdmin
115
 
116
  $buttons = $wpdb->get_results($sql, ARRAY_A);
117
 
 
118
  return $buttons;
119
 
120
  }
@@ -153,7 +154,7 @@ class maxButtonsAdmin
153
  $view = $args["view"];
154
 
155
  $limit = apply_filters('maxbuttons/list/num_items', $limit);
156
-
157
  $total = $this->getButtonCount(array("status" => $args["status"]));
158
 
159
  $num_pages = ceil($total / $limit);
115
 
116
  $buttons = $wpdb->get_results($sql, ARRAY_A);
117
 
118
+
119
  return $buttons;
120
 
121
  }
154
  $view = $args["view"];
155
 
156
  $limit = apply_filters('maxbuttons/list/num_items', $limit);
157
+
158
  $total = $this->getButtonCount(array("status" => $args["status"]));
159
 
160
  $num_pages = ceil($total / $limit);
classes/controllers/listController.php CHANGED
@@ -59,7 +59,20 @@ class listController extends MaxController
59
  if ($this->view->listView == 'trash')
60
  $args["status"] = "trash";
61
 
 
 
62
  $published_buttons = $this->mbadmin->getButtons($args);
 
 
 
 
 
 
 
 
 
 
 
63
  $this->view->published_buttons = $published_buttons;
64
  $this->view->pageArgs = $args;
65
  }
59
  if ($this->view->listView == 'trash')
60
  $args["status"] = "trash";
61
 
62
+
63
+
64
  $published_buttons = $this->mbadmin->getButtons($args);
65
+
66
+ if (count($published_buttons) == 0) // This can be new installation, but check problem with Database.
67
+ {
68
+ $install = MB()->getClass("install");
69
+ $bool = $install::maxbuttons_database_table_exists(maxUtils::get_table_name());
70
+ if ($bool === false)
71
+ {
72
+ $install::create_database_table();
73
+ }
74
+ }
75
+
76
  $this->view->published_buttons = $published_buttons;
77
  $this->view->pageArgs = $args;
78
  }
classes/installation.php CHANGED
@@ -59,7 +59,6 @@ class maxInstall
59
  static::updateFA();
60
  static::migrateResponsive();
61
 
62
-
63
  $button = MB()->getClass('button');
64
  $button->reset_cache(); //refresh cache
65
 
@@ -479,7 +478,11 @@ class maxInstall
479
 
480
  static function maxbuttons_database_table_exists($table_name) {
481
  global $wpdb;
482
- return strtolower($wpdb->get_var("SHOW TABLES LIKE '$table_name'")) == strtolower($table_name);
 
 
 
 
483
  }
484
 
485
 
59
  static::updateFA();
60
  static::migrateResponsive();
61
 
 
62
  $button = MB()->getClass('button');
63
  $button->reset_cache(); //refresh cache
64
 
478
 
479
  static function maxbuttons_database_table_exists($table_name) {
480
  global $wpdb;
481
+ $dbaseTable = $wpdb->get_var("SHOW TABLES LIKE '$table_name'");
482
+ if (is_null($dbaseTable))
483
+ return false;
484
+ else
485
+ return strtolower($dbaseTable) == strtolower($table_name);
486
  }
487
 
488
 
classes/maxbuttons-class.php CHANGED
@@ -319,7 +319,7 @@ class maxButtonsPlugin
319
  // Now add the submenu page for the Add New page
320
  $submenu_page_title = __('MaxButtons: Add/Edit Button', 'maxbuttons');
321
  $submenu_title = __('Add New', 'maxbuttons');
322
- $submenu_slug = 'maxbuttons-button';
323
 
324
  //$submenu_function = 'maxbuttons_button';
325
  $this->admin_pages[] = add_submenu_page($menu_slug, $submenu_page_title, $submenu_title, $capability, $submenu_slug, $submenu_function);
@@ -380,7 +380,7 @@ class maxButtonsPlugin
380
 
381
  }
382
 
383
- // Loads admin controller based on page
384
  public function load_admin_page()
385
  {
386
  global $plugin_page;
@@ -397,6 +397,7 @@ class maxButtonsPlugin
397
 
398
  private function getController($page)
399
  {
 
400
  if ($page == 'maxbuttons-controller')
401
  {
402
  $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : null;
319
  // Now add the submenu page for the Add New page
320
  $submenu_page_title = __('MaxButtons: Add/Edit Button', 'maxbuttons');
321
  $submenu_title = __('Add New', 'maxbuttons');
322
+ $submenu_slug = 'maxbuttons-controller&action=edit'; // action here for writing to layout header to be consistent.
323
 
324
  //$submenu_function = 'maxbuttons_button';
325
  $this->admin_pages[] = add_submenu_page($menu_slug, $submenu_page_title, $submenu_title, $capability, $submenu_slug, $submenu_function);
380
 
381
  }
382
 
383
+ // Loads admin controller based on page
384
  public function load_admin_page()
385
  {
386
  global $plugin_page;
397
 
398
  private function getController($page)
399
  {
400
+
401
  if ($page == 'maxbuttons-controller')
402
  {
403
  $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : null;
includes/maxbuttons-button.php CHANGED
@@ -7,7 +7,8 @@ $button = $this->view->button;
7
 
8
  $admin = MB()->getClass('admin');
9
  $page_title = __("Button editor","maxbuttons");
10
- $action = $this->getButton('add-new', array('add_class' => 'page-title-action add-new-h2')); //"<a class='page-title-action add-new-h2' href='" . $this->getButtonLink() . "'>" . __('Add New', 'maxbuttons') . "</a>";
 
11
  $admin->get_header(array("title" => $page_title, "title_action" => $action) );
12
  ?>
13
  <form id="new-button-form" action="<?php echo $this->getButtonLink($button_id); ?>" method="post">
7
 
8
  $admin = MB()->getClass('admin');
9
  $page_title = __("Button editor","maxbuttons");
10
+ $action = $this->getButton('add-new', array('add_class' => 'page-title-action add-new-h2'));
11
+
12
  $admin->get_header(array("title" => $page_title, "title_action" => $action) );
13
  ?>
14
  <form id="new-button-form" action="<?php echo $this->getButtonLink($button_id); ?>" method="post">
includes/maxbuttons-no-simplexml.php CHANGED
@@ -29,7 +29,8 @@ $admin->get_header(array("title" => $page_title) );
29
  </ul>
30
 
31
  </p>
32
- <?php require_once('social-share.php'); ?>
 
33
 
34
 
35
  </div>
29
  </ul>
30
 
31
  </p>
32
+
33
+ <?php //require_once('social-share.php'); ?>
34
 
35
 
36
  </div>
includes/maxbuttons-settings.php CHANGED
@@ -240,7 +240,8 @@ $admin->get_header(array("tabs_active" => true, "title" => $page_title) );
240
  <h3><?php _e('The button below should help fix the "foreign character issue" some people experience when using MaxButtons. If you use foreign characters in your buttons and after saving see ????, use this button.', 'maxbuttons') ?></h3>
241
 
242
  <form action="" method="POST">
243
- <input type="submit" name="alter_charset" class="button-primary" value="<?php _e('Change MaxButtons Table To UTF8', 'maxbuttons') ?>" /> <?php echo $view->response; ?>
 
244
  </form>
245
 
246
 
240
  <h3><?php _e('The button below should help fix the "foreign character issue" some people experience when using MaxButtons. If you use foreign characters in your buttons and after saving see ????, use this button.', 'maxbuttons') ?></h3>
241
 
242
  <form action="" method="POST">
243
+ <input type="submit" name="alter_charset" class="button-primary" value="<?php _e('Change MaxButtons Table To UTF8', 'maxbuttons') ?>" />
244
+ <?php echo (property_exists($view, 'response')) ? $view->response : ''; ?>
245
  </form>
246
 
247
 
js/maxbuttons-admin.js CHANGED
@@ -26,7 +26,7 @@ maxAdmin.prototype.init = function () {
26
  cancel: 'p, li',
27
  });
28
 
29
- $(document).on('submit', 'form.mb_ajax_save', $.proxy(this.formAjaxSave, this));
30
 
31
  // copy / delete / trash action buttons via ajax
32
  $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
@@ -170,6 +170,9 @@ maxAdmin.prototype.change_screen = function(change_screen)
170
  $('.mbscreen-editor').removeClass('current-screen');
171
  $('#screen_' + change_screen).addClass('current-screen');
172
 
 
 
 
173
  }
174
  //change_screen
175
  }
26
  cancel: 'p, li',
27
  });
28
 
29
+ // $(document).on('submit', 'form.mb_ajax_save', $.proxy(this.formAjaxSave, this));
30
 
31
  // copy / delete / trash action buttons via ajax
32
  $(document).on('click', '[data-buttonaction]', $.proxy(this.button_action, this ));
170
  $('.mbscreen-editor').removeClass('current-screen');
171
  $('#screen_' + change_screen).addClass('current-screen');
172
 
173
+ var form = document.getElementById('new-button-form');
174
+ form.action = window.location;
175
+
176
  }
177
  //change_screen
178
  }
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: 9.0
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', '9.0');
20
 
21
- define('MAXBUTTONS_RELEASE',"15 January 2022");
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: 9.2
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', '9.2');
20
 
21
+ define('MAXBUTTONS_RELEASE',"1 May 2022");
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.8
6
  Requires PHP: 7.0
7
- Stable tag: 9.0
8
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
9
 
10
  == Description ==
@@ -21,7 +21,7 @@ MaxButtons easily solved my problem with lots of options when creating the butto
21
 
22
  > “Easy, clear, and robust. I'm a programmer and can write CSS till the cows come home, but why? Just get it, install it and use it. Then, when you're impressed, buy the pro version” - by jleahy
23
 
24
- Max Foundry also makes the WordPress Gallery plugin [MaxGalleria](https://maxgalleria.com) and [WordPress Media Folders](https://maxgalleria.com/downloads/media-library-plus-pro/) plugin for real WordPress Media Library folders and [Welcome Mat Pro](https://welcomemat.io).
25
 
26
  = Requirements =
27
 
@@ -276,6 +276,13 @@ Upgrading to the PRO version is quite simple. Obtain a license key via our [site
276
 
277
  == Changelog ==
278
 
 
 
 
 
 
 
 
279
  = 9.0 =
280
 
281
  * Upgrade to PRO directly from the plugin ( Upgrade to PRO screen )
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: 6.0
6
  Requires PHP: 7.0
7
+ Stable tag: 9.2
8
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
9
 
10
  == Description ==
21
 
22
  > “Easy, clear, and robust. I'm a programmer and can write CSS till the cows come home, but why? Just get it, install it and use it. Then, when you're impressed, buy the pro version” - by jleahy
23
 
24
+ Max Foundry also makes the WordPress Gallery plugin [MaxGal.0-leria](https://maxgalleria.com) and [WordPress Media Folders](https://maxgalleria.com/downloads/media-library-plus-pro/) plugin for real WordPress Media Library folders.
25
 
26
  = Requirements =
27
 
276
 
277
  == Changelog ==
278
 
279
+ = 9.2 =
280
+
281
+ * Works with PHP 8.1 / WordPress 5.9.3+
282
+ * Fix - Extra check for database tables in case activation didn't run
283
+ * Fix - Returns to last screen active after saving.
284
+ * Fix - Add new different size of editor viewport than edit mode.
285
+
286
  = 9.0 =
287
 
288
  * Upgrade to PRO directly from the plugin ( Upgrade to PRO screen )