Breeze – WordPress Cache Plugin - Version 1.0.7

Version Description

  • Fix: Grouping and Minification issues for PHP 7.1
  • Fix: Cache purge after version update issue
  • Fix: Increase in cache file size issue.
  • Fix: Server not found error notification
  • Fix: Default WP comments display not require cache purge
Download this release

Release Info

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

Code changes from version 1.0.6 to 1.0.7

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.0.6
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
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.0.7
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
inc/breeze-configuration.php CHANGED
@@ -271,7 +271,9 @@ class Breeze_Configuration{
271
  return FALSE;
272
  }
273
 
274
- $htaccessContent = str_replace($expires,'',$htaccessContent);
 
 
275
  file_put_contents(ABSPATH . DIRECTORY_SEPARATOR . '.htaccess', $htaccessContent);
276
  return TRUE;
277
  }
@@ -327,7 +329,9 @@ class Breeze_Configuration{
327
  return FALSE;
328
  }
329
 
330
- $htaccessContent = str_replace($data,'',$htaccessContent);
 
 
331
  file_put_contents(ABSPATH . DIRECTORY_SEPARATOR . '.htaccess', $htaccessContent);
332
  return TRUE;
333
  }
271
  return FALSE;
272
  }
273
 
274
+ $pattern = '/#Expires headers configuration added by BREEZE WP CACHE plugin[\s\S]*#End of expires headers configuration/im';
275
+
276
+ $htaccessContent = preg_replace($pattern,'',$htaccessContent);
277
  file_put_contents(ABSPATH . DIRECTORY_SEPARATOR . '.htaccess', $htaccessContent);
278
  return TRUE;
279
  }
329
  return FALSE;
330
  }
331
 
332
+ $pattern = '/# Begin GzipofBreezeWPCache[\s\S]*# End GzipofBreezeWPCache/im';
333
+
334
+ $htaccessContent = preg_replace($pattern,'',$htaccessContent);
335
  file_put_contents(ABSPATH . DIRECTORY_SEPARATOR . '.htaccess', $htaccessContent);
336
  return TRUE;
337
  }
inc/cache/execute-cache.php CHANGED
@@ -268,8 +268,9 @@ function breeze_get_url_path()
268
  {
269
 
270
  $host = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : '';
 
271
 
272
- return "http://" . rtrim($host, '/') . $_SERVER['REQUEST_URI'];
273
  }
274
 
275
  /**
268
  {
269
 
270
  $host = (isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : '';
271
+ $domain = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? 'https://' : 'http://');
272
 
273
+ return $domain . rtrim($host, '/') . $_SERVER['REQUEST_URI'];
274
  }
275
 
276
  /**
inc/cache/purge-per-time.php CHANGED
@@ -81,13 +81,13 @@ class Breeze_PurgeCacheTime {
81
  public function schedule_varnish(){
82
  // Purge varnish cache
83
  if($this->varnishcache){
84
- $homepage = home_url().'/?breeze';
85
- $main = new Breeze_PurgeVarnish();
86
- $main->purge_cache($homepage);
87
  }
 
88
  // Purge normal cache
89
  if($this->normalcache){
90
  Breeze_PurgeCache::breeze_cache_flush();
 
91
  }
92
 
93
  }
81
  public function schedule_varnish(){
82
  // Purge varnish cache
83
  if($this->varnishcache){
84
+ do_action('breeze_clear_varnish');
 
 
85
  }
86
+
87
  // Purge normal cache
88
  if($this->normalcache){
89
  Breeze_PurgeCache::breeze_cache_flush();
90
+ Breeze_MinificationCache::clear_minification();
91
  }
92
 
93
  }
inc/minification/breeze-minification-html.php CHANGED
@@ -17,10 +17,10 @@ class Breeze_MinificationHtml extends Breeze_MinificationBase {
17
 
18
  // filter to add strings to be excluded from HTML minification
19
  $excludeHTML = apply_filters( 'breeze_filter_html_exclude','' );
20
- if ($excludeHTML!=="") {
21
- $exclHTMLArr = array_filter(array_map('trim',explode(",",$excludeHTML)));
22
- $this->exclude = array_merge($exclHTMLArr,$this->exclude);
23
- }
24
 
25
  // Nothing else for HTML
26
  return true;
@@ -28,18 +28,18 @@ class Breeze_MinificationHtml extends Breeze_MinificationBase {
28
 
29
  //Joins and optimizes CSS
30
  public function minify() {
31
- $noptimizeHTML = apply_filters( 'breeze_filter_html_noptimize', false, $this->content );
32
- if ($noptimizeHTML)
33
- return false;
34
 
35
  if(class_exists('Minify_HTML')) {
36
  // wrap the to-be-excluded strings in noptimize tags
37
- foreach ($this->exclude as $exclString) {
38
- if (strpos($this->content,$exclString)!==false) {
39
- $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
40
- $this->content=str_replace($exclString,$replString,$this->content);
41
- }
42
- }
43
 
44
  // noptimize me
45
  $this->content = $this->hide_noptimize($this->content);
@@ -50,8 +50,8 @@ class Breeze_MinificationHtml extends Breeze_MinificationBase {
50
  $options['xhtml'] = true;
51
  }
52
 
53
- if (@is_callable(array(new Minify_HTML,"minify"))) {
54
- $tmp_content = Minify_HTML::minify($this->content,$options);
55
  if (!empty($tmp_content)) {
56
  $this->content = $tmp_content;
57
  unset($tmp_content);
@@ -62,12 +62,12 @@ class Breeze_MinificationHtml extends Breeze_MinificationBase {
62
  $this->content = $this->restore_noptimize($this->content);
63
 
64
  // remove the noptimize-wrapper from around the excluded strings
65
- foreach ($this->exclude as $exclString) {
66
- $replString="<!--noptimize-->".$exclString."<!--/noptimize-->";
67
- if (strpos($this->content,$replString)!==false) {
68
- $this->content=str_replace($replString,$exclString,$this->content);
69
- }
70
- }
71
 
72
  return true;
73
  }
17
 
18
  // filter to add strings to be excluded from HTML minification
19
  $excludeHTML = apply_filters( 'breeze_filter_html_exclude','' );
20
+ if ($excludeHTML !== "") {
21
+ $exclHTMLArr = array_filter(array_map('trim',explode(",",$excludeHTML)));
22
+ $this->exclude = array_merge($exclHTMLArr, $this->exclude);
23
+ }
24
 
25
  // Nothing else for HTML
26
  return true;
28
 
29
  //Joins and optimizes CSS
30
  public function minify() {
31
+ $noptimizeHTML = apply_filters( 'breeze_filter_html_noptimize', false, $this->content );
32
+ if ($noptimizeHTML)
33
+ return false;
34
 
35
  if(class_exists('Minify_HTML')) {
36
  // wrap the to-be-excluded strings in noptimize tags
37
+ foreach ($this->exclude as $exclString) {
38
+ if (strpos($this->content, $exclString)!==false) {
39
+ $replString = "<!--noptimize-->".$exclString."<!--/noptimize-->";
40
+ $this->content = str_replace($exclString, $replString, $this->content);
41
+ }
42
+ }
43
 
44
  // noptimize me
45
  $this->content = $this->hide_noptimize($this->content);
50
  $options['xhtml'] = true;
51
  }
52
 
53
+ if (method_exists('Minify_HTML', 'minify')) {
54
+ $tmp_content = Minify_HTML::minify($this->content, $options);
55
  if (!empty($tmp_content)) {
56
  $this->content = $tmp_content;
57
  unset($tmp_content);
62
  $this->content = $this->restore_noptimize($this->content);
63
 
64
  // remove the noptimize-wrapper from around the excluded strings
65
+ foreach ($this->exclude as $exclString) {
66
+ $replString = "<!--noptimize-->".$exclString."<!--/noptimize-->";
67
+ if (strpos($this->content, $replString) !== false) {
68
+ $this->content = str_replace($replString, $exclString, $this->content);
69
+ }
70
+ }
71
 
72
  return true;
73
  }
inc/minification/breeze-minification-scripts.php CHANGED
@@ -170,6 +170,11 @@ class Breeze_MinificationScripts extends Breeze_MinificationBase {
170
  }
171
  } else {
172
  // Inline script
 
 
 
 
 
173
  if ($this->isremovable($tag,$this->jsremovables)) {
174
  $this->content = str_replace($tag,'',$this->content);
175
  continue;
170
  }
171
  } else {
172
  // Inline script
173
+ if ($this->group_js) {
174
+ // Exclude inline JS while group minification files to avoid large caching size
175
+ continue;
176
+ }
177
+
178
  if ($this->isremovable($tag,$this->jsremovables)) {
179
  $this->content = str_replace($tag,'',$this->content);
180
  continue;
inc/minification/breeze-minify-main.php CHANGED
@@ -25,7 +25,7 @@ class Breeze_Minify {
25
  public function __construct()
26
  {
27
  //check disable cache for page
28
- $domain = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!=='off') || $_SERVER['SERVER_PORT']==443) ? 'https://':'http://' ).$_SERVER['HTTP_HOST'];
29
  $current_url = $domain.$_SERVER['REQUEST_URI'];
30
 
31
  $check_url = $this->check_exclude_url($current_url);
25
  public function __construct()
26
  {
27
  //check disable cache for page
28
+ $domain = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!=='off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']==443)) ? 'https://':'http://' ).$_SERVER['HTTP_HOST'];
29
  $current_url = $domain.$_SERVER['REQUEST_URI'];
30
 
31
  $check_url = $this->check_exclude_url($current_url);
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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: 4.8
6
- Stable tag: 1.0.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -145,6 +145,13 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
 
 
148
  = 1.0.6 =
149
  * Fix: All Multisite are now handled globally with settings being handled at network level
150
 
2
  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: 4.8.3
6
+ Stable tag: 1.0.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
145
 
146
  == Changelog ==
147
 
148
+ = 1.0.7 =
149
+ * Fix: Grouping and Minification issues for PHP 7.1
150
+ * Fix: Cache purge after version update issue
151
+ * Fix: Increase in cache file size issue.
152
+ * Fix: Server not found error notification
153
+ * Fix: Default WP comments display not require cache purge
154
+
155
  = 1.0.6 =
156
  * Fix: All Multisite are now handled globally with settings being handled at network level
157
 
views/tabs/basic.php CHANGED
@@ -24,7 +24,7 @@ $basic = get_option('breeze_basic_settings');
24
  <input type="text" id="cache-ttl" size="5" name="cache-ttl"
25
  value='<?php echo(!empty($basic['breeze-ttl']) ? (int)$basic['breeze-ttl'] : '1440'); ?>'/>
26
  <label class="breeze_tool_tip" style="vertical-align: baseline">
27
- <?php _e('Automatically purge internal cache after X minutes. By default this is set to 1440 minutes', 'breeze') ?>
28
  </label>
29
  </td>
30
  </tr>
24
  <input type="text" id="cache-ttl" size="5" name="cache-ttl"
25
  value='<?php echo(!empty($basic['breeze-ttl']) ? (int)$basic['breeze-ttl'] : '1440'); ?>'/>
26
  <label class="breeze_tool_tip" style="vertical-align: baseline">
27
+ <?php _e('Automatically purge internal cache after X minutes. By default this is set to 1440 minutes (1 day)', 'breeze') ?>
28
  </label>
29
  </td>
30
  </tr>