--- a/breeze/breeze.php
+++ b/breeze/breeze.php
@@ -2,7 +2,7 @@
/**
* Plugin Name: Breeze
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
- * Version: 2.2.21
+ * Version: 2.2.22
* Text Domain: breeze
* Domain Path: /languages
* Author: Cloudways
@@ -37,7 +37,7 @@
define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'BREEZE_VERSION' ) ) {
- define( 'BREEZE_VERSION', '2.2.21' );
+ define( 'BREEZE_VERSION', '2.2.22' );
}
if ( ! defined( 'BREEZE_SITEURL' ) ) {
define( 'BREEZE_SITEURL', get_site_url() );
@@ -160,7 +160,6 @@
$api_enabled = Breeze_Options_Reader::get_option_value( 'breeze-enable-api' );
if ( $api_enabled ) {
$options = array(
- 'breeze-secure-api' => Breeze_Options_Reader::get_option_value( 'breeze-secure-api' ),
'breeze-api-token' => Breeze_Options_Reader::get_option_value( 'breeze-api-token' ),
);
--- a/breeze/inc/breeze-admin.php
+++ b/breeze/inc/breeze-admin.php
@@ -747,7 +747,6 @@
'breeze-store-facebookpixel-locally' => '0',
'breeze-store-gravatars-locally' => '0',
'breeze-enable-api' => '0',
- 'breeze-secure-api' => '0',
'breeze-api-token' => $token,
);
$default_data['advanced'] = array_merge( $default_advanced, $advanced );
--- a/breeze/inc/breeze-configuration.php
+++ b/breeze/inc/breeze-configuration.php
@@ -384,7 +384,6 @@
'breeze-store-facebookpixel-locally' => ( isset( $_POST['breeze-store-facebookpixel-locally'] ) ? '1' : '0' ),
'breeze-store-gravatars-locally' => ( isset( $_POST['breeze-store-gravatars-locally'] ) ? '1' : '0' ),
'breeze-enable-api' => ( isset( $_POST['breeze-enable-api'] ) ? '1' : '0' ),
- 'breeze-secure-api' => ( isset( $_POST['breeze-secure-api'] ) ? '1' : '0' ),
'breeze-api-token' => sanitize_text_field( $breeze_api_token ),
);
@@ -1814,7 +1813,7 @@
* @return string
* @throws Exception
*/
- public function breeze_generate_token( $length = 12 ) {
+ public function breeze_generate_token( $length = 32 ) {
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$token = '';
@@ -1954,7 +1953,6 @@
'cached-query-strings' => array(),
'breeze-wp-emoji' => '0',
'breeze-enable-api' => '0',
- 'breeze-secure-api' => '0',
'breeze-api-token' => $token,
);
$default_heartbeat = array(
--- a/breeze/inc/class-breeze-api.php
+++ b/breeze/inc/class-breeze-api.php
@@ -25,7 +25,7 @@
public function breeze_clear_cache( $request ) {
- if ( $this->options["breeze-secure-api"] && $this->options["breeze-api-token"] != $request->get_param( 'key' ) ) {
+ if ( $this->options["breeze-api-token"] != $request->get_param( 'key' ) ) {
// Access is denied, set status code to 403 (Forbidden)
$status_code = 403;
$response_data = array(
--- a/breeze/inc/wp-cli/class-breeze-settings-import-export.php
+++ b/breeze/inc/wp-cli/class-breeze-settings-import-export.php
@@ -476,7 +476,6 @@
'breeze-store-facebookpixel-locally' => ( isset( $options['breeze-store-facebookpixel-locally'] ) ? $options['breeze-store-facebookpixel-locally'] : '0' ),
'breeze-store-gravatars-locally' => ( isset( $options['breeze-store-gravatars-locally'] ) ? $options['breeze-store-gravatars-locally'] : '0' ),
'breeze-enable-api' => ( isset( $options['breeze-enable-api'] ) ? $options['breeze-enable-api'] : '0' ),
- 'breeze-secure-api' => ( isset( $options['breeze-secure-api'] ) ? $options['breeze-secure-api'] : '0' ),
'breeze-api-token' => ( isset( $options['breeze-api-token'] ) ? $options['breeze-api-token'] : '' ),
);
@@ -713,7 +712,6 @@
'breeze-preload-links' => '1',
'breeze-wp-emoji' => '0',
'breeze-enable-api' => '0',
- 'breeze-secure-api' => '0',
'cdn-active' => '0',
'cdn-relative-path' => '1',
'auto-purge-varnish' => '1',
--- a/breeze/views/option-tabs/advanced-tab.php
+++ b/breeze/views/option-tabs/advanced-tab.php
@@ -59,7 +59,7 @@
$placeholder_never_cache_url = 'Exclude Single URL:
https://demo.com/example/
Exclude Multiple URL using wildcard
https://demo.com/example/(.*)';
?>
<textarea cols="100" rows="7" id="exclude-urls" name="exclude-urls"
- placeholder="<?php echo esc_attr( $placeholder_never_cache_url ); ?>"><?php echo $never_cache_urls; ?></textarea>
+ placeholder="<?php echo esc_attr( $placeholder_never_cache_url ); ?>"><?php echo $never_cache_urls; ?></textarea>
<div class="br-note">
<p>
<?php
@@ -98,7 +98,7 @@
$placeholder_cache_query_str = 'Include Single Query String:
city
Include Multiple Query Strings using wildcard
city(.*)';
?>
<textarea cols="100" rows="7" id="cache-query-str" name="cache-query-str"
- placeholder="<?php esc_attr_e( $placeholder_cache_query_str ); ?>"><?php echo $cached_query_strings; ?></textarea>
+ placeholder="<?php esc_attr_e( $placeholder_cache_query_str ); ?>"><?php echo $cached_query_strings; ?></textarea>
<div class="br-note">
<p>
<?php
@@ -132,7 +132,7 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-wpjs-emoji" name="breeze-wpjs-emoji" type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -171,8 +171,8 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-store-googlefonts-locally" name="breeze-store-googlefonts-locally"
- type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ type="checkbox" class="br-box"
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -191,8 +191,8 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-store-googleanalytics-locally" name="breeze-store-googleanalytics-locally"
- type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ type="checkbox" class="br-box"
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -211,8 +211,8 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-store-facebookpixel-locally" name="breeze-store-facebookpixel-locally"
- type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ type="checkbox" class="br-box"
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -231,8 +231,8 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-store-gravatars-locally" name="breeze-store-gravatars-locally" type="checkbox"
- class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ class="br-box"
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -268,7 +268,7 @@
<div class="on-off-checkbox">
<label class="br-switcher">
<input id="breeze-enable-api" name="breeze-enable-api" type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?>>
+ value="1" <?php echo $is_enabled; ?>>
<div class="br-see-state">
</div>
</label><br>
@@ -286,9 +286,6 @@
<!-- START OPTION -->
<?php
- $basic_value = isset( $options['breeze-secure-api'] ) ? filter_var( $options['breeze-secure-api'], FILTER_VALIDATE_BOOLEAN ) : false;
- $is_enabled = ( isset( $basic_value ) && true === $basic_value ) ? checked( $options['breeze-secure-api'], '1', false ) : '';
-
$disable_group_css = '';
$disable_overlay = '';
@@ -300,24 +297,13 @@
<div class="br-option-item<?php echo $disable_overlay; ?>">
<div class="br-label">
<div class="br-option-text">
- <?php _e( 'Authentication', 'breeze' ); ?>
+ <?php _e( 'Authentication Token', 'breeze' ); ?>
</div>
</div>
<div class="br-option">
- <!-- Checkbox -->
- <div class="on-off-checkbox">
- <label class="br-switcher">
- <input id="breeze-secure-api" name="breeze-secure-api" type="checkbox" class="br-box"
- value="1" <?php echo $is_enabled; ?> <?php echo $disable_group_css; ?>>
- <div class="br-see-state">
- </div>
- </label><br>
- </div>
-
-
<div class="br-note">
- <p>
- <?php _e( 'Secure Breeze API Endpoint with authentication key, allowing the ability option to safeguard the purge endpoint from unauthorized access. Use the option below to autogenerate a random key.', 'breeze' ); ?>
+ <p style="margin-top:0">
+ <?php _e( 'Authentication is required for the Breeze API Endpoint. Provide an authentication key to secure the purge endpoint from unauthorized access. Use the refresh icon to autogenerate a random key.', 'breeze' ); ?>
</p>
</div>
@@ -330,11 +316,15 @@
?>
<div>
<input type="text" id="breeze-api-token" name="breeze-api-token"
- placeholder="5a1404a010241e0b79aecb67581009d5"
- value="<?php echo $api_token_output; ?>"/>
+ placeholder="5a1404a010241e0b79aecb67581009d5"
+ value="<?php echo $api_token_output; ?>"/>
<a id="refresh-api-token" title="<?php esc_attr_e( 'Refresh Token', 'breeze' ); ?>">
<span class="dashicons dashicons-update"></span>
</a>
+ <a style="display: inline-block;color: #11ACDF; margin-left: 15px;" id="copy-api-token"
+ title="<?php esc_attr_e( 'Copy Token', 'breeze' ); ?>">
+ <span style="font-size: 22px;" class="dashicons dashicons-clipboard"></span>
+ </a>
</div>
<div class="br-note">