Version Description
- New - Auto-Tablepress integration will only add button once to output inline, to avoid repetition.
- Fix - Database error on primary key would happen occasionally when activating plugin
- Fix - Removed old database check option from code.
Download this release
Release Info
Developer | basszje |
Plugin | WordPress Button Plugin MaxButtons |
Version | 8.8.3 |
Comparing to | |
See all releases |
Code changes from version 8.8.2 to 8.8.3
- assets/integrations/tablepress/tablepress.php +13 -4
- classes/button.php +1 -1
- classes/installation.php +1 -12
- classes/maxbuttons-admin-helper.php +24 -4
- classes/maxbuttons-class.php +3 -3
- maxbuttons.php +3 -3
- readme.txt +6 -1
assets/integrations/tablepress/tablepress.php
CHANGED
@@ -7,11 +7,13 @@ class MBTablePress
|
|
7 |
|
8 |
protected $enabled = false;
|
9 |
|
|
|
|
|
10 |
public function __construct()
|
11 |
{
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
}
|
16 |
|
17 |
public function render_on($table, $options)
|
@@ -26,12 +28,19 @@ class MBTablePress
|
|
26 |
return $output;
|
27 |
}
|
28 |
|
29 |
-
public function shortcode_args($args)
|
30 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
$auto_press = apply_filters('mb/integrations/auto_inline_tablepress', true);
|
32 |
if ($this->enabled && $auto_press)
|
33 |
{
|
34 |
$args['load_css'] = 'inline'; // force inline css, because tablepress caches
|
|
|
35 |
}
|
36 |
return $args;
|
37 |
}
|
7 |
|
8 |
protected $enabled = false;
|
9 |
|
10 |
+
protected static $loaded = array();
|
11 |
+
|
12 |
public function __construct()
|
13 |
{
|
14 |
+
add_filter('tablepress_table_raw_render_data', array($this, 'render_on'), 10, 2);
|
15 |
+
add_filter('tablepress_table_output', array($this, 'render_off'));
|
16 |
+
add_filter('mb_shortcode_display_args', array($this, 'shortcode_args'), 5, 3);
|
17 |
}
|
18 |
|
19 |
public function render_on($table, $options)
|
28 |
return $output;
|
29 |
}
|
30 |
|
31 |
+
public function shortcode_args($args, $button_id, $data)
|
32 |
{
|
33 |
+
// Don't load repetitions as inline.
|
34 |
+
if (in_array($button_id, self::$loaded))
|
35 |
+
{
|
36 |
+
return $args;
|
37 |
+
}
|
38 |
+
|
39 |
$auto_press = apply_filters('mb/integrations/auto_inline_tablepress', true);
|
40 |
if ($this->enabled && $auto_press)
|
41 |
{
|
42 |
$args['load_css'] = 'inline'; // force inline css, because tablepress caches
|
43 |
+
self::$loaded[] = $button_id;
|
44 |
}
|
45 |
return $args;
|
46 |
}
|
classes/button.php
CHANGED
@@ -923,7 +923,7 @@ class maxButton
|
|
923 |
"load_css" => $load_css,
|
924 |
"compile" => $compile,
|
925 |
);
|
926 |
-
$args = apply_filters('mb_shortcode_display_args', $args);
|
927 |
|
928 |
$output = $this->display($args);
|
929 |
|
923 |
"load_css" => $load_css,
|
924 |
"compile" => $compile,
|
925 |
);
|
926 |
+
$args = apply_filters('mb_shortcode_display_args', $args, $button_id, $this->data);
|
927 |
|
928 |
$output = $this->display($args);
|
929 |
|
classes/installation.php
CHANGED
@@ -40,9 +40,6 @@ class maxInstall
|
|
40 |
// This should be done - once! Removed in time as well.
|
41 |
public static function check_database()
|
42 |
{
|
43 |
-
$checked = get_option("MB_DBASECHECK", true);
|
44 |
-
if ($checked !== false) // removing this option.
|
45 |
-
delete_option('MB_DBASECHECK');
|
46 |
|
47 |
$version = MAXBUTTONS_VERSION_NUM;
|
48 |
$installed_version = MB()->get_installed_version();
|
@@ -51,7 +48,6 @@ class maxInstall
|
|
51 |
$table = maxUtils::get_table_name();
|
52 |
|
53 |
self::activate_plugin(); // always run the DBdelta on version mismatch.
|
54 |
-
self::clear();
|
55 |
}
|
56 |
}
|
57 |
|
@@ -76,12 +72,6 @@ class maxInstall
|
|
76 |
|
77 |
}
|
78 |
|
79 |
-
/** Function to clear out obsolete and old options, items etc. */
|
80 |
-
public static function clear()
|
81 |
-
{
|
82 |
-
delete_option('MB_DBASECHECK');
|
83 |
-
}
|
84 |
-
|
85 |
/** MOVE Button Database records from FA4 to FA5 */
|
86 |
public static function updateFA()
|
87 |
{
|
@@ -505,13 +495,12 @@ class maxInstall
|
|
505 |
// IMPORTANT: There MUST be two spaces between the PRIMARY KEY keywords
|
506 |
// and the column name, and the column name MUST be in parenthesis.
|
507 |
$sql = "CREATE TABLE " . $table_name . " (
|
508 |
-
|
509 |
name varchar(100) NULL,
|
510 |
status varchar(10) default 'publish' NOT NULL,
|
511 |
cache text,
|
512 |
";
|
513 |
|
514 |
-
|
515 |
foreach($blocks as $block)
|
516 |
{
|
517 |
$block_name = $block->get_name();
|
40 |
// This should be done - once! Removed in time as well.
|
41 |
public static function check_database()
|
42 |
{
|
|
|
|
|
|
|
43 |
|
44 |
$version = MAXBUTTONS_VERSION_NUM;
|
45 |
$installed_version = MB()->get_installed_version();
|
48 |
$table = maxUtils::get_table_name();
|
49 |
|
50 |
self::activate_plugin(); // always run the DBdelta on version mismatch.
|
|
|
51 |
}
|
52 |
}
|
53 |
|
72 |
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/** MOVE Button Database records from FA4 to FA5 */
|
76 |
public static function updateFA()
|
77 |
{
|
495 |
// IMPORTANT: There MUST be two spaces between the PRIMARY KEY keywords
|
496 |
// and the column name, and the column name MUST be in parenthesis.
|
497 |
$sql = "CREATE TABLE " . $table_name . " (
|
498 |
+
id int(14) NOT NULL AUTO_INCREMENT,
|
499 |
name varchar(100) NULL,
|
500 |
status varchar(10) default 'publish' NOT NULL,
|
501 |
cache text,
|
502 |
";
|
503 |
|
|
|
504 |
foreach($blocks as $block)
|
505 |
{
|
506 |
$block_name = $block->get_name();
|
classes/maxbuttons-admin-helper.php
CHANGED
@@ -218,16 +218,36 @@ class maxAdmin
|
|
218 |
|
219 |
$mbadmin = MB()->getClass("admin");
|
220 |
$pag = $mbadmin->getButtonPages($page_args);
|
221 |
-
if ($pag["first"] == $pag["last"])
|
222 |
-
{ return; }
|
223 |
|
224 |
|
225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
?>
|
228 |
<div class='tablenav <?php echo $location ?>'>
|
229 |
<div class="tablenav-pages">
|
230 |
-
<span class="displaying-num"><?php echo $
|
231 |
<span class="pagination-links">
|
232 |
|
233 |
<?php if (! $first_url): ?>
|
218 |
|
219 |
$mbadmin = MB()->getClass("admin");
|
220 |
$pag = $mbadmin->getButtonPages($page_args);
|
|
|
|
|
221 |
|
222 |
|
223 |
+
|
224 |
+
//extract($pag);
|
225 |
+
self::show_pagination($pag, $location);
|
226 |
+
|
227 |
+
}
|
228 |
+
|
229 |
+
public static function show_pagination($args, $location)
|
230 |
+
{
|
231 |
+
$first_url = $args['first_url'];
|
232 |
+
$first = $args['first'];
|
233 |
+
$base = $args['base'];
|
234 |
+
$first_url = $args['first_url'];
|
235 |
+
$last = $args['last'];
|
236 |
+
$last_url = $args['last_url'];
|
237 |
+
$next_url = $args['next_url'];
|
238 |
+
$prev_url = $args['prev_url'];
|
239 |
+
$prev_page = $args['prev_page'];
|
240 |
+
$next_page = $args['next_page'];
|
241 |
+
$total = $args['total'];
|
242 |
+
$current = $args['current'];
|
243 |
+
|
244 |
+
if ($first == $last)
|
245 |
+
{ return; }
|
246 |
|
247 |
?>
|
248 |
<div class='tablenav <?php echo $location ?>'>
|
249 |
<div class="tablenav-pages">
|
250 |
+
<span class="displaying-num"><?php echo $total ?> items</span>
|
251 |
<span class="pagination-links">
|
252 |
|
253 |
<?php if (! $first_url): ?>
|
classes/maxbuttons-class.php
CHANGED
@@ -161,7 +161,7 @@ class maxButtonsPlugin
|
|
161 |
$this->setMainClasses(); // struct for override functionality
|
162 |
|
163 |
// The second the blocks are being loaded, check dbase integrity
|
164 |
-
add_action("mb_blockclassesloaded", array($this, "check_database"));
|
165 |
|
166 |
// setup page hooks and shortcode
|
167 |
add_shortcode('maxcollection', array($this, 'collection_shortcode'));
|
@@ -189,7 +189,7 @@ class maxButtonsPlugin
|
|
189 |
}
|
190 |
|
191 |
// from block loader action. Checks if all parts of the table are there, or panic if not.
|
192 |
-
public function check_database($blocks)
|
193 |
{
|
194 |
maxUtils::addTime("Check database");
|
195 |
|
@@ -214,7 +214,7 @@ class maxButtonsPlugin
|
|
214 |
}
|
215 |
|
216 |
maxUtils::addTime("End check database");
|
217 |
-
}
|
218 |
|
219 |
public function getClass($class)
|
220 |
{
|
161 |
$this->setMainClasses(); // struct for override functionality
|
162 |
|
163 |
// The second the blocks are being loaded, check dbase integrity
|
164 |
+
//add_action("mb_blockclassesloaded", array($this, "check_database"));
|
165 |
|
166 |
// setup page hooks and shortcode
|
167 |
add_shortcode('maxcollection', array($this, 'collection_shortcode'));
|
189 |
}
|
190 |
|
191 |
// from block loader action. Checks if all parts of the table are there, or panic if not.
|
192 |
+
/*public function check_database($blocks)
|
193 |
{
|
194 |
maxUtils::addTime("Check database");
|
195 |
|
214 |
}
|
215 |
|
216 |
maxUtils::addTime("End check database");
|
217 |
+
} */
|
218 |
|
219 |
public function getClass($class)
|
220 |
{
|
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.8.
|
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.8.
|
20 |
|
21 |
-
define('MAXBUTTONS_RELEASE',"
|
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.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.8.3');
|
20 |
|
21 |
+
define('MAXBUTTONS_RELEASE',"2 December 2021");
|
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.8
|
6 |
Requires PHP: 7.0
|
7 |
-
Stable tag: 8.8.
|
8 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
|
9 |
|
10 |
== Description ==
|
@@ -268,6 +268,11 @@ Secondly, please use latin only characters for button name ( Basic settings) and
|
|
268 |
|
269 |
== Changelog ==
|
270 |
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
= 8.8.2 =
|
273 |
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 5.8
|
6 |
Requires PHP: 7.0
|
7 |
+
Stable tag: 8.8.3
|
8 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
|
9 |
|
10 |
== Description ==
|
268 |
|
269 |
== Changelog ==
|
270 |
|
271 |
+
= 8.8.3 =
|
272 |
+
|
273 |
+
* New - Auto-Tablepress integration will only add button once to output inline, to avoid repetition.
|
274 |
+
* Fix - Database error on primary key would happen occasionally when activating plugin
|
275 |
+
* Fix - Removed old database check option from code.
|
276 |
|
277 |
= 8.8.2 =
|
278 |
|