WordPress Button Plugin MaxButtons - Version 8.4.1

Version Description

  • Fix - Button width / Container width processed incorrectly when main and responsive are the same value, but not the default.
Download this release

Release Info

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

Code changes from version 8.4 to 8.4.1

blocks/container.php CHANGED
@@ -13,7 +13,7 @@ class containerBlock extends maxBlock
13
  protected $fields = array("container_enabled" => array("default" => "0"),
14
  "container_center_div_wrap" => array("default" => "0"),
15
 
16
- "container_width" => array("default" => "0px",
17
  "css" => "width",
18
  "csspart" => "mb-container",
19
  'unitfield' => 'container_width_unit',
@@ -85,6 +85,8 @@ class containerBlock extends maxBlock
85
  unset($css['mb-container']['normal']["width"]);
86
  }
87
 
 
 
88
  foreach($screens as $screen)
89
  {
90
  if ($screen->id == 'default')
@@ -102,6 +104,7 @@ class containerBlock extends maxBlock
102
  unset($css['mb-container']['responsive'][$screen->id]['normal']["align"]);
103
  }
104
  }
 
105
  return $css;
106
  }
107
 
13
  protected $fields = array("container_enabled" => array("default" => "0"),
14
  "container_center_div_wrap" => array("default" => "0"),
15
 
16
+ "container_width" => array("default" => "0",
17
  "css" => "width",
18
  "csspart" => "mb-container",
19
  'unitfield' => 'container_width_unit',
85
  unset($css['mb-container']['normal']["width"]);
86
  }
87
 
88
+
89
+
90
  foreach($screens as $screen)
91
  {
92
  if ($screen->id == 'default')
104
  unset($css['mb-container']['responsive'][$screen->id]['normal']["align"]);
105
  }
106
  }
107
+
108
  return $css;
109
  }
110
 
classes/block.php CHANGED
@@ -284,6 +284,7 @@ abstract class maxBlock
284
  $is_responsive = ($screenObj->is_responsive() ) ? true : false;
285
  $screen_id = $screenObj->id;
286
 
 
287
  // if this field has a css property
288
  if (isset($field_data["css"]))
289
  {
@@ -291,14 +292,25 @@ abstract class maxBlock
291
  // $value = isset($data[$field_id]) ? $data[$field_id] : '';
292
  $value = str_replace(array(";"), '', $value); //sanitize
293
 
 
294
  if (isset($field_data['unitfield']) && ! strpos($value,"px"))
295
  {
296
  if ($value == '') $value = 0; // pixel values, no empty but 0
297
  $unitfield = $screenObj->getFieldID($field_data['unitfield']);
298
 
299
- $unit = isset($this->data[$this->blockname][$unitfield]) ? $this->data[$this->blockname][$unitfield] : false;
 
 
 
 
 
 
 
 
 
300
 
301
  $value .= ($unit == 'percent') ? '%' : 'px';
 
302
  }
303
  elseif (isset($field_data["default"]) && strpos($field_data["default"],"px") && ! strpos($value,"px"))
304
  {
284
  $is_responsive = ($screenObj->is_responsive() ) ? true : false;
285
  $screen_id = $screenObj->id;
286
 
287
+
288
  // if this field has a css property
289
  if (isset($field_data["css"]))
290
  {
292
  // $value = isset($data[$field_id]) ? $data[$field_id] : '';
293
  $value = str_replace(array(";"), '', $value); //sanitize
294
 
295
+
296
  if (isset($field_data['unitfield']) && ! strpos($value,"px"))
297
  {
298
  if ($value == '') $value = 0; // pixel values, no empty but 0
299
  $unitfield = $screenObj->getFieldID($field_data['unitfield']);
300
 
301
+ if (isset($this->data[$this->blockname][$unitfield]))
302
+ {
303
+ $unit = $this->data[$this->blockname][$unitfield]; // unitfield found
304
+ }
305
+ elseif ($is_responsive && isset($this->data[$this->blockname][$field_data['unitfield']])) // Unitfield is not stored if same as main, but can be non-default (e.g. % )
306
+ {
307
+ $unit = $this->data[$this->blockname][$field_data['unitfield']];
308
+ }
309
+ else
310
+ $unit =false;
311
 
312
  $value .= ($unit == 'percent') ? '%' : 'px';
313
+
314
  }
315
  elseif (isset($field_data["default"]) && strpos($field_data["default"],"px") && ! strpos($value,"px"))
316
  {
includes/maxbuttons-pro.php CHANGED
@@ -36,7 +36,7 @@ $admin->get_header(array("title" => $page_title, "title_action" => $buy_now_top,
36
  <div class="rating bordered">
37
  <img src="<?php echo $img_url ?>/stars.png" alt="stars" />
38
  <p>
39
- 900+ 5 Star Ratings
40
  </p>
41
  </div>
42
  <p>
@@ -196,7 +196,7 @@ $admin->get_header(array("title" => $page_title, "title_action" => $buy_now_top,
196
  <div class="container">
197
  <h2>#1 Selling WordPress Button Plugin!</h2>
198
  <div class="btn-row">
199
- <div class='price'><img src="<?php echo $img_url ?>/s2-price.png" alt="img" class="inline-block" /> <span>$19</span></div>
200
  <a href="<?php echo $middle_buy ?>" target="_blank" class="big-maxg-btn inline-block">Buy Now</a>
201
  </div>
202
  </div>
36
  <div class="rating bordered">
37
  <img src="<?php echo $img_url ?>/stars.png" alt="stars" />
38
  <p>
39
+ 1000+ 5 Star Ratings
40
  </p>
41
  </div>
42
  <p>
196
  <div class="container">
197
  <h2>#1 Selling WordPress Button Plugin!</h2>
198
  <div class="btn-row">
199
+ <div class='price'><img src="<?php echo $img_url ?>/s2-price.png" alt="img" class="inline-block" /> <span>$24</span></div>
200
  <a href="<?php echo $middle_buy ?>" target="_blank" class="big-maxg-btn inline-block">Buy Now</a>
201
  </div>
202
  </div>
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.4
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.4');
20
 
21
- define('MAXBUTTONS_RELEASE',"1 December 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.4.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.4.1');
20
 
21
+ define('MAXBUTTONS_RELEASE',"7 December 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.6
6
  Requires PHP: 5.6
7
- Stable tag: 8.4
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,10 @@ Secondly, please use latin only characters for button name ( Basic settings) and
264
 
265
  == Changelog ==
266
 
 
 
 
 
267
  = 8.4 =
268
 
269
  * [Tweak] Elementor button preview now works better
4
  Requires at least: 4.8
5
  Tested up to: 5.6
6
  Requires PHP: 5.6
7
+ Stable tag: 8.4.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.4.1 =
268
+
269
+ * Fix - Button width / Container width processed incorrectly when main and responsive are the same value, but not the default.
270
+
271
  = 8.4 =
272
 
273
  * [Tweak] Elementor button preview now works better