WordPress Button Plugin MaxButtons - Version 7.13.3

Version Description

  • Fixed - relative require_once include, sometimes this crashes.
  • Fixed - Catching error when directoryIterator fails
Download this release

Release Info

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

Code changes from version 7.13.2 to 7.13.3

assets/integrations/shortcake/shortcake.php CHANGED
@@ -18,7 +18,9 @@ class mbCake
18
 
19
  public static function initField()
20
  {
21
- require_once('class-field-maxbutton.php');
 
 
22
 
23
  Shortcake_Field_MaxButton::get_instance();
24
 
18
 
19
  public static function initField()
20
  {
21
+ //MB()->get_plugin_path()
22
+ $integration_path = MB()->get_plugin_path() . 'assets/integrations/';
23
+ require_once($integration_path . 'shortcake/class-field-maxbutton.php');
24
 
25
  Shortcake_Field_MaxButton::get_instance();
26
 
classes/maxbuttons-class.php CHANGED
@@ -58,9 +58,20 @@ class maxButtonsPlugin
58
  {
59
  $directory_path = realpath($plugin_path . $short_path);
60
 
61
- if ($directory_path !== false)
62
  {
63
- $it = new \DirectoryIterator($directory_path);
 
 
 
 
 
 
 
 
 
 
 
64
  foreach($it as $file)
65
  {
66
  $file_path = $file->getRealPath();
58
  {
59
  $directory_path = realpath($plugin_path . $short_path);
60
 
61
+ if ($directory_path !== false && is_dir($directory_path))
62
  {
63
+ try
64
+ {
65
+ $it = new \DirectoryIterator($directory_path);
66
+ }
67
+ catch (\UnexpectedValueException $e)
68
+ {
69
+ echo '<div style="margin-left:170px"><h1>' . __('Fatal Problem with MaxButtons', 'maxbuttons') . '</h1>';
70
+ echo sprintf(__('Can\'t read directory. %s Reinstall the plugin or check directory permissions', 'maxbuttons'), $directory_path);
71
+ echo '</div>';
72
+ return;
73
+ }
74
+
75
  foreach($it as $file)
76
  {
77
  $file_path = $file->getRealPath();
includes/maxbuttons-collection-edit.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
- namespace MaxButtons;
3
- defined('ABSPATH') or die('No direct access permitted');
4
-
5
- global $page_title;
6
-
7
- $collections = MB()->getClass("collections");
8
-
9
- $collection_type = (isset($_REQUEST["collection"])) ? sanitize_text_field($_REQUEST["collection"]) : 'basic';
10
- $collection = $collections::getCollection($collection_type);
11
-
12
-
13
- // handle submits
14
- if ($_POST) {
15
-
16
- $collection_id = intval($_POST["collection_id"]);
17
- $collection->set($collection_id);
18
-
19
- // this can be a new id (!)
20
- $collection_id = $collection->save($_POST);
21
- }
22
- else
23
- {
24
- $collection_id = isset($_REQUEST["collection_id"]) ? intval($_REQUEST["collection_id"]) : 0;
25
- }
26
-
27
- $nonce = wp_create_nonce('collection-edit-' . $collection_id);
28
- $block_nonce = wp_create_nonce('mbpro_collection_block-' . $collection_id);
29
-
30
- $collection->set($collection_id);
31
- $basic = $collection->getBlock("basic")->get();
32
- $collection_name = $basic["name"];
33
-
34
- $tab = isset($_REQUEST["tab"]) ? sanitize_text_field($_REQUEST["tab"]) : '';
35
-
36
- $page_title = __("Edit Social Share", "maxbuttons");
37
- $admin = MB()->getClass("admin");
38
-
39
- $action = "<a class='page-title-action add-new-h2' href='" . admin_url() . "admin.php?page=maxbuttons-collections&action=edit&collection=social'>" . __('Add New', 'maxbuttons') . "</a>";
40
-
41
- $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action));
42
-
43
-
44
- $button = MB()->getClass("button");
45
-
46
- ?>
47
- <?php if ($collection_id > 0): ?>
48
- <div class="mb-message shortcode">
49
- <?php $button_name = $button->getName(); ?>
50
- <?php _e('To use this collection, place the following shortcode anywhere in your site content:', 'maxbuttons') ?>
51
- <strong>[maxcollection id="<?php echo $collection_id ?>"]</strong> <i><?php _e("or","maxbuttons"); ?></i> <strong>[maxcollection name="<?php echo $collection_name ?>"]</strong>
52
-
53
-
54
- </div>
55
- <?php endif; ?>
56
-
57
- <?php
58
- /* Display admin notices [deprecated]
59
- @ignore
60
- */
61
- do_action("mb_display_notices");
62
-
63
- /* Display admin notices
64
-
65
- Hook to display admin notices on error and other occurences in the editor. Follows WP guidelines on format. Use @see add_notice to add
66
- notices.
67
-
68
- @since 4.20
69
- */
70
- do_action('mb/collection/display_notices');
71
- ?>
72
-
73
-
74
- <form method="post" id='collection_edit' class="mb_ajax_save">
75
-
76
-
77
- <?php $collection->showBlocks(); ?>
78
-
79
-
80
- <?php $collection->display_field_map(); ?>
81
- <input type="hidden" name="action" value="collection-edit">
82
- <input type="hidden" name="collection_id" value="<?php echo $collection_id ?>">
83
- <input type="hidden" name="nonce" value="<?php echo $nonce ?>">
84
- <input type="hidden" name="block_nonce" value="<?php echo $block_nonce ?>">
85
- <input type="hidden" name="tab" value="<?php echo $tab ?>" />
86
- <input type="hidden" name="collection_type" value="<?php echo $collection_type ?>" >
87
-
88
- <div class="form-actions">
89
- <input type="submit" data-form='collection_edit' name="submit" value="<?php _e('Save All', 'maxbuttons') ?>" class="button-primary ">
90
- </div>
91
- </form>
92
-
93
- <?php
94
-
95
- $admin->get_footer();
96
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/maxbuttons-collection-list.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- namespace MaxButtons;
3
- defined('ABSPATH') or die('No direct access permitted');
4
-
5
- global $page_title;
6
- $page_title = __("Social Share", "maxbuttons");
7
- $admin = MB()->getClass("admin");
8
-
9
- $action = "<a class='page-title-action add-new-h2' href='" . admin_url() . "admin.php?page=maxbuttons-collections&action=edit&collection=social'>" . __('Add New', 'maxbuttons') . "</a>";
10
-
11
- $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action));
12
-
13
- $collections = maxCollections::getCollections();
14
- $maxCol = new maxCollection();
15
-
16
- //if (count($collections) == 0) :
17
- require_once('social-share.php');
18
-
19
- //else:
20
-
21
- ?>
22
- <!--
23
- <a class="page-title-action collection-addnew" href="<?php echo admin_url() ?>admin.php?page=maxbuttons-collections&action=edit&collection=social">
24
- <?php _e("Add New","maxbuttons"); ?></a> -->
25
-
26
- <?php //endif;
27
- ?>
28
-
29
- <?php
30
-
31
- /* Display admin notices
32
-
33
- Hook to display admin notices on error and other occurences in the editor. Follows WP guidelines on format.
34
- @since 4.20
35
- */
36
- do_action('mb/collection/display_notices');
37
- ?>
38
- </span>
39
-
40
-
41
- <span class="remove_action_title" style="display:none"><?php _e("Removing this collection","maxbuttons"); ?></span>
42
- <span class="remove_action_text" style="display:none"><?php _e("Are you sure you want to permanently delete this collection?", "maxbuttons"); ?></span>
43
-
44
-
45
-
46
- <div class='collection_list'>
47
- <?php
48
-
49
-
50
- foreach ($collections as $index => $data)
51
- {
52
- $id = $data["collection_id"];
53
- $name = $maxCol->get_meta($id, "collection_name");
54
- $name = isset($name['collection_name']) ? $name["collection_name"] : '';
55
-
56
-
57
- $collection = maxCollections::getCollectionById($id);
58
- if (! $collection)
59
- continue;
60
-
61
- $collection_type = $collection->getType();
62
- $block_nonce = wp_create_nonce('mbpro_collection_block-' . $id);
63
-
64
- $button_count = 0;
65
- $picker = $collection->getBlock("picker");
66
- if ($picker)
67
- {
68
- $picker_data = $picker->get();
69
- $button_count = count($picker_data["selection"]);
70
- }
71
-
72
- ?>
73
-
74
- <div class='collection collection-<?php echo $id ?>' data-id="<?php echo $id ?>" data-blocknonce="<?php echo $block_nonce ?>" data-type="<?php echo $collection_type ?>">
75
- <div class="collection_remove dashicons dashicons-no"></div>
76
-
77
- <h3 class='title'><a href="?page=maxbuttons-collections&action=edit&collection=social&collection_id=<?php echo $id ?>"><?php echo $name; ?></a>
78
-
79
- <?php if ($button_count > 0): ?>
80
- <span class="button-count">(<?php echo $button_count ?> <?php _e("Buttons","maxbuttons"); ?>)</span>
81
- <?php endif; ?>
82
- </h3>
83
-
84
- <div class="collection-container">
85
- <?php
86
-
87
- $args = array("preview" => true,
88
-
89
- );
90
-
91
- $collection->display($args);
92
-
93
- ?>
94
- </div>
95
- <p>[maxcollection id="<?php echo $id ?>"]</p>
96
- <p><a href="?page=maxbuttons-collections&action=edit&collection=social&collection_id=<?php echo $id ?>"><?php _e("Edit","maxbuttons"); ?></a></p>
97
- <!-- <p>[ Edit - Delete ] </p> -->
98
-
99
- </div>
100
- <?php
101
- }
102
-
103
- /*
104
- if (count($collections) == 0)
105
- {
106
- do_action("mb-display-collection-welcome");
107
- } */
108
- ?>
109
-
110
- </div> <!-- // collection-list -->
111
- </div> <!-- // main -->
112
- <div class="ad-wrap">
113
- <?php do_action("mb-display-ads"); ?>
114
- </div>
115
-
116
- <?php
117
- $admin->get_footer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/maxbuttons-collections.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace MaxButtons;
3
- defined('ABSPATH') or die('No direct access permitted');
4
-
5
-
6
- require_once('social-share.php');
7
-
8
- /*switch($action)
9
- {
10
- case "edit":
11
- require_once("maxbuttons-collection-edit.php");
12
- break;
13
- case 'nosimplexml':
14
- require_once('maxbuttons-no-simplexml.php');
15
- break;
16
- default;
17
- require_once("maxbuttons-collection-list.php");
18
- break;
19
- } */
20
-
21
-
22
-
23
-
24
-
25
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 7.13.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', '7.13.2');
20
 
21
- define('MAXBUTTONS_RELEASE',"31 October 2019");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
@@ -40,25 +40,9 @@ if (function_exists("MaxButtons\MB"))
40
  // define("MAXBUTTONS_DEBUG", true);
41
  // define("MAXBUTTONS_BENCHMARK",true);
42
 
43
- require_once("classes/maxbuttons-class.php");
44
 
45
- // core
46
- /*require_once('classes/button.php');
47
- require_once('classes/buttons.php');
48
- require_once("classes/installation.php");
49
- require_once("classes/max-utils.php");
50
-
51
- // more core
52
- require_once("classes/block.php");
53
- require_once('classes/field.php');
54
- require_once('classes/blocks.php');
55
-
56
- require_once("classes/maxCSSParser.php");
57
- require_once("classes/admin-class.php");
58
-
59
- require_once("classes/integrations.php");
60
-
61
- require_once("includes/maxbuttons-admin-helper.php");
62
 
63
  // external libraries
64
  if ( version_compare(PHP_VERSION, '5.4', '<' ) )
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: 7.13.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', '7.13.3');
20
 
21
+ define('MAXBUTTONS_RELEASE',"11 November 2019");
22
 
23
  if (! function_exists('MaxButtons\maxbutton_double_load'))
24
  {
40
  // define("MAXBUTTONS_DEBUG", true);
41
  // define("MAXBUTTONS_BENCHMARK",true);
42
 
43
+ require_once( trailingslashit(dirname(MAXBUTTONS_ROOT_FILE)) . "classes/maxbuttons-class.php");
44
 
45
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  // external libraries
48
  if ( version_compare(PHP_VERSION, '5.4', '<' ) )
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.3
6
  Requires PHP: 5.6
7
- Stable tag: 7.13.2
8
 
9
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
10
 
@@ -255,6 +255,10 @@ Secondly, please use latin only characters for button name ( Basic settings) and
255
 
256
  == Changelog ==
257
 
 
 
 
 
258
 
259
  = 7.13.2 =
260
 
4
  Requires at least: 4.8
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 7.13.3
8
 
9
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
10
 
255
 
256
  == Changelog ==
257
 
258
+ = 7.13.3 =
259
+
260
+ * Fixed - relative require_once include, sometimes this crashes.
261
+ * Fixed - Catching error when directoryIterator fails
262
 
263
  = 7.13.2 =
264