Breeze – WordPress Cache Plugin - Version X.X.X

Version Description

Update Breeze through WordPress Admin > Dashboard >Updates. The settings will remain intact after the update.

Download this release

Release Info

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

Code changes from version 1.0.2-beta to X.X.X

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.2-beta
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.3-beta
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
inc/breeze-admin.php CHANGED
@@ -26,6 +26,10 @@ class Breeze_Admin {
26
  load_plugin_textdomain('breeze', false, dirname(plugin_basename(__FILE__)) . '/languages/');
27
  });
28
 
 
 
 
 
29
  add_action('admin_init', array($this, 'admin_init'));
30
  //register menu
31
  add_action('admin_menu', array($this, 'register_menu_page'));
@@ -302,9 +306,13 @@ class Breeze_Admin {
302
  update_option('breeze_varnish_cache', $varnish);
303
  }
304
 
305
- //add header to htaccess by default
306
- Breeze_Configuration::add_expires_header(TRUE);
307
- Breeze_Configuration::add_gzip_htacess(TRUE);
 
 
 
 
308
  //automatic config start cache
309
  Breeze_ConfigCache::factory()->write();
310
  Breeze_ConfigCache::factory()->write_config_cache();
@@ -322,7 +330,8 @@ class Breeze_Admin {
322
  Breeze_ConfigCache::factory()->clean_up();
323
  Breeze_ConfigCache::factory()->clean_config();
324
  Breeze_ConfigCache::factory()->toggle_caching(false);
325
-
 
326
  }
327
 
328
  /*
@@ -348,6 +357,23 @@ class Breeze_Admin {
348
  );
349
  return array_merge( $mylinks,$links );
350
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
352
 
353
  $admin = new Breeze_Admin();
26
  load_plugin_textdomain('breeze', false, dirname(plugin_basename(__FILE__)) . '/languages/');
27
  });
28
 
29
+ // Add our custom action to clear cache
30
+ add_action('breeze_clear_all_cache', array($this, 'breeze_clear_all_cache'));
31
+ add_action('breeze_clear_varnish', array($this, 'breeze_clear_varnish'));
32
+
33
  add_action('admin_init', array($this, 'admin_init'));
34
  //register menu
35
  add_action('admin_menu', array($this, 'register_menu_page'));
306
  update_option('breeze_varnish_cache', $varnish);
307
  }
308
 
309
+ //add header to htaccess if setting is enabled or by default if first installed
310
+ if ($basic['breeze-browser-cache'] == 1) {
311
+ Breeze_Configuration::add_expires_header( true );
312
+ }
313
+ if ($basic['breeze-gzip-compression'] == 1) {
314
+ Breeze_Configuration::add_gzip_htacess( true );
315
+ }
316
  //automatic config start cache
317
  Breeze_ConfigCache::factory()->write();
318
  Breeze_ConfigCache::factory()->write_config_cache();
330
  Breeze_ConfigCache::factory()->clean_up();
331
  Breeze_ConfigCache::factory()->clean_config();
332
  Breeze_ConfigCache::factory()->toggle_caching(false);
333
+ Breeze_Configuration::add_expires_header(false);
334
+ Breeze_Configuration::add_gzip_htacess(false);
335
  }
336
 
337
  /*
357
  );
358
  return array_merge( $mylinks,$links );
359
  }
360
+
361
+ // Clear all cache action
362
+ public function breeze_clear_all_cache() {
363
+ //delete minify
364
+ Breeze_MinificationCache::clear_minification();
365
+ //clear normal cache
366
+ Breeze_PurgeCache::breeze_cache_flush();
367
+ //clear varnish cache
368
+ $this->breeze_clear_varnish();
369
+ }
370
+
371
+ // Clear all varnish cache action
372
+ public function breeze_clear_varnish() {
373
+ $homepage = home_url().'/?breeze';
374
+ $main = new Breeze_PurgeVarnish();
375
+ $main->purge_cache($homepage);
376
+ }
377
  }
378
 
379
  $admin = new Breeze_Admin();
inc/cache/config-cache.php CHANGED
@@ -109,7 +109,7 @@ class Breeze_ConfigCache {
109
 
110
  return true;
111
  }
112
- //turn on / of wp cahe
113
  public function toggle_caching( $status ) {
114
 
115
  global $wp_filesystem;
109
 
110
  return true;
111
  }
112
+ //turn on / off wp cache
113
  public function toggle_caching( $status ) {
114
 
115
  global $wp_filesystem;
inc/cache/execute-cache.php CHANGED
@@ -95,6 +95,8 @@ if (!$check_exclude) {
95
  breeze_serve_cache($filename, $url_path, $X1,$devices);
96
  ob_start('breeze_cache');
97
 
 
 
98
  }
99
 
100
  /**
95
  breeze_serve_cache($filename, $url_path, $X1,$devices);
96
  ob_start('breeze_cache');
97
 
98
+ } else {
99
+ header('Cache-Control: no-cache');
100
  }
101
 
102
  /**
inc/cdn-integration/breeze-cdn-rewrite.php CHANGED
@@ -48,12 +48,20 @@ class Breeze_CDN_Rewrite {
48
  // regex rule start
49
  $regex_rule = '#(?<=[(\"\'])';
50
 
51
- // check if relative paths
52
- if ($this->relative) {
53
- $regex_rule .= '(?:'.$blog_url.')?';
54
- } else {
55
- $regex_rule .= $blog_url;
56
- }
 
 
 
 
 
 
 
 
57
 
58
  // regex rule end
59
  $regex_rule .= '/(?:((?:'.$dirs.')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
@@ -87,20 +95,20 @@ class Breeze_CDN_Rewrite {
87
  }
88
 
89
  $parseUrl = parse_url($this->blog_url);
90
- $schema = 'http://';
91
  if(isset($parseUrl['scheme'])){
92
  $scheme = $parseUrl['scheme'].'://';
93
  }
94
  $host = $parseUrl['host'];
95
  //get domain
96
- $domain = $scheme.$host;
97
 
98
  // check if not a relative path
99
  if (!$this->relative || strstr($match[0], $this->blog_url)) {
100
- return str_replace($domain, $this->cdn_url, $match[0]);
101
  }
102
 
103
- return $this->cdn_url . $match[0];
104
 
105
  }
106
  /*
48
  // regex rule start
49
  $regex_rule = '#(?<=[(\"\'])';
50
 
51
+ // create blog url without http or https
52
+ $parseurl = parse_url($this->blog_url);
53
+ $scheme = 'http:';
54
+ if(!empty($parseurl['scheme'])){
55
+ $scheme = $parseurl['scheme'].':';
56
+ }
57
+ $blog_url_short = str_replace($scheme, '',$this->blog_url);
58
+
59
+ // check if relative paths
60
+ if ($this->relative) {
61
+ $regex_rule .= '(?:'.$blog_url.'|'.$blog_url_short.')?';
62
+ } else {
63
+ $regex_rule .= '('.$blog_url.'|'.$blog_url_short.')';
64
+ }
65
 
66
  // regex rule end
67
  $regex_rule .= '/(?:((?:'.$dirs.')[^\"\')]+)|([^/\"\']+\.[^/\"\')]+))(?=[\"\')])#';
95
  }
96
 
97
  $parseUrl = parse_url($this->blog_url);
98
+ $scheme = 'http://';
99
  if(isset($parseUrl['scheme'])){
100
  $scheme = $parseUrl['scheme'].'://';
101
  }
102
  $host = $parseUrl['host'];
103
  //get domain
104
+ $domain = '//'.$host;
105
 
106
  // check if not a relative path
107
  if (!$this->relative || strstr($match[0], $this->blog_url)) {
108
+ $domain = $scheme.$host;
109
  }
110
 
111
+ return str_replace($domain, $this->cdn_url, $match[0]);
112
 
113
  }
114
  /*
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: 4.8
6
- Stable tag: 1.0.2-beta
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -116,6 +116,11 @@ You can get your questions answered on the WordPress support forums. If you are
116
 
117
  == Changelog ==
118
 
 
 
 
 
 
119
  = 1.0.2-beta =
120
  * Fix : Compatibility issues of WooCommerce
121
 
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.3-beta
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
116
 
117
  == Changelog ==
118
 
119
+ = 1.0.3-beta =
120
+ * Fix : Disabled browser cache for WooCommerce cart, shop and account pages
121
+ * Fix : Removal of htaccess when disabling browser cache and gzip compression options
122
+ * Fix : CDN issues of not serving all the configured contents from CDN service
123
+
124
  = 1.0.2-beta =
125
  * Fix : Compatibility issues of WooCommerce
126
 
views/tabs/cdn.php CHANGED
@@ -22,7 +22,7 @@
22
  </tr>
23
  <tr>
24
  <td>
25
- <label for="cdn-url" class="breeze_tool_tip"><?php _e('CDN Root URL', 'breeze')?></label>
26
  </td>
27
  <td>
28
  <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']):''); ?>"/>
22
  </tr>
23
  <tr>
24
  <td>
25
+ <label for="cdn-url" class="breeze_tool_tip"><?php _e('CDN CNAME', 'breeze')?></label>
26
  </td>
27
  <td>
28
  <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']):''); ?>"/>