Boxzilla - Version 3.2.18

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 Boxzilla
Version 3.2.18
Comparing to
See all releases

Code changes from version 3.2.17 to 3.2.18

CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
  Changelog
2
  ==========
3
 
 
 
 
 
 
 
 
4
  #### 3.2.17 - Nov 18, 2019
5
 
6
  **Fixes**
1
  Changelog
2
  ==========
3
 
4
+ #### 3.2.18 - Dec 2, 2019
5
+
6
+ **Fixes**
7
+
8
+ - Missing quotes in HTML attribute on "edit box" page.
9
+
10
+
11
  #### 3.2.17 - Nov 18, 2019
12
 
13
  **Fixes**
bootstrap.php CHANGED
@@ -15,36 +15,43 @@ $provider->register( $boxzilla );
15
 
16
 
17
  // Rest of bootstrapping runs at plugins_loaded:90
18
- add_action( 'plugins_loaded', function() use( $boxzilla ) {
19
-
20
- // load default filters
21
- require __DIR__ . '/src/default-filters.php';
22
- require __DIR__ . '/src/default-actions.php';
23
-
24
- if (defined('DOING_AJAX') && DOING_AJAX) {
25
- $boxzilla['filter.autocomplete']->init();
26
- $boxzilla['admin.menu']->init();
27
- } else if(defined('DOING_CRON') && DOING_CRON) {
28
- $boxzilla['license_poller']->init();
29
- } elseif (is_admin()) {
30
- $boxzilla['admin']->init();
31
- $boxzilla['admin.menu']->init();
32
- } else {
33
- add_action( 'template_redirect', function() use( $boxzilla ) {
34
- $boxzilla['box_loader']->init();
35
- });
36
- }
37
-
38
- // license manager
39
- if( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
40
- $boxzilla['license_manager']->init();
41
-
42
- if( count( $boxzilla->plugins ) > 0 ) {
43
- $boxzilla['update_manager']->init();
44
- }
45
- }
46
-
47
- // for legacy reasons: Boxzilla Theme Pack & Boxzilla WooCommerce used this
48
- // we will be removing this in future versions
49
- $boxzilla['bootstrapper']->run();
50
- }, 90 );
 
 
 
 
 
 
 
15
 
16
 
17
  // Rest of bootstrapping runs at plugins_loaded:90
18
+ add_action(
19
+ 'plugins_loaded',
20
+ function() use ( $boxzilla ) {
21
+
22
+ // load default filters
23
+ require __DIR__ . '/src/default-filters.php';
24
+ require __DIR__ . '/src/default-actions.php';
25
+
26
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
27
+ $boxzilla['filter.autocomplete']->init();
28
+ $boxzilla['admin.menu']->init();
29
+ } elseif ( defined( 'DOING_CRON' ) && DOING_CRON ) {
30
+ $boxzilla['license_poller']->init();
31
+ } elseif ( is_admin() ) {
32
+ $boxzilla['admin']->init();
33
+ $boxzilla['admin.menu']->init();
34
+ } else {
35
+ add_action(
36
+ 'template_redirect',
37
+ function() use ( $boxzilla ) {
38
+ $boxzilla['box_loader']->init();
39
+ }
40
+ );
41
+ }
42
+
43
+ // license manager
44
+ if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
45
+ $boxzilla['license_manager']->init();
46
+
47
+ if ( count( $boxzilla->plugins ) > 0 ) {
48
+ $boxzilla['update_manager']->init();
49
+ }
50
+ }
51
+
52
+ // for legacy reasons: Boxzilla Theme Pack & Boxzilla WooCommerce used this
53
+ // we will be removing this in future versions
54
+ $boxzilla['bootstrapper']->run();
55
+ },
56
+ 90
57
+ );
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.2.17
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
@@ -41,21 +41,21 @@ if ( ! defined( 'ABSPATH' ) ) {
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
- define('BOXZILLA_VERSION', '3.2.17');
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
48
 
49
  // Check if we're on PHP 5.2, if so: bail early.
50
- if( version_compare( PHP_VERSION, '5.3', '<' ) ) {
51
- require dirname( __FILE__ ) . '/src/class-php-fallback.php';
52
- new Boxzilla_PHP_Fallback( 'Boxzilla', plugin_basename( __FILE__ ) );
53
- return;
54
  }
55
 
56
  // load autoloader but only if not loaded already (for compat with sitewide autoloader)
57
- if( ! function_exists( 'boxzilla' ) ) {
58
- require __DIR__ . '/vendor/autoload.php';
59
  }
60
 
61
  // register activation hook
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.2.18
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.2.18' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
48
 
49
  // Check if we're on PHP 5.2, if so: bail early.
50
+ if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
51
+ require dirname( __FILE__ ) . '/src/class-php-fallback.php';
52
+ new Boxzilla_PHP_Fallback( 'Boxzilla', plugin_basename( __FILE__ ) );
53
+ return;
54
  }
55
 
56
  // load autoloader but only if not loaded already (for compat with sitewide autoloader)
57
+ if ( ! function_exists( 'boxzilla' ) ) {
58
+ require __DIR__ . '/vendor/autoload.php';
59
  }
60
 
61
  // register activation hook
phpcs.xml CHANGED
@@ -1,6 +1,8 @@
1
  <?xml version="1.0"?>
2
  <ruleset name="rules">
3
  <description>rules</description>
 
 
4
  <file>src/</file>
5
  <rule ref="WordPress-Core">
6
  <exclude name="WordPress.PHP.YodaConditions" />
1
  <?xml version="1.0"?>
2
  <ruleset name="rules">
3
  <description>rules</description>
4
+ <file>bootstrap.php</file>
5
+ <file>boxzilla.php</file>
6
  <file>src/</file>
7
  <rule ref="WordPress-Core">
8
  <exclude name="WordPress.PHP.YodaConditions" />
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
- Stable tag: 3.2.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -130,6 +130,13 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
130
  == Changelog ==
131
 
132
 
 
 
 
 
 
 
 
133
  #### 3.2.17 - Nov 18, 2019
134
 
135
  **Fixes**
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.6
6
  Tested up to: 5.3
7
+ Stable tag: 3.2.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
130
  == Changelog ==
131
 
132
 
133
+ #### 3.2.18 - Dec 2, 2019
134
+
135
+ **Fixes**
136
+
137
+ - Missing quotes in HTML attribute on "edit box" page.
138
+
139
+
140
  #### 3.2.17 - Nov 18, 2019
141
 
142
  **Fixes**
src/admin/views/metaboxes/box-option-controls.php CHANGED
@@ -88,7 +88,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
88
  <option value="not_contains" <?php selected( isset( $rule['qualifier'] ) && $rule['qualifier'] === 'not_contains' ); ?> style="display: none;"><?php _e( 'does not contain', 'boxzilla' ); ?></option>
89
  </select>
90
 
91
- <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][<?php echo $key; ?>][value]" type="text" value="<?php echo esc_attr( $rule['value'] ); ?>" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style=<?php echo in_array( $rule['condition'], array( '', 'everywhere' ), true ) ? 'display: none;' : ''; ?>" />
92
  </td>
93
  </tr>
94
  <?php
88
  <option value="not_contains" <?php selected( isset( $rule['qualifier'] ) && $rule['qualifier'] === 'not_contains' ); ?> style="display: none;"><?php _e( 'does not contain', 'boxzilla' ); ?></option>
89
  </select>
90
 
91
+ <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][<?php echo $key; ?>][value]" type="text" value="<?php echo esc_attr( $rule['value'] ); ?>" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style="<?php echo in_array( $rule['condition'], array( '', 'everywhere' ), true ) ? 'display: none;' : ''; ?>" />
92
  </td>
93
  </tr>
94
  <?php
src/class-bootstrapper.php CHANGED
@@ -14,18 +14,18 @@ use InvalidArgumentException;
14
  * @method void ajax( callable $callback )
15
  * @method void cli( callable $callback )
16
  */
17
- class Bootstrapper
18
- {
19
 
20
  /**
21
  * @var array
22
  */
23
  private $bootstrappers = array(
24
- 'admin' => array(),
25
- 'ajax' => array(),
26
- 'cli' => array(),
27
- 'cron' => array(),
28
- 'front' => array(),
29
  'global' => array(),
30
  );
31
 
@@ -33,14 +33,13 @@ class Bootstrapper
33
  * @param string $section
34
  * @param callable $callable
35
  */
36
- public function register($section, $callable)
37
- {
38
- if (! isset($this->bootstrappers[ $section ])) {
39
- throw new InvalidArgumentException("Section $section is invalid.");
40
  }
41
 
42
- if (! is_callable($callable)) {
43
- throw new InvalidArgumentException('Callable argument is not callable.');
44
  }
45
 
46
  $this->bootstrappers[ $section ][] = $callable;
@@ -50,10 +49,9 @@ class Bootstrapper
50
  * @param string $name
51
  * @param array $arguments
52
  */
53
- public function __call($name, $arguments)
54
- {
55
- if (isset($this->bootstrappers[ $name ])) {
56
- $this->register($name, $arguments[0]);
57
  }
58
  }
59
 
@@ -62,19 +60,18 @@ class Bootstrapper
62
  *
63
  * @param string $section
64
  */
65
- public function run($section = '')
66
- {
67
- if (! $section) {
68
  $section = $this->section();
69
  }
70
 
71
  // call all global callbacks
72
- foreach ($this->bootstrappers['global'] as $callback) {
73
  $callback();
74
  }
75
 
76
  // call section specific callbacks
77
- foreach ($this->bootstrappers[ $section ] as $callback) {
78
  $callback();
79
  }
80
  }
@@ -84,18 +81,17 @@ class Bootstrapper
84
  *
85
  * @return string
86
  */
87
- public function section()
88
- {
89
- if (is_admin()) {
90
- if (defined('DOING_AJAX') && DOING_AJAX) {
91
  return 'ajax';
92
  } else {
93
  return 'admin';
94
  }
95
  } else {
96
- if (defined('DOING_CRON') && DOING_CRON) {
97
  return 'cron';
98
- } elseif (defined('WP_CLI') && WP_CLI) {
99
  return 'cli';
100
  } else {
101
  return 'front';
14
  * @method void ajax( callable $callback )
15
  * @method void cli( callable $callback )
16
  */
17
+ class Bootstrapper {
18
+
19
 
20
  /**
21
  * @var array
22
  */
23
  private $bootstrappers = array(
24
+ 'admin' => array(),
25
+ 'ajax' => array(),
26
+ 'cli' => array(),
27
+ 'cron' => array(),
28
+ 'front' => array(),
29
  'global' => array(),
30
  );
31
 
33
  * @param string $section
34
  * @param callable $callable
35
  */
36
+ public function register( $section, $callable ) {
37
+ if ( ! isset( $this->bootstrappers[ $section ] ) ) {
38
+ throw new InvalidArgumentException( "Section $section is invalid." );
 
39
  }
40
 
41
+ if ( ! is_callable( $callable ) ) {
42
+ throw new InvalidArgumentException( 'Callable argument is not callable.' );
43
  }
44
 
45
  $this->bootstrappers[ $section ][] = $callable;
49
  * @param string $name
50
  * @param array $arguments
51
  */
52
+ public function __call( $name, $arguments ) {
53
+ if ( isset( $this->bootstrappers[ $name ] ) ) {
54
+ $this->register( $name, $arguments[0] );
 
55
  }
56
  }
57
 
60
  *
61
  * @param string $section
62
  */
63
+ public function run( $section = '' ) {
64
+ if ( ! $section ) {
 
65
  $section = $this->section();
66
  }
67
 
68
  // call all global callbacks
69
+ foreach ( $this->bootstrappers['global'] as $callback ) {
70
  $callback();
71
  }
72
 
73
  // call section specific callbacks
74
+ foreach ( $this->bootstrappers[ $section ] as $callback ) {
75
  $callback();
76
  }
77
  }
81
  *
82
  * @return string
83
  */
84
+ public function section() {
85
+ if ( is_admin() ) {
86
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
 
87
  return 'ajax';
88
  } else {
89
  return 'admin';
90
  }
91
  } else {
92
+ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
93
  return 'cron';
94
+ } elseif ( defined( 'WP_CLI' ) && WP_CLI ) {
95
  return 'cli';
96
  } else {
97
  return 'front';
src/licensing/class-update-manager.php CHANGED
@@ -184,7 +184,7 @@ class UpdateManager {
184
  $local_plugin = $this->extensions[ $remote_plugin->sid ];
185
 
186
  // plugin found and local plugin version not same as remote version?
187
- if ( !$local_plugin || version_compare( $local_plugin->version(), $remote_plugin->new_version, '>=' ) ) {
188
  continue;
189
  }
190
 
@@ -199,12 +199,12 @@ class UpdateManager {
199
 
200
  $plugin_data = get_plugin_data( $plugin_file );
201
 
202
- if ( !$plugin_data || version_compare( $plugin_data['Version'], $remote_plugin->new_version, '>=' ) ) {
203
  continue;
204
  }
205
 
206
  // add some dynamic data
207
- $slug = plugin_basename( $plugin_file );
208
  $available_updates[ $slug ] = $this->format_response( $slug, $remote_plugin );
209
  }
210
  }
@@ -236,7 +236,7 @@ class UpdateManager {
236
  * @return mixed
237
  */
238
  protected function format_response( $slug, $response ) {
239
- $response->slug = dirname($slug);
240
  $response->plugin = $slug;
241
 
242
  // add some notices if license is inactive
184
  $local_plugin = $this->extensions[ $remote_plugin->sid ];
185
 
186
  // plugin found and local plugin version not same as remote version?
187
+ if ( ! $local_plugin || version_compare( $local_plugin->version(), $remote_plugin->new_version, '>=' ) ) {
188
  continue;
189
  }
190
 
199
 
200
  $plugin_data = get_plugin_data( $plugin_file );
201
 
202
+ if ( ! $plugin_data || version_compare( $plugin_data['Version'], $remote_plugin->new_version, '>=' ) ) {
203
  continue;
204
  }
205
 
206
  // add some dynamic data
207
+ $slug = plugin_basename( $plugin_file );
208
  $available_updates[ $slug ] = $this->format_response( $slug, $remote_plugin );
209
  }
210
  }
236
  * @return mixed
237
  */
238
  protected function format_response( $slug, $response ) {
239
+ $response->slug = dirname( $slug );
240
  $response->plugin = $slug;
241
 
242
  // add some notices if license is inactive