Breeze – WordPress Cache Plugin - Version 1.0.6

Version Description

  • Fix: All Multisite are now handled globally with settings being handled at network level
Download this release

Release Info

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

Code changes from version 1.0.5 to 1.0.6

assets/css/topbar.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ #wp-admin-bar-breeze-topbar * {
2
+ cursor: pointer !important;
3
+ }
4
+ #wp-admin-bar-breeze-topbar *:hover {
5
+ color: #00b9eb !important;
6
+ }
assets/js/breeze-backend.js CHANGED
@@ -1,5 +1,8 @@
1
  jQuery(document).ready(function ($) {
2
  // Topbar action
 
 
 
3
  $('#wp-admin-bar-breeze-purge-varnish-group').click(function(){
4
  breeze_purgeVarnish_callAjax();
5
  });
@@ -50,11 +53,8 @@ jQuery(document).ready(function ($) {
50
  success : function(res){
51
  current = location.href;
52
  res = parseFloat(res) ;
53
- if(current.indexOf("page=breeze_config") > 0){
54
- window.location.href = current+ "#breeze-msg=success-cleancache&file="+res;
55
- }else{
56
- window.location.href = current+ "breeze-msg=success-cleancache&file="+res;
57
- }
58
  location.reload();
59
  }
60
  });
1
  jQuery(document).ready(function ($) {
2
  // Topbar action
3
+ $('#wp-admin-bar-breeze-purge-all').click(function () {
4
+ window.location.href = breeze_token_name.purge_all_href;
5
+ });
6
  $('#wp-admin-bar-breeze-purge-varnish-group').click(function(){
7
  breeze_purgeVarnish_callAjax();
8
  });
53
  success : function(res){
54
  current = location.href;
55
  res = parseFloat(res) ;
56
+
57
+ window.location.href = current+ "#breeze-msg=success-cleancache&file="+res;
 
 
 
58
  location.reload();
59
  }
60
  });
assets/js/breeze-configuration.js CHANGED
@@ -34,8 +34,16 @@ jQuery(document).ready(function($){
34
  if (!active_tab){
35
  active_tab = 'basic';
36
  }
37
- $("#tab-" + active_tab).addClass('active');
38
- $("#tab-content-" + active_tab).addClass('active');
 
 
 
 
 
 
 
 
39
  }
40
 
41
  function getCookie(cname) {
34
  if (!active_tab){
35
  active_tab = 'basic';
36
  }
37
+
38
+ if ($("#tab-" + active_tab).length === 0) {
39
+ firstTab = $('#breeze-tabs').find('a:first-child');
40
+ tabType = firstTab.attr('id').replace('tab-', '');
41
+ firstTab.addClass('active');
42
+ $("#tab-content-" + tabType).addClass('active');
43
+ } else {
44
+ $("#tab-" + active_tab).addClass('active');
45
+ $("#tab-content-" + active_tab).addClass('active');
46
+ }
47
  }
48
 
49
  function getCookie(cname) {
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.5
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.6
6
  * Text Domain: breeze
7
  * Domain Path: /languages
8
  * Author: Cloudways
inc/breeze-admin.php CHANGED
@@ -33,6 +33,7 @@ class Breeze_Admin {
33
  add_action('admin_init', array($this, 'admin_init'));
34
  //register menu
35
  add_action('admin_menu', array($this, 'register_menu_page'));
 
36
 
37
  // Add notice when installing plugin
38
  $first_install = get_option('breeze_first_install');
@@ -56,7 +57,9 @@ class Breeze_Admin {
56
  add_action('wp_head', array($this,'define_ajaxurl'));
57
  $this->ajaxHandle();
58
 
59
- add_filter( 'plugin_action_links_'.BREEZE_BASENAME, array($this,'breeze_add_action_links') );
 
 
60
  }
61
 
62
  /**
@@ -99,8 +102,9 @@ class Breeze_Admin {
99
  function loadAdminScripts() {
100
  wp_enqueue_script('jquery');
101
  wp_enqueue_script('breeze-backend', plugins_url('assets/js/breeze-backend.js', dirname(__FILE__)), array('jquery'), BREEZE_VERSION, true);
 
102
  $current_screen = get_current_screen();
103
- if($current_screen->base == 'settings_page_breeze'){
104
  //add css
105
  wp_enqueue_style('breeze-style', plugins_url('assets/css/style.css', dirname(__FILE__)));
106
  //js
@@ -110,7 +114,8 @@ class Breeze_Admin {
110
  $token_name = array(
111
  'breeze_purge_varnish' => wp_create_nonce("_breeze_purge_varnish"),
112
  'breeze_purge_database' => wp_create_nonce("_breeze_purge_database"),
113
- 'breeze_purge_cache' => wp_create_nonce("_breeze_purge_cache")
 
114
  );
115
 
116
  wp_localize_script('breeze-backend','breeze_token_name',$token_name);
@@ -126,6 +131,12 @@ class Breeze_Admin {
126
  add_submenu_page( 'options-general.php', __('Breeze', 'breeze'), __('Breeze', 'breeze'), 'manage_options', 'breeze', array($this, 'breeze_load_page') );
127
  }
128
 
 
 
 
 
 
 
129
 
130
  /**
131
  * Register bar menu
@@ -148,7 +159,6 @@ class Breeze_Admin {
148
  $args = array(
149
  'id' => 'breeze-purge-all',
150
  'title' => esc_html(__('Purge All Cache', 'breeze')),
151
- 'href' => wp_nonce_url(add_query_arg('breeze_purge', 1), 'breeze_purge_cache'),
152
  'parent' => 'breeze-topbar',
153
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
154
  );
@@ -158,7 +168,6 @@ class Breeze_Admin {
158
  $args = array(
159
  'id' => 'breeze-purge-modules',
160
  'title' => esc_html(__('Purge Modules', 'breeze')),
161
- 'href' => '#',
162
  'parent' => 'breeze-topbar',
163
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
164
  );
@@ -169,7 +178,6 @@ class Breeze_Admin {
169
  $args = array(
170
  'id' => 'breeze-purge-varnish-group',
171
  'title' => esc_html(__('Purge Varnish Cache', 'breeze')),
172
- 'href' => '#',
173
  'parent' => 'breeze-purge-modules',
174
  );
175
  $wp_admin_bar->add_node( $args );
@@ -178,7 +186,6 @@ class Breeze_Admin {
178
  $args = array(
179
  'id' => 'breeze-purge-file-group',
180
  'title' => esc_html(__('Purge Internal Cache', 'breeze')),
181
- 'href' => '#',
182
  'parent' => 'breeze-purge-modules',
183
  );
184
  $wp_admin_bar->add_node( $args );
@@ -191,6 +198,15 @@ class Breeze_Admin {
191
  'href' => 'options-general.php?page=breeze',
192
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
193
  );
 
 
 
 
 
 
 
 
 
194
  $wp_admin_bar->add_node( $args );
195
 
196
  // add support item
@@ -351,13 +367,22 @@ class Breeze_Admin {
351
 
352
  // Applied to the list of links to display on the plugins page
353
  public function breeze_add_action_links($links){
 
 
 
354
 
355
- $mylinks = array(
356
- '<a href="' . admin_url( 'options-general.php?page=breeze' ) . '">Settings</a>',
357
- );
358
- return array_merge( $mylinks,$links );
359
  }
360
 
 
 
 
 
 
 
 
 
 
361
  // Clear all cache action
362
  public function breeze_clear_all_cache() {
363
  //delete minify
@@ -370,9 +395,20 @@ class Breeze_Admin {
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
 
33
  add_action('admin_init', array($this, 'admin_init'));
34
  //register menu
35
  add_action('admin_menu', array($this, 'register_menu_page'));
36
+ add_action('network_admin_menu', array($this, 'register_network_menu_page'));
37
 
38
  // Add notice when installing plugin
39
  $first_install = get_option('breeze_first_install');
57
  add_action('wp_head', array($this,'define_ajaxurl'));
58
  $this->ajaxHandle();
59
 
60
+ // Add setting buttons to plugins list page
61
+ add_filter('plugin_action_links_' . BREEZE_BASENAME, array($this, 'breeze_add_action_links'));
62
+ add_filter('network_admin_plugin_action_links_' . BREEZE_BASENAME, array($this, 'breeze_add_action_links_network'));
63
  }
64
 
65
  /**
102
  function loadAdminScripts() {
103
  wp_enqueue_script('jquery');
104
  wp_enqueue_script('breeze-backend', plugins_url('assets/js/breeze-backend.js', dirname(__FILE__)), array('jquery'), BREEZE_VERSION, true);
105
+ wp_enqueue_style('breeze-topbar', plugins_url('assets/css/topbar.css', dirname(__FILE__)));
106
  $current_screen = get_current_screen();
107
+ if($current_screen->base == 'settings_page_breeze' || $current_screen->base == 'settings_page_breeze-network'){
108
  //add css
109
  wp_enqueue_style('breeze-style', plugins_url('assets/css/style.css', dirname(__FILE__)));
110
  //js
114
  $token_name = array(
115
  'breeze_purge_varnish' => wp_create_nonce("_breeze_purge_varnish"),
116
  'breeze_purge_database' => wp_create_nonce("_breeze_purge_database"),
117
+ 'breeze_purge_cache' => wp_create_nonce("_breeze_purge_cache"),
118
+ 'purge_all_href' => wp_nonce_url(add_query_arg('breeze_purge', 1), 'breeze_purge_cache'),
119
  );
120
 
121
  wp_localize_script('breeze-backend','breeze_token_name',$token_name);
131
  add_submenu_page( 'options-general.php', __('Breeze', 'breeze'), __('Breeze', 'breeze'), 'manage_options', 'breeze', array($this, 'breeze_load_page') );
132
  }
133
 
134
+ function register_network_menu_page()
135
+ {
136
+ //add submenu for multisite network
137
+ add_submenu_page('settings.php', __('Breeze', 'breeze'), __('Breeze', 'breeze'), 'manage_options', 'breeze', array($this, 'breeze_load_page'));
138
+ }
139
+
140
 
141
  /**
142
  * Register bar menu
159
  $args = array(
160
  'id' => 'breeze-purge-all',
161
  'title' => esc_html(__('Purge All Cache', 'breeze')),
 
162
  'parent' => 'breeze-topbar',
163
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
164
  );
168
  $args = array(
169
  'id' => 'breeze-purge-modules',
170
  'title' => esc_html(__('Purge Modules', 'breeze')),
 
171
  'parent' => 'breeze-topbar',
172
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
173
  );
178
  $args = array(
179
  'id' => 'breeze-purge-varnish-group',
180
  'title' => esc_html(__('Purge Varnish Cache', 'breeze')),
 
181
  'parent' => 'breeze-purge-modules',
182
  );
183
  $wp_admin_bar->add_node( $args );
186
  $args = array(
187
  'id' => 'breeze-purge-file-group',
188
  'title' => esc_html(__('Purge Internal Cache', 'breeze')),
 
189
  'parent' => 'breeze-purge-modules',
190
  );
191
  $wp_admin_bar->add_node( $args );
198
  'href' => 'options-general.php?page=breeze',
199
  'meta' => array( 'class' => 'breeze-toolbar-group' ),
200
  );
201
+ $network_settings_url = network_admin_url('settings.php?page=breeze');
202
+ if (is_multisite())
203
+ $args = array(
204
+ 'id' => 'breeze-settings',
205
+ 'title' => esc_html(__('Settings', 'breeze')),
206
+ 'parent' => 'breeze-topbar',
207
+ 'href' => $network_settings_url,
208
+ 'meta' => array( 'class' => 'breeze-toolbar-group' ),
209
+ );
210
  $wp_admin_bar->add_node( $args );
211
 
212
  // add support item
367
 
368
  // Applied to the list of links to display on the plugins page
369
  public function breeze_add_action_links($links){
370
+ $mylinks = array(
371
+ '<a href="' . admin_url( 'options-general.php?page=breeze' ) . '">Settings</a>',
372
+ );
373
 
374
+ return array_merge($mylinks, $links);
 
 
 
375
  }
376
 
377
+ // Applied to the list of links to display on the network plugins page
378
+ public function breeze_add_action_links_network($links){
379
+ $mylinks = array(
380
+ '<a href="' . network_admin_url( 'settings.php?page=breeze' ) . '">Settings</a>',
381
+ );
382
+
383
+ return array_merge($mylinks, $links);
384
+ }
385
+
386
  // Clear all cache action
387
  public function breeze_clear_all_cache() {
388
  //delete minify
395
 
396
  // Clear all varnish cache action
397
  public function breeze_clear_varnish() {
 
398
  $main = new Breeze_PurgeVarnish();
399
+
400
+ if (is_multisite()) {
401
+ $sites = get_sites();
402
+ foreach ($sites as $site) {
403
+ switch_to_blog($site->blog_id);
404
+ $homepage = home_url().'/?breeze';
405
+ $main->purge_cache($homepage);
406
+ }
407
+ restore_current_blog();
408
+ } else {
409
+ $homepage = home_url() . '/?breeze';
410
+ $main->purge_cache( $homepage );
411
+ }
412
  }
413
  }
414
 
inc/breeze-configuration.php CHANGED
@@ -32,6 +32,7 @@ class Breeze_Configuration{
32
  */
33
  public function afterLoadConfigPage()
34
  {
 
35
  // Basic options tab
36
  if (isset($_REQUEST['breeze_basic_action']) && $_REQUEST['breeze_basic_action'] == 'breeze_basic_settings') {
37
  if (isset($_POST['breeze_settings_basic_nonce']) || wp_verify_nonce($_POST['breeze_settings_basic_nonce'], 'breeze_settings_basic')) {
@@ -51,6 +52,14 @@ class Breeze_Configuration{
51
  'breeze-display-clean' => '1'
52
  );
53
  update_option('breeze_basic_settings',$basic);
 
 
 
 
 
 
 
 
54
 
55
  // Storage infomation to cache pages
56
  Breeze_ConfigCache::factory()->write();
@@ -81,11 +90,8 @@ class Breeze_Configuration{
81
  self::add_expires_header(false);
82
  }
83
 
84
- //delete minify
85
- Breeze_MinificationCache::clear_minification();
86
- Breeze_PurgeCache::breeze_cache_flush();
87
- // Clear varnish cache after settings
88
- $this->clear_varnish();
89
  }
90
  }
91
  // Advanced options tab
@@ -102,16 +108,21 @@ class Breeze_Configuration{
102
  'breeze-exclude-js' => $exclude_js
103
  );
104
  update_option('breeze_advanced_settings',$advanced);
 
 
 
 
 
 
 
 
105
 
106
  WP_Filesystem();
107
  // Storage infomation to cache pages
108
  Breeze_ConfigCache::factory()->write_config_cache();
109
 
110
- //delete minify
111
- Breeze_MinificationCache::clear_minification();
112
- Breeze_PurgeCache::breeze_cache_flush();
113
- // Clear varnish cache after settings
114
- $this->clear_varnish();
115
  }
116
  }
117
 
@@ -119,9 +130,19 @@ class Breeze_Configuration{
119
  if (isset($_REQUEST['breeze_database_action']) && $_REQUEST['breeze_database_action'] == 'breeze_database_settings') {
120
  if (isset($_POST['breeze_settings_database_nonce']) || wp_verify_nonce($_POST['breeze_settings_database_nonce'], 'breeze_settings_database')) {
121
  if(isset($_POST['clean'])){
122
- foreach ($_POST['clean'] as $item){
123
- $this->cleanSystem($item);
124
- }
 
 
 
 
 
 
 
 
 
 
125
 
126
  //return current page
127
  if (!empty($_REQUEST['_wp_http_referer'])) {
@@ -155,12 +176,17 @@ class Breeze_Configuration{
155
  );
156
 
157
  update_option('breeze_cdn_integration', $cdn);
158
-
159
- //delete minify && normal cache
160
- Breeze_MinificationCache::clear_minification();
161
- Breeze_PurgeCache::breeze_cache_flush();
162
- // Clear varnish cache after settings
163
- $this->clear_varnish();
 
 
 
 
 
164
  }
165
  }
166
 
@@ -172,9 +198,17 @@ class Breeze_Configuration{
172
  'breeze-varnish-server-ip' => preg_replace('/[^a-zA-Z0-9\-\_\.]*/','',$_POST['varnish-server-ip'])
173
  );
174
  update_option('breeze_varnish_cache',$varnish);
 
 
 
 
 
 
 
 
175
 
176
  // Clear varnish cache after settings
177
- $this->clear_varnish();
178
  }
179
  }
180
 
@@ -472,7 +506,7 @@ class Breeze_Configuration{
472
 
473
  //delete minify file
474
  Breeze_MinificationCache::clear_minification();
475
- //delete all cache
476
  Breeze_PurgeCache::breeze_cache_flush();
477
 
478
  return $result;
@@ -497,9 +531,7 @@ class Breeze_Configuration{
497
  //check security
498
  check_ajax_referer( '_breeze_purge_varnish', 'security' );
499
 
500
- $homepage = home_url().'/?breeze';
501
- $main = new Breeze_PurgeVarnish();
502
- $main->purge_cache($homepage);
503
 
504
  echo json_encode(array('clear' => true));
505
  exit;
@@ -537,22 +569,6 @@ class Breeze_Configuration{
537
  return $bytes;
538
  }
539
 
540
- /*
541
- * Clear varnish after settings
542
- */
543
-
544
- public function clear_varnish(){
545
- // Clear varnish cache after settings
546
- $varnish = get_option('breeze_varnish_cache');
547
- if(!empty($varnish['auto-purge-varnish'])){
548
- $homepage = home_url().'/?breeze';
549
- $main = new Breeze_PurgeVarnish();
550
- $main->purge_cache($homepage);
551
- }
552
-
553
- return true;
554
- }
555
-
556
  }
557
 
558
  //init configuration object
32
  */
33
  public function afterLoadConfigPage()
34
  {
35
+ $sites = is_multisite() ? get_sites() : array();
36
  // Basic options tab
37
  if (isset($_REQUEST['breeze_basic_action']) && $_REQUEST['breeze_basic_action'] == 'breeze_basic_settings') {
38
  if (isset($_POST['breeze_settings_basic_nonce']) || wp_verify_nonce($_POST['breeze_settings_basic_nonce'], 'breeze_settings_basic')) {
52
  'breeze-display-clean' => '1'
53
  );
54
  update_option('breeze_basic_settings',$basic);
55
+ // Update settings for network sites
56
+ if (is_multisite()) {
57
+ foreach ($sites as $site) {
58
+ switch_to_blog($site->blog_id);
59
+ update_option('breeze_basic_settings',$basic);
60
+ }
61
+ restore_current_blog();
62
+ }
63
 
64
  // Storage infomation to cache pages
65
  Breeze_ConfigCache::factory()->write();
90
  self::add_expires_header(false);
91
  }
92
 
93
+ //delete cache after settings
94
+ do_action('breeze_clear_all_cache');
 
 
 
95
  }
96
  }
97
  // Advanced options tab
108
  'breeze-exclude-js' => $exclude_js
109
  );
110
  update_option('breeze_advanced_settings',$advanced);
111
+ // Update settings for network sites
112
+ if (is_multisite()) {
113
+ foreach ($sites as $site) {
114
+ switch_to_blog($site->blog_id);
115
+ update_option('breeze_advanced_settings',$advanced);
116
+ }
117
+ restore_current_blog();
118
+ }
119
 
120
  WP_Filesystem();
121
  // Storage infomation to cache pages
122
  Breeze_ConfigCache::factory()->write_config_cache();
123
 
124
+ //delete cache after settings
125
+ do_action('breeze_clear_all_cache');
 
 
 
126
  }
127
  }
128
 
130
  if (isset($_REQUEST['breeze_database_action']) && $_REQUEST['breeze_database_action'] == 'breeze_database_settings') {
131
  if (isset($_POST['breeze_settings_database_nonce']) || wp_verify_nonce($_POST['breeze_settings_database_nonce'], 'breeze_settings_database')) {
132
  if(isset($_POST['clean'])){
133
+ if (is_multisite()) {
134
+ foreach ($sites as $site) {
135
+ switch_to_blog($site->blog_id);
136
+ foreach ($_POST['clean'] as $item){
137
+ $this->cleanSystem($item);
138
+ }
139
+ }
140
+ restore_current_blog();
141
+ } else {
142
+ foreach ($_POST['clean'] as $item){
143
+ $this->cleanSystem($item);
144
+ }
145
+ }
146
 
147
  //return current page
148
  if (!empty($_REQUEST['_wp_http_referer'])) {
176
  );
177
 
178
  update_option('breeze_cdn_integration', $cdn);
179
+ // Update settings for network sites
180
+ if (is_multisite()) {
181
+ foreach ($sites as $site) {
182
+ switch_to_blog($site->blog_id);
183
+ update_option('breeze_cdn_integration',$cdn);
184
+ }
185
+ restore_current_blog();
186
+ }
187
+
188
+ //delete cache after settings
189
+ do_action('breeze_clear_all_cache');
190
  }
191
  }
192
 
198
  'breeze-varnish-server-ip' => preg_replace('/[^a-zA-Z0-9\-\_\.]*/','',$_POST['varnish-server-ip'])
199
  );
200
  update_option('breeze_varnish_cache',$varnish);
201
+ // Update settings for network sites
202
+ if (is_multisite()) {
203
+ foreach ($sites as $site) {
204
+ switch_to_blog($site->blog_id);
205
+ update_option('breeze_varnish_cache',$varnish);
206
+ }
207
+ restore_current_blog();
208
+ }
209
 
210
  // Clear varnish cache after settings
211
+ do_action('breeze_clear_varnish');
212
  }
213
  }
214
 
506
 
507
  //delete minify file
508
  Breeze_MinificationCache::clear_minification();
509
+ //delete all cache
510
  Breeze_PurgeCache::breeze_cache_flush();
511
 
512
  return $result;
531
  //check security
532
  check_ajax_referer( '_breeze_purge_varnish', 'security' );
533
 
534
+ do_action('breeze_clear_varnish');
 
 
535
 
536
  echo json_encode(array('clear' => true));
537
  exit;
569
  return $bytes;
570
  }
571
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  }
573
 
574
  //init configuration object
inc/cache/purge-varnish.php CHANGED
@@ -91,12 +91,7 @@ class Breeze_PurgeVarnish {
91
  $homepage = home_url().'/?breeze';
92
  if (isset($_REQUEST['breeze_action']) && $_REQUEST['breeze_action'] == 'breeze_settings') {
93
  if (isset($_POST['_breeze_nonce']) || wp_verify_nonce($_POST['_breeze_nonce'], 'breeze_settings')) {
94
- //delete minify
95
- Breeze_MinificationCache::clear_minification();
96
- //clear normal cache
97
- Breeze_PurgeCache::breeze_cache_flush();
98
- //clear varnish cache
99
- $this->purge_cache($homepage);
100
  }
101
  }
102
  if(isset($_GET['breeze_purge']) && check_admin_referer('breeze_purge_cache')){
91
  $homepage = home_url().'/?breeze';
92
  if (isset($_REQUEST['breeze_action']) && $_REQUEST['breeze_action'] == 'breeze_settings') {
93
  if (isset($_POST['_breeze_nonce']) || wp_verify_nonce($_POST['_breeze_nonce'], 'breeze_settings')) {
94
+ do_action('breeze_clear_all_cache');
 
 
 
 
 
95
  }
96
  }
97
  if(isset($_GET['breeze_purge']) && check_admin_referer('breeze_purge_cache')){
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.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -67,6 +67,10 @@ Breeze is fully compatible with WooCommerce, out of the box. It does not require
67
 
68
  Breeze is fully compatible with WordPress Multisite without the need for any extra configuration.
69
 
 
 
 
 
70
  = Is Breeze compatible with other WordPress Cache plugins? =
71
 
72
  We DO NOT recommend using two WordPress cache plugins at the same time on any WordPress website.
@@ -101,7 +105,6 @@ You can exclude a file by mentioning its URL or file type (by mentioning file ex
101
 
102
  If Varnish is active, you will need to exclude URLs and file type(s) in the Varnish configuration. If you are hosting WordPress websites on Cloudways servers, follow <a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/">this KB to exclude URLs from the Varnish cache</a>.
103
 
104
-
105
  = Does it work with all hosting providers? =
106
 
107
  Breeze has been tested to work with all major hosting providers. In addition, major Breeze options such as Gzip, browser cache, minification, grouping, database optimization. CDN integration will work as expected on all hosting providers.
@@ -110,8 +113,41 @@ Breeze has been tested to work with all major hosting providers. In addition, ma
110
 
111
  You can get your questions answered on the WordPress support forums. If you are a Cloudways customer, please feel free to start a discussion at <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  == Changelog ==
114
 
 
 
 
115
  = 1.0.5 =
116
  * Fix: Issue with JS minification
117
 
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
 
67
 
68
  Breeze is fully compatible with WordPress Multisite without the need for any extra configuration.
69
 
70
+ = How does Breeze handle WordPress multisite? =
71
+
72
+ Breeze handles all WordPress multisite instances globally. All the settings for multisite are now handled on the network level.
73
+
74
  = Is Breeze compatible with other WordPress Cache plugins? =
75
 
76
  We DO NOT recommend using two WordPress cache plugins at the same time on any WordPress website.
105
 
106
  If Varnish is active, you will need to exclude URLs and file type(s) in the Varnish configuration. If you are hosting WordPress websites on Cloudways servers, follow <a href="https://support.cloudways.com/how-to-exclude-url-from-varnish/">this KB to exclude URLs from the Varnish cache</a>.
107
 
 
108
  = Does it work with all hosting providers? =
109
 
110
  Breeze has been tested to work with all major hosting providers. In addition, major Breeze options such as Gzip, browser cache, minification, grouping, database optimization. CDN integration will work as expected on all hosting providers.
113
 
114
  You can get your questions answered on the WordPress support forums. If you are a Cloudways customer, please feel free to start a discussion at <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
115
 
116
+ = How can I test and verify the results (mentioned on the page)? =
117
+
118
+ You will be able to see the impact of the Breeze Cache Plugin almost immediately. We also recommend using the following tools for generating metrics:
119
+ <a href="https://developers.google.com/speed/pagespeed/" target="_blank">Google Page Speed</a>
120
+ <a href="https://www.webpagetest.org/test" target="_blank">WebPagetest</a>
121
+ <a href="https://tools.pingdom.com/" target="_blank">Pingdom</a>
122
+
123
+ = Does Breeze plugin work with Visual Builder(insert link)? =
124
+
125
+ Yes, Breeze Plugin is compatible with Visual Builder.
126
+
127
+ = What popular CDN are supported by Breze Plugin? =
128
+
129
+ Breeze supports the following three popular CDNs:
130
+ <a href="https://support.cloudways.com/how-to-use-breeze-with-maxcdn/" target="_blank">MaxCDN</a>
131
+ <a href="https://support.cloudways.com/how-to-use-breeze-with-keycdn/" target="_blank">KeyCDN</a>
132
+ <a href="https://support.cloudways.com/how-to-use-breeze-with-amazon-cloudfront/" target="_blank">Amazon Cloudfront</a>
133
+
134
+ = Does Breeze support Push CDN? =
135
+
136
+ No, Breeze does not support Push CDN. However, you could use Breeze with Push CDNs using third party plugins.
137
+
138
+ = Does Breeze Work With CloudFlare? =
139
+
140
+ Yes. The process of setting up CloudFlare with Breeze is easy. Check out the following <a href="https://support.cloudways.com/can-i-use-cloudflare-cdn/" target="_blank">KnowledgeBase article</a> for details.
141
+
142
+ = How Breeze cache uses Gzip? =
143
+
144
+ Using Gzip, Breeze compresses the request files, further reducing the size of the download files and speeding up the user experience.
145
+
146
  == Changelog ==
147
 
148
+ = 1.0.6 =
149
+ * Fix: All Multisite are now handled globally with settings being handled at network level
150
+
151
  = 1.0.5 =
152
  * Fix: Issue with JS minification
153
 
views/breeze-setting-views.php CHANGED
@@ -9,6 +9,12 @@ $tabs = array(
9
  'varnish' => __('VARNISH', 'breeze'),
10
  'faq' => __('FAQs', 'breeze'),
11
  );
 
 
 
 
 
 
12
  ?>
13
  <?php if (isset($_REQUEST['database-cleanup']) && $_REQUEST['database-cleanup'] == 'success'): ?>
14
  <div id="message-save-settings" class="notice notice-success" style="margin: 10px 0px 10px 0;padding: 10px;"><strong><?php _e('Database cleanup successful', 'breeze'); ?></strong></div>
9
  'varnish' => __('VARNISH', 'breeze'),
10
  'faq' => __('FAQs', 'breeze'),
11
  );
12
+
13
+ if (is_multisite() && get_current_screen()->base !== 'settings_page_breeze-network') {
14
+ $tabs = array(
15
+ 'faq' => __('FAQs', 'breeze')
16
+ );
17
+ }
18
  ?>
19
  <?php if (isset($_REQUEST['database-cleanup']) && $_REQUEST['database-cleanup'] == 'success'): ?>
20
  <div id="message-save-settings" class="notice notice-success" style="margin: 10px 0px 10px 0;padding: 10px;"><strong><?php _e('Database cleanup successful', 'breeze'); ?></strong></div>
views/tabs/database.php CHANGED
@@ -1,5 +1,26 @@
1
  <?php
2
  defined('ABSPATH') or die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ?>
4
  <div class="breeze-top-notice">
5
  <label class="breeze_tool_tip"><?php _e('Important: Backup your databases before using the following options!','breeze')?></label>
@@ -16,7 +37,7 @@ defined('ABSPATH') or die;
16
  </tr>
17
  <tr>
18
  <td>
19
- <label for="data1" class="breeze_tool_tip"><?php _e('Post revisions','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('revisions').")"; ?></label>
20
  </td>
21
  <td>
22
  <input type="checkbox" id="data1" name="clean[]" class="clean-data" value="revisions"/>
@@ -25,7 +46,7 @@ defined('ABSPATH') or die;
25
  </tr>
26
  <tr>
27
  <td>
28
- <label for="data2" class="breeze_tool_tip" ><?php _e('Auto drafted content','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('drafted').")"; ?></label>
29
  </td>
30
  <td>
31
  <input type="checkbox" id="data2" name="clean[]" class="clean-data" value="drafted"/>
@@ -34,7 +55,7 @@ defined('ABSPATH') or die;
34
  </tr>
35
  <tr>
36
  <td>
37
- <label for="data3" class="breeze_tool_tip" ><?php _e('All trashed content','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('trash').")"; ?></label>
38
  </td>
39
  <td>
40
  <input type="checkbox" id="data3" name="clean[]" class="clean-data" value="trash"/>
@@ -44,7 +65,7 @@ defined('ABSPATH') or die;
44
  </tr>
45
  <tr>
46
  <td>
47
- <label for="data4" class="breeze_tool_tip" ><?php _e('Comments from trash & spam','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('comments').")"; ?></label>
48
  </td>
49
  <td>
50
  <input type="checkbox" id="data4" name="clean[]" class="clean-data" value="comments"/>
@@ -53,7 +74,7 @@ defined('ABSPATH') or die;
53
  </tr>
54
  <tr>
55
  <td>
56
- <label for="data5" class="breeze_tool_tip" ><?php _e('Trackbacks and pingbacks','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('trackbacks').")"; ?></label>
57
  </td>
58
  <td>
59
  <input type="checkbox" id="data5" name="clean[]" class="clean-data" value="trackbacks"/>
@@ -62,7 +83,7 @@ defined('ABSPATH') or die;
62
  </tr>
63
  <tr>
64
  <td>
65
- <label for="data6" class="breeze_tool_tip" ><?php _e('Transient options','breeze')?><?php echo "&nbsp(".(int)Breeze_Configuration::getElementToClean('transient').")"; ?></label>
66
  </td>
67
  <td>
68
  <input type="checkbox" id="data6" name="clean[]" class="clean-data" value="transient"/>
1
  <?php
2
  defined('ABSPATH') or die;
3
+ $post_revisions = 0; $drafted = 0; $trashed = 0; $comments = 0; $trackbacks = 0; $transients = 0;
4
+ if (is_multisite()) {
5
+ $sites = get_sites();
6
+ foreach ($sites as $site) {
7
+ switch_to_blog($site->blog_id);
8
+ $post_revisions += (int)Breeze_Configuration::getElementToClean('revisions');
9
+ $drafted += (int)Breeze_Configuration::getElementToClean('drafted');
10
+ $trashed += (int)Breeze_Configuration::getElementToClean('trash');
11
+ $comments += (int)Breeze_Configuration::getElementToClean('comments');
12
+ $trackbacks += (int)Breeze_Configuration::getElementToClean('trackbacks');
13
+ $transients += (int)Breeze_Configuration::getElementToClean('transient');
14
+ }
15
+ restore_current_blog();
16
+ } else {
17
+ $post_revisions = (int)Breeze_Configuration::getElementToClean('revisions');
18
+ $drafted = (int)Breeze_Configuration::getElementToClean('drafted');
19
+ $trashed = (int)Breeze_Configuration::getElementToClean('trash');
20
+ $comments = (int)Breeze_Configuration::getElementToClean('comments');
21
+ $trackbacks = (int)Breeze_Configuration::getElementToClean('trackbacks');
22
+ $transients = (int)Breeze_Configuration::getElementToClean('transient');
23
+ }
24
  ?>
25
  <div class="breeze-top-notice">
26
  <label class="breeze_tool_tip"><?php _e('Important: Backup your databases before using the following options!','breeze')?></label>
37
  </tr>
38
  <tr>
39
  <td>
40
+ <label for="data1" class="breeze_tool_tip"><?php _e('Post revisions','breeze')?><?php echo "&nbsp(".$post_revisions.")"; ?></label>
41
  </td>
42
  <td>
43
  <input type="checkbox" id="data1" name="clean[]" class="clean-data" value="revisions"/>
46
  </tr>
47
  <tr>
48
  <td>
49
+ <label for="data2" class="breeze_tool_tip" ><?php _e('Auto drafted content','breeze')?><?php echo "&nbsp(".$drafted.")"; ?></label>
50
  </td>
51
  <td>
52
  <input type="checkbox" id="data2" name="clean[]" class="clean-data" value="drafted"/>
55
  </tr>
56
  <tr>
57
  <td>
58
+ <label for="data3" class="breeze_tool_tip" ><?php _e('All trashed content','breeze')?><?php echo "&nbsp(".$trashed.")"; ?></label>
59
  </td>
60
  <td>
61
  <input type="checkbox" id="data3" name="clean[]" class="clean-data" value="trash"/>
65
  </tr>
66
  <tr>
67
  <td>
68
+ <label for="data4" class="breeze_tool_tip" ><?php _e('Comments from trash & spam','breeze')?><?php echo "&nbsp(".$comments.")"; ?></label>
69
  </td>
70
  <td>
71
  <input type="checkbox" id="data4" name="clean[]" class="clean-data" value="comments"/>
74
  </tr>
75
  <tr>
76
  <td>
77
+ <label for="data5" class="breeze_tool_tip" ><?php _e('Trackbacks and pingbacks','breeze')?><?php echo "&nbsp(".$trackbacks.")"; ?></label>
78
  </td>
79
  <td>
80
  <input type="checkbox" id="data5" name="clean[]" class="clean-data" value="trackbacks"/>
83
  </tr>
84
  <tr>
85
  <td>
86
+ <label for="data6" class="breeze_tool_tip" ><?php _e('Transient options','breeze')?><?php echo "&nbsp(".$transients.")"; ?></label>
87
  </td>
88
  <td>
89
  <input type="checkbox" id="data6" name="clean[]" class="clean-data" value="transient"/>
views/tabs/faq.php CHANGED
@@ -25,6 +25,13 @@ wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/
25
  </div>
26
  </div>
27
 
 
 
 
 
 
 
 
28
  <div class="faq-block">
29
  <h3 class="faq-question"><?php _e('Is Breeze compatible with other WordPress Cache plugins?', 'breeze') ?></h3>
30
  <div class="faq-answer">
@@ -138,8 +145,8 @@ wp_enqueue_script('jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/
138
  <div class="faq-block">
139
  <h3 class="faq-question"><?php _e('Does Breeze Work With CloudFlare?', 'breeze') ?></h3>
140
  <div class="faq-answer">
141
- <p><?php _e('Yes. The process of setting up CloudFlare with Breeze is easy. Check out the ', 'breeze') ?>
142
- <a href="https://support.cloudways.com/can-i-use-cloudflare-cdn/" target="_blank"><?php _e('following KnowledgeBase article for details.', 'breeze') ?></a>
143
  </p>
144
  </div>
145
  </div>
25
  </div>
26
  </div>
27
 
28
+ <div class="faq-block">
29
+ <h3 class="faq-question"><?php _e('How does Breeze handle WordPress multisite?', 'breeze') ?></h3>
30
+ <div class="faq-answer">
31
+ <p><?php _e('Breeze handles all WordPress multisite instances globally. All the settings for multisite are now handled on the network level.', 'breeze') ?></p>
32
+ </div>
33
+ </div>
34
+
35
  <div class="faq-block">
36
  <h3 class="faq-question"><?php _e('Is Breeze compatible with other WordPress Cache plugins?', 'breeze') ?></h3>
37
  <div class="faq-answer">
145
  <div class="faq-block">
146
  <h3 class="faq-question"><?php _e('Does Breeze Work With CloudFlare?', 'breeze') ?></h3>
147
  <div class="faq-answer">
148
+ <p><?php _e('Yes. The process of setting up CloudFlare with Breeze is easy. Check out the following ', 'breeze') ?>
149
+ <a href="https://support.cloudways.com/can-i-use-cloudflare-cdn/" target="_blank"><?php _e('KnowledgeBase article for details.', 'breeze') ?></a>
150
  </p>
151
  </div>
152
  </div>