Breeze – WordPress Cache Plugin - Version 1.1.6

Version Description

  • Add: Wildcard (.*) based exclusion of pattern URL strings in Never Cache These URLs option.
  • Fix: Improved validation for CDN integration.
  • Fix: General improvements to support for Elementor Forms/Elementor Pro and CDN integration.
Download this release

Release Info

Developer adeelkhan
Plugin Icon 128x128 Breeze – WordPress Cache Plugin
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

breeze.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Breeze
4
  * 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.
5
- * Version: 1.1.5
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
@@ -37,7 +37,7 @@ if ( ! defined( 'BREEZE_PLUGIN_DIR' ) ) {
37
  define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
38
  }
39
  if ( ! defined( 'BREEZE_VERSION' ) ) {
40
- define( 'BREEZE_VERSION', '1.1.5' );
41
  }
42
  if ( ! defined( 'BREEZE_SITEURL' ) ) {
43
  define( 'BREEZE_SITEURL', get_site_url() );
2
  /**
3
  * Plugin Name: Breeze
4
  * 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.
5
+ * Version: 1.1.6
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
37
  define( 'BREEZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
38
  }
39
  if ( ! defined( 'BREEZE_VERSION' ) ) {
40
+ define( 'BREEZE_VERSION', '1.1.6' );
41
  }
42
  if ( ! defined( 'BREEZE_SITEURL' ) ) {
43
  define( 'BREEZE_SITEURL', get_site_url() );
inc/breeze-configuration.php CHANGED
@@ -182,9 +182,15 @@ class Breeze_Configuration{
182
  $exclude_content = array_unique($exclude_content);
183
  }
184
 
 
 
 
 
 
 
185
  $cdn = array(
186
  'cdn-active' => (isset($_POST['activate-cdn']) ? '1' : '0'),
187
- 'cdn-url' =>(isset($_POST['cdn-url']) ? sanitize_text_field($_POST['cdn-url']) : ''),
188
  'cdn-content' => $cdn_content,
189
  'cdn-exclude-content' => $exclude_content,
190
  'cdn-relative-path' =>(isset($_POST['cdn-relative-path']) ? '1' : '0'),
182
  $exclude_content = array_unique($exclude_content);
183
  }
184
 
185
+ $cdn_url = ( isset( $_POST['cdn-url'] ) ? sanitize_text_field( $_POST['cdn-url'] ) : '' );
186
+ if ( ! empty( $cdn_url ) ) {
187
+ $cdn_url = ltrim( $cdn_url, 'https:' );
188
+ $cdn_url = '//' . ltrim( $cdn_url, '//' );
189
+ }
190
+
191
  $cdn = array(
192
  'cdn-active' => (isset($_POST['activate-cdn']) ? '1' : '0'),
193
+ 'cdn-url' => $cdn_url,
194
  'cdn-content' => $cdn_content,
195
  'cdn-exclude-content' => $exclude_content,
196
  'cdn-relative-path' =>(isset($_POST['cdn-relative-path']) ? '1' : '0'),
inc/cache/execute-cache.php CHANGED
@@ -126,11 +126,12 @@ function breeze_cache( $buffer, $flags ) {
126
  $detect = new \Cloudways\Breeze\Mobile_Detect\Mobile_Detect;
127
  //not cache per administrator if option disable optimization for admin users clicked
128
  if ( ! empty( $GLOBALS['breeze_config'] ) && (int) $GLOBALS['breeze_config']['disable_per_adminuser'] ) {
129
-
130
- $current_user = wp_get_current_user();
131
- if (in_array('administrator', $current_user->roles)) {
132
- return $buffer;
133
- }
 
134
  }
135
 
136
  if ( strlen( $buffer ) < 255 ) {
126
  $detect = new \Cloudways\Breeze\Mobile_Detect\Mobile_Detect;
127
  //not cache per administrator if option disable optimization for admin users clicked
128
  if ( ! empty( $GLOBALS['breeze_config'] ) && (int) $GLOBALS['breeze_config']['disable_per_adminuser'] ) {
129
+ if ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) {
130
+ $current_user = wp_get_current_user();
131
+ if ( in_array( 'administrator', $current_user->roles ) ) {
132
+ return $buffer;
133
+ }
134
+ }
135
  }
136
 
137
  if ( strlen( $buffer ) < 255 ) {
inc/cdn-integration/breeze-cdn-integration.php CHANGED
@@ -44,6 +44,10 @@ class Breeze_CDN_Integration{
44
  return;
45
  }
46
 
 
 
 
 
47
  $rewrite = new Breeze_CDN_Rewrite($cdn_integration);
48
 
49
  //rewrite CDN Url to html raw
44
  return;
45
  }
46
 
47
+ if ( isset( $_GET['action'] ) && 'edit' === $_GET['action'] && isset( $_GET['job_id'] ) && ! empty( $_GET['job_id'] ) ) {
48
+ return;
49
+ }
50
+
51
  $rewrite = new Breeze_CDN_Rewrite($cdn_integration);
52
 
53
  //rewrite CDN Url to html raw
inc/helpers.php CHANGED
@@ -128,6 +128,10 @@ function breeze_validate_urls( $url_list = array() ) {
128
  if ( false === $is_valid ) {
129
  $is_valid = breeze_validate_url_via_regexp( $url );
130
  }
 
 
 
 
131
  }
132
 
133
  if ( false === $is_valid ) {
@@ -307,7 +311,7 @@ function breeze_string_contains_exclude_regexp( $file_url, $validate = '(.*)' )
307
 
308
  $valid = false;
309
 
310
- if ( strpos( $file_url, $validate ) !== false ) {
311
  $valid = true; // 0 or false
312
  }
313
 
128
  if ( false === $is_valid ) {
129
  $is_valid = breeze_validate_url_via_regexp( $url );
130
  }
131
+
132
+ if ( false === $is_valid ) {
133
+ $is_valid = breeze_string_contains_exclude_regexp( $url );
134
+ }
135
  }
136
 
137
  if ( false === $is_valid ) {
311
 
312
  $valid = false;
313
 
314
+ if ( substr_count( $file_url, $validate ) !== 0 ) {
315
  $valid = true; // 0 or false
316
  }
317
 
inc/minification/breeze-minify-main.php CHANGED
@@ -259,6 +259,12 @@ class Breeze_Minify {
259
  */
260
  public function check_exclude_url( $current_url ) {
261
  $opts_config = breeze_get_option( 'advanced_settings' );
 
 
 
 
 
 
262
  //check disable cache for page
263
  if ( ! empty( $opts_config['breeze-exclude-urls'] ) ) {
264
  foreach ( $opts_config['breeze-exclude-urls'] as $v ) {
259
  */
260
  public function check_exclude_url( $current_url ) {
261
  $opts_config = breeze_get_option( 'advanced_settings' );
262
+
263
+ $is_exclude = breeze_is_string_in_array_values( $current_url, $opts_config['breeze-exclude-urls'] );
264
+ if ( ! empty( $is_exclude ) ) {
265
+ return true;
266
+ }
267
+
268
  //check disable cache for page
269
  if ( ! empty( $opts_config['breeze-exclude-urls'] ) ) {
270
  foreach ( $opts_config['breeze-exclude-urls'] as $v ) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Cloudways
3
  Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
4
  Requires at least: 4.5
5
  Tested up to: 5.3
6
- Stable tag: 1.1.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -145,6 +145,11 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
148
  = 1.1.5 =
149
  * Fix: Revised duration for browser cacheable objects
150
 
3
  Tags: cache,caching, performance, wp-cache, cdn, combine, compress, speed plugin, database cache,gzip, http compression, js cache, minify, optimize, page cache, performance, speed, expire headers
4
  Requires at least: 4.5
5
  Tested up to: 5.3
6
+ Stable tag: 1.1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
145
 
146
  == Changelog ==
147
 
148
+ = 1.1.6 =
149
+ * Add: Wildcard (.*) based exclusion of pattern URL strings in Never Cache These URLs option.
150
+ * Fix: Improved validation for CDN integration.
151
+ * Fix: General improvements to support for Elementor Forms/Elementor Pro and CDN integration.
152
+
153
  = 1.1.5 =
154
  * Fix: Revised duration for browser cacheable objects
155
 
views/tabs/advanced.php CHANGED
@@ -7,6 +7,7 @@ $excluded_css_check = true;
7
  $excluded_js_check = true;
8
  $excluded_css_check_extension = true;
9
  $excluded_js_check_extension = true;
 
10
  if ( isset( $advanced['breeze-exclude-css'] ) && ! empty( $advanced['breeze-exclude-css'] ) ) {
11
  $excluded_css_check = breeze_validate_urls( $advanced['breeze-exclude-css'] );
12
  if ( true === $excluded_css_check ) {
@@ -20,6 +21,10 @@ if ( isset( $advanced['breeze-exclude-js'] ) && ! empty( $advanced['breeze-exclu
20
  $excluded_js_check_extension = breeze_validate_the_right_extension( $advanced['breeze-exclude-js'], 'js' );
21
  }
22
  }
 
 
 
 
23
  ?>
24
  <table cellspacing="15">
25
  <tr>
@@ -39,6 +44,12 @@ if ( isset( $advanced['breeze-exclude-js'] ) && ! empty( $advanced['breeze-exclu
39
  <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e( 'Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze' ); ?><a
40
  href="https://support.cloudways.com/how-to-exclude-url-from-varnish/"
41
  target="_blank"><?php _e( 'Knowledge Base', 'breeze' ); ?></a><?php _e( ' article.', 'breeze' ); ?> </span>
 
 
 
 
 
 
42
  </td>
43
  </tr>
44
  <tr>
7
  $excluded_js_check = true;
8
  $excluded_css_check_extension = true;
9
  $excluded_js_check_extension = true;
10
+ $excluded_url_list = true;
11
  if ( isset( $advanced['breeze-exclude-css'] ) && ! empty( $advanced['breeze-exclude-css'] ) ) {
12
  $excluded_css_check = breeze_validate_urls( $advanced['breeze-exclude-css'] );
13
  if ( true === $excluded_css_check ) {
21
  $excluded_js_check_extension = breeze_validate_the_right_extension( $advanced['breeze-exclude-js'], 'js' );
22
  }
23
  }
24
+
25
+ if ( isset( $advanced['breeze-exclude-urls'] ) && ! empty( $advanced['breeze-exclude-urls'] ) ) {
26
+ $excluded_url_list = breeze_validate_urls( $advanced['breeze-exclude-urls'] );
27
+ }
28
  ?>
29
  <table cellspacing="15">
30
  <tr>
44
  <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e( 'Add the URLs of the pages (one per line) you wish to exclude from the WordPress internal cache. To exclude URLs from the Varnish cache, please refer to this ', 'breeze' ); ?><a
45
  href="https://support.cloudways.com/how-to-exclude-url-from-varnish/"
46
  target="_blank"><?php _e( 'Knowledge Base', 'breeze' ); ?></a><?php _e( ' article.', 'breeze' ); ?> </span>
47
+ <?php if ( false === $excluded_url_list ) { ?>
48
+ <br/>
49
+ <span class="breeze_tool_tip" style="color: #ff0000">
50
+ <?php _e( 'One (or more) URL is invalid. Please check and correct the entry.', 'breeze' ); ?>
51
+ </span>
52
+ <?php } ?>
53
  </td>
54
  </tr>
55
  <tr>
views/tabs/cdn.php CHANGED
@@ -27,10 +27,30 @@
27
  <label for="cdn-url" class="breeze_tool_tip"><?php _e('CDN CNAME', 'breeze')?></label>
28
  </td>
29
  <td>
30
- <input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e('https://www.domain.com','breeze')?>" value="<?php echo (($cdn_integration['cdn-url'])?esc_html($cdn_integration['cdn-url']):''); ?>"/>
 
 
 
 
31
  <span style="vertical-align: baseline" class="breeze_tool_tip"><?php _e('Enter CDN CNAME.', 'breeze')?></span>
32
  <br>
33
  <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze') ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </td>
35
  </tr>
36
  <tr>
27
  <label for="cdn-url" class="breeze_tool_tip"><?php _e('CDN CNAME', 'breeze')?></label>
28
  </td>
29
  <td>
30
+ <?php
31
+ $cdn_url = ( ( $cdn_integration['cdn-url'] ) ? esc_html( $cdn_integration['cdn-url'] ) : '' );
32
+ $cdn_url_validation = breeze_validate_url_via_regexp( $cdn_url );
33
+ ?>
34
+ <input type="text" id="cdn-url" name="cdn-url" size="50" placeholder="<?php _e('https://www.domain.com','breeze')?>" value="<?php echo $cdn_url; ?>"/>
35
  <span style="vertical-align: baseline" class="breeze_tool_tip"><?php _e('Enter CDN CNAME.', 'breeze')?></span>
36
  <br>
37
  <span class="breeze_tool_tip"><b>Note:&nbsp;</b><?php _e('Use double slash ‘//’ at the start of CDN CNAME, if you have some pages on HTTP and some are on HTTPS.', 'breeze') ?></span>
38
+ <?php
39
+ if ( false === $cdn_url_validation && ! empty( $cdn_url ) ) {
40
+ ?>
41
+ <br/>
42
+ <span>
43
+ <b><?php esc_html_e( 'Note', 'breeze' ); ?>:&nbsp;</b>
44
+ <span style="color: #ff0000">
45
+ <?php
46
+ echo $cdn_url . ' ';
47
+ echo esc_html__( 'is not a valid CDN url.', 'breeze' );
48
+ ?>
49
+ </span>
50
+ </span>
51
+ <?php
52
+ }
53
+ ?>
54
  </td>
55
  </tr>
56
  <tr>