Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | Boxzilla |
Version | 3.1.12 |
Comparing to | |
See all releases |
Code changes from version 3.1.11 to 3.1.12
boxzilla.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Boxzilla
|
4 |
-
Version: 3.1.
|
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,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
41 |
function _load_boxzilla() {
|
42 |
|
43 |
define( 'BOXZILLA_FILE', __FILE__ );
|
44 |
-
define( 'BOXZILLA_VERSION', '3.1.
|
45 |
|
46 |
require __DIR__ . '/bootstrap.php';
|
47 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Boxzilla
|
4 |
+
Version: 3.1.12
|
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.1.12' );
|
45 |
|
46 |
require __DIR__ . '/bootstrap.php';
|
47 |
}
|
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.1
|
6 |
Tested up to: 4.7.4
|
7 |
-
Stable tag: 3.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -149,6 +149,13 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
|
|
149 |
== Changelog ==
|
150 |
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
#### 3.1.11 - March 22, 2017
|
153 |
|
154 |
**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.1
|
6 |
Tested up to: 4.7.4
|
7 |
+
Stable tag: 3.1.12
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
149 |
== Changelog ==
|
150 |
|
151 |
|
152 |
+
#### 3.1.12 - April 24, 2017
|
153 |
+
|
154 |
+
**Improvements**
|
155 |
+
|
156 |
+
- Update endpoint URL for license API requests.
|
157 |
+
|
158 |
+
|
159 |
#### 3.1.11 - March 22, 2017
|
160 |
|
161 |
**Fixes**
|
src/admin/class-admin.php
CHANGED
@@ -237,7 +237,7 @@ class Admin {
|
|
237 |
* Shows the extensions page
|
238 |
*/
|
239 |
public function show_extensions_page() {
|
240 |
-
|
241 |
require __DIR__ . '/views/extensions.php';
|
242 |
}
|
243 |
|
@@ -695,12 +695,11 @@ class Admin {
|
|
695 |
* @return array
|
696 |
*/
|
697 |
protected function fetch_extensions() {
|
698 |
-
|
699 |
$extensions = get_transient( 'boxzilla_remote_extensions' );
|
700 |
if ( $extensions ) {
|
701 |
return $extensions;
|
702 |
}
|
703 |
-
|
704 |
$request = wp_remote_get( 'https://api.boxzillaplugin.com/v1/plugins' );
|
705 |
|
706 |
if ( is_wp_error( $request ) ) {
|
237 |
* Shows the extensions page
|
238 |
*/
|
239 |
public function show_extensions_page() {
|
240 |
+
$extensions = $this->fetch_extensions();
|
241 |
require __DIR__ . '/views/extensions.php';
|
242 |
}
|
243 |
|
695 |
* @return array
|
696 |
*/
|
697 |
protected function fetch_extensions() {
|
698 |
+
|
699 |
$extensions = get_transient( 'boxzilla_remote_extensions' );
|
700 |
if ( $extensions ) {
|
701 |
return $extensions;
|
702 |
}
|
|
|
703 |
$request = wp_remote_get( 'https://api.boxzillaplugin.com/v1/plugins' );
|
704 |
|
705 |
if ( is_wp_error( $request ) ) {
|
src/admin/views/extensions.php
CHANGED
@@ -19,8 +19,7 @@
|
|
19 |
<p><?php printf( __( 'If not, please click here: %s.', 'boxzilla' ), '<a href="https://boxzillaplugin.com/add-ons/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=extensions-page" target="_blank">View add-on plugins</a>' ); ?></p>
|
20 |
<?php else : ?>
|
21 |
|
22 |
-
<?php foreach( $extensions as $plugin ) : ?>
|
23 |
-
|
24 |
<div class="plugin">
|
25 |
<a href="<?php echo esc_url( $plugin->page_url ); ?>" class="unstyled"><img src="<?php echo esc_url( $plugin->image_url ); ?>" alt="<?php echo $plugin->name; ?>" width="280" height="220"></a>
|
26 |
<div class="caption">
|
@@ -32,7 +31,7 @@
|
|
32 |
</p>
|
33 |
</div>
|
34 |
</div>
|
35 |
-
|
36 |
<?php endforeach; ?>
|
37 |
|
38 |
<br style="clear: both;" />
|
@@ -57,4 +56,4 @@
|
|
57 |
text-transform: uppercase;
|
58 |
font-weight: bold;
|
59 |
}
|
60 |
-
</style>
|
19 |
<p><?php printf( __( 'If not, please click here: %s.', 'boxzilla' ), '<a href="https://boxzillaplugin.com/add-ons/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=extensions-page" target="_blank">View add-on plugins</a>' ); ?></p>
|
20 |
<?php else : ?>
|
21 |
|
22 |
+
<?php foreach( $extensions as $i => $plugin ) : ?>
|
|
|
23 |
<div class="plugin">
|
24 |
<a href="<?php echo esc_url( $plugin->page_url ); ?>" class="unstyled"><img src="<?php echo esc_url( $plugin->image_url ); ?>" alt="<?php echo $plugin->name; ?>" width="280" height="220"></a>
|
25 |
<div class="caption">
|
31 |
</p>
|
32 |
</div>
|
33 |
</div>
|
34 |
+
<?php if(($i+1) % 4 === 0) { echo '<div style="clear: both;"></div>'; } ?>
|
35 |
<?php endforeach; ?>
|
36 |
|
37 |
<br style="clear: both;" />
|
56 |
text-transform: uppercase;
|
57 |
font-weight: bold;
|
58 |
}
|
59 |
+
</style>
|
src/licensing/class-api.php
CHANGED
@@ -150,13 +150,13 @@ class API {
|
|
150 |
* @throws API_Exception
|
151 |
*/
|
152 |
public function parse_response( $response ) {
|
153 |
-
// test for wp errors
|
154 |
-
|
155 |
throw new API_Exception( $response->get_error_message() );
|
156 |
}
|
157 |
|
158 |
// retrieve response body
|
159 |
-
|
160 |
$json = json_decode( $body );
|
161 |
if( ! is_object( $json ) ) {
|
162 |
throw new API_Exception( __( "The Boxzilla server returned an invalid response.", 'boxzilla' ) );
|
@@ -171,4 +171,4 @@ class API {
|
|
171 |
return $json->data;
|
172 |
}
|
173 |
|
174 |
-
}
|
150 |
* @throws API_Exception
|
151 |
*/
|
152 |
public function parse_response( $response ) {
|
153 |
+
// test for wp errors (request failures)
|
154 |
+
if( $response instanceof WP_Error) {
|
155 |
throw new API_Exception( $response->get_error_message() );
|
156 |
}
|
157 |
|
158 |
// retrieve response body
|
159 |
+
$body = wp_remote_retrieve_body( $response );
|
160 |
$json = json_decode( $body );
|
161 |
if( ! is_object( $json ) ) {
|
162 |
throw new API_Exception( __( "The Boxzilla server returned an invalid response.", 'boxzilla' ) );
|
171 |
return $json->data;
|
172 |
}
|
173 |
|
174 |
+
}
|
src/licensing/class-license-service-provider.php
CHANGED
@@ -19,7 +19,7 @@ class LicenseServiceProvider implements ServiceProviderInterface {
|
|
19 |
};
|
20 |
|
21 |
$container['license_api'] = function( $container ) {
|
22 |
-
$api_url = 'https://
|
23 |
return new API( $api_url, $container['license'] );
|
24 |
};
|
25 |
|
@@ -36,4 +36,4 @@ class LicenseServiceProvider implements ServiceProviderInterface {
|
|
36 |
};
|
37 |
}
|
38 |
|
39 |
-
}
|
19 |
};
|
20 |
|
21 |
$container['license_api'] = function( $container ) {
|
22 |
+
$api_url = 'https://platform.boxzillaplugin.com/api/v1';
|
23 |
return new API( $api_url, $container['license'] );
|
24 |
};
|
25 |
|
36 |
};
|
37 |
}
|
38 |
|
39 |
+
}
|
src/licensing/class-update-manager.php
CHANGED
@@ -132,13 +132,21 @@ class UpdateManager {
|
|
132 |
|
133 |
if( is_array( $this->available_updates ) ) {
|
134 |
return $this->available_updates;
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
// fetch remote info
|
138 |
try {
|
139 |
$remote_plugins = $this->api->get_plugins( $this->extensions );
|
140 |
-
|
141 |
-
|
|
|
|
|
142 |
}
|
143 |
|
144 |
// filter remote plugins, we only want the ones with an update available
|
@@ -223,4 +231,4 @@ class UpdateManager {
|
|
223 |
return $response;
|
224 |
}
|
225 |
|
226 |
-
}
|
132 |
|
133 |
if( is_array( $this->available_updates ) ) {
|
134 |
return $this->available_updates;
|
135 |
+
}
|
136 |
+
|
137 |
+
// don't try if we failed a request recently.
|
138 |
+
$failed_at = get_transient( 'boxzilla_request_failed' );
|
139 |
+
if( ! empty( $failed_at ) && ( (strtotime('now') - 300) < $failed_at ) ) {
|
140 |
+
return array();
|
141 |
+
}
|
142 |
|
143 |
// fetch remote info
|
144 |
try {
|
145 |
$remote_plugins = $this->api->get_plugins( $this->extensions );
|
146 |
+
} catch( API_Exception $e ) {
|
147 |
+
// set flag for 5 minutes
|
148 |
+
set_transient( 'boxzilla_request_failed', strtotime('now'), 300 );
|
149 |
+
return array();
|
150 |
}
|
151 |
|
152 |
// filter remote plugins, we only want the ones with an update available
|
231 |
return $response;
|
232 |
}
|
233 |
|
234 |
+
}
|
src/licensing/views/license-form.php
CHANGED
@@ -29,7 +29,7 @@ defined( 'ABSPATH' ) or exit;
|
|
29 |
<input size="40" name="boxzilla_license_key" placeholder="<?php esc_attr_e( 'Enter your license key..', 'boxzilla' ); ?>" value="<?php echo esc_attr( $this->license->key ); ?>" <?php if( $this->license->activated ) { echo 'readonly'; } ?> />
|
30 |
<input class="button" type="submit" name="action" value="<?php echo ( $this->license->activated ) ? 'deactivate' : 'activate'; ?>" />
|
31 |
<p class="help">
|
32 |
-
<?php echo sprintf( __( 'The license key received when purchasing your premium Boxzilla plan. <a href="%s">You can find it here</a>.', 'boxzilla' ), 'https://
|
33 |
</p>
|
34 |
</td>
|
35 |
</tr>
|
29 |
<input size="40" name="boxzilla_license_key" placeholder="<?php esc_attr_e( 'Enter your license key..', 'boxzilla' ); ?>" value="<?php echo esc_attr( $this->license->key ); ?>" <?php if( $this->license->activated ) { echo 'readonly'; } ?> />
|
30 |
<input class="button" type="submit" name="action" value="<?php echo ( $this->license->activated ) ? 'deactivate' : 'activate'; ?>" />
|
31 |
<p class="help">
|
32 |
+
<?php echo sprintf( __( 'The license key received when purchasing your premium Boxzilla plan. <a href="%s">You can find it here</a>.', 'boxzilla' ), 'https://platform.boxzillaplugin.com/' ); ?>
|
33 |
</p>
|
34 |
</td>
|
35 |
</tr>
|