WordPress Button Plugin MaxButtons - Version 8.2.1

Version Description

  • Fix - Preview axis showed 'pxpx' on new buttons
  • Fix - Duplicate button warning linked to non-functional preview
Download this release

Release Info

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

Code changes from version 8.2 to 8.2.1

blocks/basic.php CHANGED
@@ -245,7 +245,7 @@ class basicBlock extends maxBlock
245
  $message .= ' ' . __('Already used in : ');
246
  foreach($results as $id)
247
  {
248
- $url = admin_url() . 'admin.php?page=maxbuttons-controller&action=button&id=' . $id;
249
  $message .= ' <a href="' . $url . '" target="_blank">' . $id . '</a> ';
250
  }
251
 
245
  $message .= ' ' . __('Already used in : ');
246
  foreach($results as $id)
247
  {
248
+ $url = admin_url() . 'admin.php?page=maxbuttons-controller&action=edit&id=' . $id;
249
  $message .= ' <a href="' . $url . '" target="_blank">' . $id . '</a> ';
250
  }
251
 
blocks/dimension.php CHANGED
@@ -7,13 +7,13 @@ $blockOrder[20][] = "dimension";
7
  class dimensionBlock extends maxBlock
8
  {
9
  protected $blockname = "dimension";
10
- protected $fields = array("button_width" => array("default" => '160px',
11
  "css" => "width",
12
  'cssvalidate' => 'checkDimension', // function reference to validator.
13
  'unitfield' => 'button_size_unit_width',
14
 
15
  ),
16
- "button_height" => array("default" => '50px',
17
  "css" => "height",
18
  'cssvalidate' => 'checkDimension',
19
  'unitfield' => 'button_size_unit_height',
7
  class dimensionBlock extends maxBlock
8
  {
9
  protected $blockname = "dimension";
10
+ protected $fields = array("button_width" => array("default" => '160',
11
  "css" => "width",
12
  'cssvalidate' => 'checkDimension', // function reference to validator.
13
  'unitfield' => 'button_size_unit_width',
14
 
15
  ),
16
+ "button_height" => array("default" => '50',
17
  "css" => "height",
18
  'cssvalidate' => 'checkDimension',
19
  'unitfield' => 'button_size_unit_height',
classes/admin-class.php CHANGED
@@ -5,17 +5,15 @@ defined('ABSPATH') or die('No direct access permitted');
5
  class maxButtonsAdmin
6
  {
7
 
8
- protected $wpdb;
9
  protected static $instance = null;
10
 
11
  protected $fields = array();
12
  protected $defined_fields = array();
13
 
14
- function __construct()
15
  {
16
- global $wpdb;
17
- $this->wpdb = $wpdb;
18
- }
19
 
20
  public static function getInstance()
21
  {
@@ -51,6 +49,8 @@ class maxButtonsAdmin
51
 
52
  public function getButtons($args = array())
53
  {
 
 
54
  $defaults = array(
55
  "status" => "publish",
56
  "orderby" => "id",
@@ -109,9 +109,9 @@ class maxButtonsAdmin
109
  $sql .= " LIMIT $offset, $limit ";
110
  }
111
 
112
- $sql = $this->wpdb->prepare($sql,$escape);
113
 
114
- $buttons = $this->wpdb->get_results($sql, ARRAY_A);
115
 
116
  return $buttons;
117
 
@@ -119,6 +119,7 @@ class maxButtonsAdmin
119
 
120
  public function getButtonCount($args = array())
121
  {
 
122
  $defaults = array(
123
  "status" => "publish",
124
 
@@ -126,8 +127,8 @@ class maxButtonsAdmin
126
  $args = wp_parse_args($args, $defaults);
127
 
128
  $sql = "SELECT count(id) FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
129
- $sql = $this->wpdb->prepare($sql, $args["status"] );
130
- $result = $this->wpdb->get_var($sql);
131
  return $result;
132
 
133
  }
5
  class maxButtonsAdmin
6
  {
7
 
 
8
  protected static $instance = null;
9
 
10
  protected $fields = array();
11
  protected $defined_fields = array();
12
 
13
+ /* function __construct()
14
  {
15
+
16
+ } */
 
17
 
18
  public static function getInstance()
19
  {
49
 
50
  public function getButtons($args = array())
51
  {
52
+ global $wpdb;
53
+
54
  $defaults = array(
55
  "status" => "publish",
56
  "orderby" => "id",
109
  $sql .= " LIMIT $offset, $limit ";
110
  }
111
 
112
+ $sql = $wpdb->prepare($sql,$escape);
113
 
114
+ $buttons = $wpdb->get_results($sql, ARRAY_A);
115
 
116
  return $buttons;
117
 
119
 
120
  public function getButtonCount($args = array())
121
  {
122
+ global $wpdb;
123
  $defaults = array(
124
  "status" => "publish",
125
 
127
  $args = wp_parse_args($args, $defaults);
128
 
129
  $sql = "SELECT count(id) FROM " . maxUtils::get_table_name() . " WHERE status = '%s'";
130
+ $sql = $wpdb->prepare($sql, $args["status"] );
131
+ $result = $wpdb->get_var($sql);
132
  return $result;
133
 
134
  }
classes/button.php CHANGED
@@ -541,7 +541,9 @@ class maxButton
541
  elseif ($this->load_css == 'footer')
542
  {
543
  $css = $this->display_css(false, false);
544
-
 
 
545
  do_action('mb-footer',$this->id, $css);
546
 
547
  if (! $preview)
541
  elseif ($this->load_css == 'footer')
542
  {
543
  $css = $this->display_css(false, false);
544
+ if ($preview)
545
+ do_action('mb-footer', 0, false, 'preview'); // code to warn no to usefile
546
+
547
  do_action('mb-footer',$this->id, $css);
548
 
549
  if (! $preview)
classes/buttons.php CHANGED
@@ -199,7 +199,6 @@ class maxButtons
199
 
200
  $row = $wpdb->get_col($wpdb->prepare("SELECT cache FROM " . maxUtils::get_table_name() . " WHERE id in($id) and status ='%s'", 'publish'));
201
 
202
-
203
  header( "Content-type: text/css; charset: UTF-8" );
204
  foreach($row as $content)
205
  {
199
 
200
  $row = $wpdb->get_col($wpdb->prepare("SELECT cache FROM " . maxUtils::get_table_name() . " WHERE id in($id) and status ='%s'", 'publish'));
201
 
 
202
  header( "Content-type: text/css; charset: UTF-8" );
203
  foreach($row as $content)
204
  {
classes/maxbuttons-class.php CHANGED
@@ -751,7 +751,10 @@ class maxButtonsPlugin
751
 
752
  function do_footer($id, $code, $type = "css")
753
  {
754
- $this->footer[$type][$id] = $code;
 
 
 
755
  }
756
 
757
 
@@ -764,19 +767,26 @@ class maxButtonsPlugin
764
  {
765
  if(count($this->footer) == 0) return; // nothing
766
 
 
 
 
 
 
 
 
767
  $button_ids = array();
768
  $use_file = get_option('maxbuttons_usecssfile', false);
769
 
770
  foreach ($this->footer as $type => $part)
771
  {
772
- if ($type == 'css' && $use_file) // use file output to a CSS filebased output, don't put it inline.
773
  {
774
  foreach($part as $id => $statements)
775
  {
776
  if (is_numeric($id))
777
  $button_ids[] = $id;
778
- else
779
- echo "nonum $id";
780
  }
781
  continue;
782
  }
@@ -787,11 +797,11 @@ class maxButtonsPlugin
787
  echo "<!--noptimize--><!--email_off--><style type='text/css'>";
788
  }
789
 
790
- foreach ($part as $id => $statements)
791
- {
792
- if (strlen($statements) > 0) // prevent whitespace
793
- echo $statements . "\n";
794
- }
795
 
796
  if ($type == 'css')
797
  {
@@ -799,7 +809,7 @@ class maxButtonsPlugin
799
  }
800
  }
801
 
802
- if (is_array($button_ids) && count($button_ids) > 0 && $use_file)
803
  {
804
  wp_enqueue_style('maxbuttons-front', admin_url('admin-ajax.php').'?action=maxbuttons_front_css&id=' . implode(',',array_unique($button_ids)) );
805
  }
751
 
752
  function do_footer($id, $code, $type = "css")
753
  {
754
+ if ($type == 'preview')
755
+ $this->footer['preview'] = true;
756
+ else
757
+ $this->footer[$type][$id] = $code;
758
  }
759
 
760
 
767
  {
768
  if(count($this->footer) == 0) return; // nothing
769
 
770
+ $is_preview = false;
771
+ if (isset($this->footer['preview']))
772
+ {
773
+ $is_preview = true;
774
+ unset($this->footer['preview']);
775
+ }
776
+
777
  $button_ids = array();
778
  $use_file = get_option('maxbuttons_usecssfile', false);
779
 
780
  foreach ($this->footer as $type => $part)
781
  {
782
+ if ($type == 'css' && $use_file && ! $is_preview) // use file output to a CSS filebased output, don't put it inline.
783
  {
784
  foreach($part as $id => $statements)
785
  {
786
  if (is_numeric($id))
787
  $button_ids[] = $id;
788
+ // else
789
+ // echo "nonum $id";
790
  }
791
  continue;
792
  }
797
  echo "<!--noptimize--><!--email_off--><style type='text/css'>";
798
  }
799
 
800
+ foreach ($part as $id => $statements)
801
+ {
802
+ if (strlen($statements) > 0) // prevent whitespace
803
+ echo $statements . "\n";
804
+ }
805
 
806
  if ($type == 'css')
807
  {
809
  }
810
  }
811
 
812
+ if (is_array($button_ids) && count($button_ids) > 0 && $use_file && ! $is_preview)
813
  {
814
  wp_enqueue_style('maxbuttons-front', admin_url('admin-ajax.php').'?action=maxbuttons_front_css&id=' . implode(',',array_unique($button_ids)) );
815
  }
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
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.1.2');
20
 
21
- define('MAXBUTTONS_RELEASE',"17 August 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.2.1
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.2.1');
20
 
21
+ define('MAXBUTTONS_RELEASE',"6 October 2020");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: wordpress button plugin, share button, wordpress buttons, css3 button gene
4
  Requires at least: 4.8
5
  Tested up to: 5.5.1
6
  Requires PHP: 5.6
7
- Stable tag: 8.2
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,11 @@ Secondly, please use latin only characters for button name ( Basic settings) and
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
267
  = 8.2 =
268
 
269
  * New - You can now control how much auto-responsive mode changes buttons - in settings
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
 
265
  == Changelog ==
266
 
267
+ = 8.2.1 =
268
+
269
+ * Fix - Preview axis showed 'pxpx' on new buttons
270
+ * Fix - Duplicate button warning linked to non-functional preview
271
+
272
  = 8.2 =
273
 
274
  * New - You can now control how much auto-responsive mode changes buttons - in settings