Version Description
Add: Improved handling of minification for Query stirng based exclusion in Never Cache These URLs option. Add: Increase compatibility with Multilingual .
Download this release
Release Info
Developer | adeelkhan |
Plugin | Breeze – WordPress Cache Plugin |
Version | 1.1.9 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.1.9
- breeze.php +4 -2
- inc/breeze-admin.php +506 -458
- inc/breeze-configuration.php +2 -1
- inc/cache/config-cache.php +30 -1
- inc/cache/ecommerce-cache.php +15 -0
- inc/cache/execute-cache.php +29 -7
- inc/cache/purge-cache.php +2 -2
- inc/class-exclude-pages-by-shortcode.php +120 -0
- inc/functions.php +25 -0
- inc/helpers.php +13 -0
- inc/minification/breeze-minification-cache.php +2 -1
- inc/minification/breeze-minify-main.php +72 -5
- readme.txt +8 -2
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.
|
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.
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
@@ -73,6 +73,8 @@ require_once BREEZE_PLUGIN_DIR . 'inc/functions.php';
|
|
73 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-varnish.php' );
|
74 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-cache.php' );
|
75 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-per-time.php' );
|
|
|
|
|
76 |
|
77 |
// Activate plugin hook
|
78 |
register_activation_hook( __FILE__, array( 'Breeze_Admin', 'plugin_active_hook' ) );
|
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.9
|
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.9' );
|
41 |
}
|
42 |
if ( ! defined( 'BREEZE_SITEURL' ) ) {
|
43 |
define( 'BREEZE_SITEURL', get_site_url() );
|
73 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-varnish.php' );
|
74 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-cache.php' );
|
75 |
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/purge-per-time.php' );
|
76 |
+
// Handle post exclude if shortcode.
|
77 |
+
require_once( BREEZE_PLUGIN_DIR . 'inc/class-exclude-pages-by-shortcode.php' );
|
78 |
|
79 |
// Activate plugin hook
|
80 |
register_activation_hook( __FILE__, array( 'Breeze_Admin', 'plugin_active_hook' ) );
|
inc/breeze-admin.php
CHANGED
@@ -1,458 +1,506 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @copyright 2017 Cloudways https://www.cloudways.com
|
4 |
-
*
|
5 |
-
* This plugin is inspired from WP Speed of Light by JoomUnited.
|
6 |
-
*
|
7 |
-
* This program is free software; you can redistribute it and/or modify
|
8 |
-
* it under the terms of the GNU General Public License as published by
|
9 |
-
* the Free Software Foundation; either version 2 of the License, or
|
10 |
-
* (at your option) any later version.
|
11 |
-
*
|
12 |
-
* This program is distributed in the hope that it will be useful,
|
13 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
-
* GNU General Public License for more details.
|
16 |
-
*
|
17 |
-
* You should have received a copy of the GNU General Public License
|
18 |
-
* along with this program; if not, write to the Free Software
|
19 |
-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20 |
-
*/
|
21 |
-
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
if ( $first_install
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$this
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
$
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
$
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
}
|
200 |
-
|
201 |
-
|
202 |
-
$
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
'
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
$args
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
'
|
232 |
-
'
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
'
|
240 |
-
'
|
241 |
-
'parent' => 'breeze-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
);
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
'breeze-
|
306 |
-
'breeze-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
'
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
);
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
$
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
'
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
}
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
);
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
}
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @copyright 2017 Cloudways https://www.cloudways.com
|
4 |
+
*
|
5 |
+
* This plugin is inspired from WP Speed of Light by JoomUnited.
|
6 |
+
*
|
7 |
+
* This program is free software; you can redistribute it and/or modify
|
8 |
+
* it under the terms of the GNU General Public License as published by
|
9 |
+
* the Free Software Foundation; either version 2 of the License, or
|
10 |
+
* (at your option) any later version.
|
11 |
+
*
|
12 |
+
* This program is distributed in the hope that it will be useful,
|
13 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
+
* GNU General Public License for more details.
|
16 |
+
*
|
17 |
+
* You should have received a copy of the GNU General Public License
|
18 |
+
* along with this program; if not, write to the Free Software
|
19 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20 |
+
*/
|
21 |
+
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Load the required resources.
|
25 |
+
*
|
26 |
+
* Class Breeze_Admin
|
27 |
+
*/
|
28 |
+
class Breeze_Admin {
|
29 |
+
public function __construct() {
|
30 |
+
add_action(
|
31 |
+
'init',
|
32 |
+
function () {
|
33 |
+
load_plugin_textdomain( 'breeze', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
34 |
+
}
|
35 |
+
);
|
36 |
+
|
37 |
+
// Add our custom action to clear cache
|
38 |
+
add_action( 'breeze_clear_all_cache', array( $this, 'breeze_clear_all_cache' ) );
|
39 |
+
add_action( 'breeze_clear_varnish', array( $this, 'breeze_clear_varnish' ) );
|
40 |
+
|
41 |
+
if ( is_admin() || 'cli' === php_sapi_name() ) {
|
42 |
+
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
43 |
+
|
44 |
+
//register menu
|
45 |
+
add_action( 'admin_menu', array( $this, 'register_menu_page' ) );
|
46 |
+
add_action( 'network_admin_menu', array( $this, 'register_network_menu_page' ) );
|
47 |
+
|
48 |
+
// Add notice when installing plugin
|
49 |
+
$first_install = get_option( 'breeze_first_install' );
|
50 |
+
if ( false === $first_install ) {
|
51 |
+
add_option( 'breeze_first_install', 'yes' );
|
52 |
+
}
|
53 |
+
if ( 'yes' === $first_install ) {
|
54 |
+
add_action( 'admin_notices', array( $this, 'installing_notices' ) );
|
55 |
+
}
|
56 |
+
|
57 |
+
$config = breeze_get_option( 'basic_settings' );
|
58 |
+
|
59 |
+
if ( isset( $config['breeze-display-clean'] ) && $config['breeze-display-clean'] ) {
|
60 |
+
//register top bar menu
|
61 |
+
add_action( 'admin_bar_menu', array( $this, 'register_admin_bar_menu' ), 999 );
|
62 |
+
}
|
63 |
+
/** Load admin js * */
|
64 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_scripts' ) );
|
65 |
+
|
66 |
+
add_action( 'wp_head', array( $this, 'define_ajaxurl' ) );
|
67 |
+
$this->ajax_handle();
|
68 |
+
|
69 |
+
// Add setting buttons to plugins list page
|
70 |
+
add_filter( 'plugin_action_links_' . BREEZE_BASENAME, array( $this, 'breeze_add_action_links' ) );
|
71 |
+
add_filter( 'network_admin_plugin_action_links_' . BREEZE_BASENAME, array( $this, 'breeze_add_action_links_network' ) );
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Admin Init.
|
78 |
+
*
|
79 |
+
*/
|
80 |
+
public function admin_init() {
|
81 |
+
//Check plugin requirements
|
82 |
+
if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
|
83 |
+
if ( current_user_can( 'activate_plugins' ) && is_plugin_active( plugin_basename( __FILE__ ) ) ) {
|
84 |
+
deactivate_plugins( __FILE__ );
|
85 |
+
add_action( 'admin_notices', array( $this, 'breeze_show_error' ) );
|
86 |
+
unset( $_GET['activate'] );
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
//Do not load anything more
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* define Ajax URL.
|
96 |
+
*/
|
97 |
+
function define_ajaxurl() {
|
98 |
+
if ( current_user_can( 'manage_options' ) ) {
|
99 |
+
echo '<script type="text/javascript">
|
100 |
+
var ajaxurl = "' . admin_url( 'admin-ajax.php' ) . '";
|
101 |
+
</script>';
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Add notice message when install plugin.
|
107 |
+
*/
|
108 |
+
public function installing_notices() {
|
109 |
+
$class = 'notice notice-success';
|
110 |
+
$message = __( 'Thanks for installing Breeze. It is always recommended not to use more than one caching plugin at the same time. We recommend you to purge cache if necessary.', 'breeze' );
|
111 |
+
|
112 |
+
printf( '<div class="%1$s"><p>%2$s <button class="button" id="breeze-hide-install-msg">' . __( 'Hide message', 'breeze' ) . '</button></p></div>', esc_attr( $class ), esc_html( $message ) );
|
113 |
+
update_option( 'breeze_first_install', 'no' );
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Enqueue CSS and JS files required for the plugin functionality.
|
118 |
+
*/
|
119 |
+
function load_admin_scripts() {
|
120 |
+
if ( ! wp_script_is( 'jquery', 'enqueued' ) ) {
|
121 |
+
wp_enqueue_script( 'jquery' );
|
122 |
+
}
|
123 |
+
wp_enqueue_script( 'breeze-backend', plugins_url( 'assets/js/breeze-backend.js', dirname( __FILE__ ) ), array( 'jquery' ), BREEZE_VERSION, true );
|
124 |
+
wp_enqueue_style( 'breeze-topbar', plugins_url( 'assets/css/topbar.css', dirname( __FILE__ ) ) );
|
125 |
+
wp_enqueue_style( 'breeze-notice', plugins_url( 'assets/css/notice.css', dirname( __FILE__ ) ) );
|
126 |
+
$current_screen = get_current_screen();
|
127 |
+
if ( $current_screen->base == 'settings_page_breeze' || $current_screen->base == 'settings_page_breeze-network' ) {
|
128 |
+
//add css
|
129 |
+
wp_enqueue_style( 'breeze-style', plugins_url( 'assets/css/style.css', dirname( __FILE__ ) ) );
|
130 |
+
//js
|
131 |
+
wp_enqueue_script( 'breeze-configuration', plugins_url( 'assets/js/breeze-configuration.js', dirname( __FILE__ ) ), array( 'jquery' ), BREEZE_VERSION, true );
|
132 |
+
|
133 |
+
// Include the required jQuery UI Core & Libraries
|
134 |
+
wp_enqueue_script( 'jquery-ui-core' );
|
135 |
+
wp_enqueue_script( 'jquery-ui-tabs' );
|
136 |
+
wp_enqueue_script( 'jquery-ui-accordion' );
|
137 |
+
wp_enqueue_script( 'jquery-ui-sortable' );
|
138 |
+
wp_enqueue_script( 'jquery-ui-widget' );
|
139 |
+
}
|
140 |
+
|
141 |
+
$token_name = array(
|
142 |
+
'breeze_purge_varnish' => wp_create_nonce( '_breeze_purge_varnish' ),
|
143 |
+
'breeze_purge_database' => wp_create_nonce( '_breeze_purge_database' ),
|
144 |
+
'breeze_purge_cache' => wp_create_nonce( '_breeze_purge_cache' ),
|
145 |
+
);
|
146 |
+
|
147 |
+
wp_localize_script( 'breeze-backend', 'breeze_token_name', $token_name );
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Register menu.
|
152 |
+
*
|
153 |
+
*/
|
154 |
+
function register_menu_page() {
|
155 |
+
//add submenu for Cloudways
|
156 |
+
add_submenu_page( 'options-general.php', __( 'Breeze', 'breeze' ), __( 'Breeze', 'breeze' ), 'manage_options', 'breeze', array( $this, 'breeze_load_page' ) );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Register menu for multisite.
|
161 |
+
*/
|
162 |
+
function register_network_menu_page() {
|
163 |
+
//add submenu for multisite network
|
164 |
+
add_submenu_page( 'settings.php', __( 'Breeze', 'breeze' ), __( 'Breeze', 'breeze' ), 'manage_options', 'breeze', array( $this, 'breeze_load_page' ) );
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Register bar menu.
|
170 |
+
*
|
171 |
+
* @param WP_Admin_Bar $wp_admin_bar
|
172 |
+
*/
|
173 |
+
function register_admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) {
|
174 |
+
if ( ! current_user_can( 'manage_options' ) && ! current_user_can( 'editor' ) ) {
|
175 |
+
return;
|
176 |
+
}
|
177 |
+
|
178 |
+
$is_network = is_multisite() && is_network_admin();
|
179 |
+
|
180 |
+
// add parent item
|
181 |
+
$args = array(
|
182 |
+
'id' => 'breeze-topbar',
|
183 |
+
'title' => esc_html__( 'Breeze', 'breeze' ),
|
184 |
+
'meta' => array(
|
185 |
+
'classname' => 'breeze',
|
186 |
+
),
|
187 |
+
);
|
188 |
+
$wp_admin_bar->add_node( $args );
|
189 |
+
|
190 |
+
// Recreate the current URL in order to redirect to the same page on cache purge.
|
191 |
+
$current_protocol = is_ssl() ? 'https' : 'http';
|
192 |
+
$current_host = $_SERVER['HTTP_HOST'];
|
193 |
+
$current_script = $_SERVER['SCRIPT_NAME'];
|
194 |
+
$current_params = $_SERVER['QUERY_STRING'];
|
195 |
+
|
196 |
+
if ( is_multisite() && ! is_subdomain_install() ) {
|
197 |
+
$blog_details = get_blog_details();
|
198 |
+
$current_host .= rtrim( $blog_details->path, '/' );
|
199 |
+
}
|
200 |
+
|
201 |
+
$current_screen_url = $current_protocol . '://' . $current_host . $current_script . '?' . $current_params;
|
202 |
+
$current_screen_url = remove_query_arg( array( 'breeze_purge', '_wpnonce' ), $current_screen_url );
|
203 |
+
|
204 |
+
|
205 |
+
// add purge all item
|
206 |
+
$args = array(
|
207 |
+
'id' => 'breeze-purge-all',
|
208 |
+
'title' => ( ! is_multisite() || $is_network ) ? esc_html__( 'Purge All Cache', 'breeze' ) : esc_html__( 'Purge Site Cache', 'breeze' ),
|
209 |
+
'parent' => 'breeze-topbar',
|
210 |
+
'href' => esc_url( wp_nonce_url( add_query_arg( 'breeze_purge', 1, $current_screen_url ), 'breeze_purge_cache' ) ),
|
211 |
+
'meta' => array( 'class' => 'breeze-toolbar-group' ),
|
212 |
+
);
|
213 |
+
$wp_admin_bar->add_node( $args );
|
214 |
+
|
215 |
+
// Editor role can only use Purge all cache option
|
216 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
217 |
+
return;
|
218 |
+
}
|
219 |
+
|
220 |
+
// add purge modules group
|
221 |
+
$args = array(
|
222 |
+
'id' => 'breeze-purge-modules',
|
223 |
+
'title' => esc_html__( 'Purge Modules', 'breeze' ),
|
224 |
+
'parent' => 'breeze-topbar',
|
225 |
+
'meta' => array( 'class' => 'breeze-toolbar-group' ),
|
226 |
+
);
|
227 |
+
$wp_admin_bar->add_node( $args );
|
228 |
+
|
229 |
+
// add child item (Purge Modules)
|
230 |
+
$args = array(
|
231 |
+
'id' => 'breeze-purge-varnish-group',
|
232 |
+
'title' => esc_html__( 'Purge Varnish Cache', 'breeze' ),
|
233 |
+
'parent' => 'breeze-purge-modules',
|
234 |
+
);
|
235 |
+
$wp_admin_bar->add_node( $args );
|
236 |
+
|
237 |
+
// add child item (Purge Modules)
|
238 |
+
$args = array(
|
239 |
+
'id' => 'breeze-purge-file-group',
|
240 |
+
'title' => esc_html__( 'Purge Internal Cache', 'breeze' ),
|
241 |
+
'parent' => 'breeze-purge-modules',
|
242 |
+
);
|
243 |
+
$wp_admin_bar->add_node( $args );
|
244 |
+
|
245 |
+
// add settings item
|
246 |
+
$args = array(
|
247 |
+
'id' => 'breeze-settings',
|
248 |
+
'title' => esc_html__( 'Settings', 'breeze' ),
|
249 |
+
'parent' => 'breeze-topbar',
|
250 |
+
'href' => $is_network ? network_admin_url( 'settings.php?page=breeze' ) : admin_url( 'options-general.php?page=breeze' ),
|
251 |
+
'meta' => array( 'class' => 'breeze-toolbar-group' ),
|
252 |
+
);
|
253 |
+
$wp_admin_bar->add_node( $args );
|
254 |
+
|
255 |
+
// add support item
|
256 |
+
$args = array(
|
257 |
+
'id' => 'breeze-support',
|
258 |
+
'title' => esc_html__( 'Support', 'breeze' ),
|
259 |
+
'href' => 'https://support.cloudways.com/breeze-wordpress-cache-configuration',
|
260 |
+
'parent' => 'breeze-topbar',
|
261 |
+
'meta' => array(
|
262 |
+
'class' => 'breeze-toolbar-group',
|
263 |
+
'target' => '_blank',
|
264 |
+
),
|
265 |
+
);
|
266 |
+
$wp_admin_bar->add_node( $args );
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Load plugin settings page for back-end.
|
271 |
+
*/
|
272 |
+
function breeze_load_page() {
|
273 |
+
if ( isset( $_GET['page'] ) && 'breeze' === $_GET['page'] ) {
|
274 |
+
require_once( BREEZE_PLUGIN_DIR . 'views/breeze-setting-views.php' );
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Error displayed of the PHP version is to low.
|
280 |
+
*/
|
281 |
+
public function breeze_show_error() {
|
282 |
+
echo '<div class="error"><p><strong>Breeze</strong> need at least PHP 5.3 version, please update php before installing the plugin.</p></div>';
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Admin ajax actions.
|
287 |
+
*/
|
288 |
+
public function ajax_handle() {
|
289 |
+
add_action( 'wp_ajax_breeze_purge_varnish', array( 'Breeze_Configuration', 'purge_varnish_action' ) );
|
290 |
+
add_action( 'wp_ajax_breeze_purge_file', array( 'Breeze_Configuration', 'breeze_ajax_clean_cache' ) );
|
291 |
+
add_action( 'wp_ajax_breeze_purge_database', array( 'Breeze_Configuration', 'breeze_ajax_purge_database' ) );
|
292 |
+
}
|
293 |
+
|
294 |
+
/*
|
295 |
+
* Register active plugin hook.
|
296 |
+
*/
|
297 |
+
public static function plugin_active_hook() {
|
298 |
+
WP_Filesystem();
|
299 |
+
// Default basic
|
300 |
+
$basic = breeze_get_option( 'basic_settings' );
|
301 |
+
if ( empty( $basic ) ) {
|
302 |
+
$basic = array();
|
303 |
+
}
|
304 |
+
$default_basic = array(
|
305 |
+
'breeze-active' => '1',
|
306 |
+
'breeze-ttl' => '',
|
307 |
+
'breeze-minify-html' => '0',
|
308 |
+
'breeze-minify-css' => '0',
|
309 |
+
'breeze-minify-js' => '0',
|
310 |
+
'breeze-gzip-compression' => '1',
|
311 |
+
'breeze-desktop-cache' => '1',
|
312 |
+
'breeze-browser-cache' => '1',
|
313 |
+
'breeze-mobile-cache' => '1',
|
314 |
+
'breeze-disable-admin' => '1',
|
315 |
+
'breeze-display-clean' => '1',
|
316 |
+
'breeze-include-inline-js' => '0',
|
317 |
+
'breeze-include-inline-css' => '0',
|
318 |
+
);
|
319 |
+
$basic = array_merge( $default_basic, $basic );
|
320 |
+
|
321 |
+
// Default Advanced
|
322 |
+
$advanced = breeze_get_option( 'advanced_settings' );
|
323 |
+
if ( empty( $advanced ) ) {
|
324 |
+
$advanced = array();
|
325 |
+
}
|
326 |
+
$default_advanced = array(
|
327 |
+
'breeze-exclude-urls' => array(),
|
328 |
+
'breeze-group-css' => '0',
|
329 |
+
'breeze-group-js' => '0',
|
330 |
+
'breeze-exclude-css' => array(),
|
331 |
+
'breeze-exclude-js' => array(),
|
332 |
+
'breeze-move-to-footer-js' => array(),
|
333 |
+
'breeze-defer-js' => array(),
|
334 |
+
);
|
335 |
+
$advanced = array_merge( $default_advanced, $advanced );
|
336 |
+
|
337 |
+
//CDN default
|
338 |
+
$cdn = breeze_get_option( 'cdn_integration' );
|
339 |
+
if ( empty( $cdn ) ) {
|
340 |
+
$cdn = array();
|
341 |
+
}
|
342 |
+
$wp_content = substr( WP_CONTENT_DIR, strlen( ABSPATH ) );
|
343 |
+
$default_cdn = array(
|
344 |
+
'cdn-active' => '0',
|
345 |
+
'cdn-url' => '',
|
346 |
+
'cdn-content' => array( 'wp-includes', $wp_content ),
|
347 |
+
'cdn-exclude-content' => array( '.php' ),
|
348 |
+
'cdn-relative-path' => '1',
|
349 |
+
);
|
350 |
+
$cdn = array_merge( $default_cdn, $cdn );
|
351 |
+
|
352 |
+
// Varnish default
|
353 |
+
$varnish = breeze_get_option( 'varnish_cache' );
|
354 |
+
if ( empty( $varnish ) ) {
|
355 |
+
$varnish = array();
|
356 |
+
}
|
357 |
+
$default_varnish = array(
|
358 |
+
'auto-purge-varnish' => '1',
|
359 |
+
);
|
360 |
+
$varnish = array_merge( $default_varnish, $varnish );
|
361 |
+
|
362 |
+
if ( is_multisite() ) {
|
363 |
+
$blogs = get_sites();
|
364 |
+
foreach ( $blogs as $blog ) {
|
365 |
+
$blog_basic = get_blog_option( (int) $blog->blog_id, 'breeze_basic_settings', '' );
|
366 |
+
if ( empty( $blog_basic ) ) {
|
367 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_basic_settings', $basic );
|
368 |
+
}
|
369 |
+
|
370 |
+
$blog_advanced = get_blog_option( (int) $blog->blog_id, 'breeze_advanced_settings', '' );
|
371 |
+
if ( empty( $blog_advanced ) ) {
|
372 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_advanced_settings', $advanced );
|
373 |
+
}
|
374 |
+
|
375 |
+
$blog_cdn = get_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', '' );
|
376 |
+
if ( empty( $blog_cdn ) ) {
|
377 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_cdn_integration', $cdn );
|
378 |
+
}
|
379 |
+
|
380 |
+
$blog_varnish = get_blog_option( (int) $blog->blog_id, 'breeze_varnish_cache', '' );
|
381 |
+
if ( empty( $blog_varnish ) ) {
|
382 |
+
update_blog_option( (int) $blog->blog_id, 'breeze_varnish_cache', $varnish );
|
383 |
+
}
|
384 |
+
}
|
385 |
+
} else {
|
386 |
+
update_option( 'breeze_basic_settings', $basic );
|
387 |
+
update_option( 'breeze_advanced_settings', $advanced );
|
388 |
+
update_option( 'breeze_cdn_integration', $cdn );
|
389 |
+
update_option( 'breeze_varnish_cache', $varnish );
|
390 |
+
}
|
391 |
+
|
392 |
+
//add header to htaccess if setting is enabled or by default if first installed
|
393 |
+
Breeze_Configuration::update_htaccess();
|
394 |
+
//automatic config start cache
|
395 |
+
Breeze_ConfigCache::factory()->write();
|
396 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
397 |
+
|
398 |
+
if ( ! empty( $basic ) && ! empty( $basic['breeze-active'] ) ) {
|
399 |
+
Breeze_ConfigCache::factory()->toggle_caching( true );
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
/*
|
404 |
+
* Register deactivate plugin hook.
|
405 |
+
*/
|
406 |
+
public static function plugin_deactive_hook() {
|
407 |
+
WP_Filesystem();
|
408 |
+
Breeze_ConfigCache::factory()->clean_up();
|
409 |
+
Breeze_ConfigCache::factory()->clean_config();
|
410 |
+
Breeze_ConfigCache::factory()->toggle_caching( false );
|
411 |
+
Breeze_Configuration::update_htaccess( true );
|
412 |
+
}
|
413 |
+
|
414 |
+
/*
|
415 |
+
* Render tab for the settings in back-end.
|
416 |
+
*/
|
417 |
+
public static function render( $tab ) {
|
418 |
+
require_once( BREEZE_PLUGIN_DIR . 'views/tabs/' . $tab . '.php' );
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Check varnish cache exist.
|
423 |
+
*
|
424 |
+
* @return bool
|
425 |
+
*/
|
426 |
+
public static function check_varnish() {
|
427 |
+
if ( isset( $_SERVER['HTTP_X_VARNISH'] ) ) {
|
428 |
+
return true;
|
429 |
+
}
|
430 |
+
|
431 |
+
return false;
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Applied to the list of links to display on the plugins page.
|
436 |
+
*
|
437 |
+
* @param array $links List of links.
|
438 |
+
*
|
439 |
+
* @return array
|
440 |
+
*/
|
441 |
+
public function breeze_add_action_links( $links ) {
|
442 |
+
$my_links = array(
|
443 |
+
'<a href="' . admin_url( 'options-general.php?page=breeze' ) . '">Settings</a>',
|
444 |
+
);
|
445 |
+
|
446 |
+
return array_merge( $my_links, $links );
|
447 |
+
}
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Applied to the list of links to display on the network plugins page
|
451 |
+
*
|
452 |
+
* @param array $links List of links.
|
453 |
+
*
|
454 |
+
* @return array
|
455 |
+
*/
|
456 |
+
public function breeze_add_action_links_network( $links ) {
|
457 |
+
$my_links = array(
|
458 |
+
'<a href="' . network_admin_url( 'settings.php?page=breeze' ) . '">Settings</a>',
|
459 |
+
);
|
460 |
+
|
461 |
+
return array_merge( $my_links, $links );
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Clear all cache action.
|
466 |
+
*/
|
467 |
+
public function breeze_clear_all_cache() {
|
468 |
+
|
469 |
+
//delete minify
|
470 |
+
Breeze_MinificationCache::clear_minification();
|
471 |
+
//clear normal cache
|
472 |
+
Breeze_PurgeCache::breeze_cache_flush();
|
473 |
+
//clear varnish cache
|
474 |
+
$this->breeze_clear_varnish();
|
475 |
+
}
|
476 |
+
|
477 |
+
/**
|
478 |
+
* Clear all varnish cache action.
|
479 |
+
*/
|
480 |
+
public function breeze_clear_varnish() {
|
481 |
+
$main = new Breeze_PurgeVarnish();
|
482 |
+
|
483 |
+
$is_network = ( is_network_admin() || ( ! empty( $_POST['is_network'] ) && 'true' === $_POST['is_network'] ) );
|
484 |
+
|
485 |
+
if ( is_multisite() && $is_network ) {
|
486 |
+
$sites = get_sites();
|
487 |
+
foreach ( $sites as $site ) {
|
488 |
+
switch_to_blog( $site->blog_id );
|
489 |
+
$homepage = home_url() . '/?breeze';
|
490 |
+
$main->purge_cache( $homepage );
|
491 |
+
restore_current_blog();
|
492 |
+
}
|
493 |
+
} else {
|
494 |
+
$homepage = home_url() . '/?breeze';
|
495 |
+
$main->purge_cache( $homepage );
|
496 |
+
}
|
497 |
+
}
|
498 |
+
}
|
499 |
+
|
500 |
+
add_action(
|
501 |
+
'init',
|
502 |
+
function () {
|
503 |
+
$admin = new Breeze_Admin();
|
504 |
+
},
|
505 |
+
0
|
506 |
+
);
|
inc/breeze-configuration.php
CHANGED
@@ -652,7 +652,8 @@ class Breeze_Configuration{
|
|
652 |
$blog_id = get_current_blog_id();
|
653 |
$files_path .= DIRECTORY_SEPARATOR . $blog_id;
|
654 |
}
|
655 |
-
|
|
|
656 |
|
657 |
$result = self::formatBytes( $size_cache );
|
658 |
|
652 |
$blog_id = get_current_blog_id();
|
653 |
$files_path .= DIRECTORY_SEPARATOR . $blog_id;
|
654 |
}
|
655 |
+
|
656 |
+
$size_cache += breeze_get_directory_size( $files_path, array( 'index.html' ) );
|
657 |
|
658 |
$result = self::formatBytes( $size_cache );
|
659 |
|
inc/cache/config-cache.php
CHANGED
@@ -163,6 +163,34 @@ class Breeze_ConfigCache {
|
|
163 |
! empty( $config['breeze-exclude-urls'] ) ? $config['breeze-exclude-urls'] : array()
|
164 |
);
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
return self::write_config( $storage );
|
167 |
}
|
168 |
|
@@ -192,7 +220,8 @@ class Breeze_ConfigCache {
|
|
192 |
|
193 |
$config_file_string = '<?php ' . "\n\r" . "defined( 'ABSPATH' ) || exit;" . "\n\r" . 'return ' . var_export( $config, true ) . '; ' . "\n\r";
|
194 |
|
195 |
-
|
|
|
196 |
}
|
197 |
//turn on / off wp cache
|
198 |
public function toggle_caching( $status ) {
|
163 |
! empty( $config['breeze-exclude-urls'] ) ? $config['breeze-exclude-urls'] : array()
|
164 |
);
|
165 |
|
166 |
+
$saved_pages = get_option( 'breeze_exclude_url_pages', array() );
|
167 |
+
|
168 |
+
if ( ! empty( $saved_pages ) ) {
|
169 |
+
$saved_pages_urls = array();
|
170 |
+
foreach ( $saved_pages as $page_id ) {
|
171 |
+
$saved_pages_urls[] = get_permalink( $page_id );
|
172 |
+
}
|
173 |
+
|
174 |
+
$saved_pages_urls = array_unique( $saved_pages_urls );
|
175 |
+
|
176 |
+
$storage['exclude_url'] = array_merge(
|
177 |
+
$saved_pages_urls,
|
178 |
+
! empty( $config['breeze-exclude-urls'] ) ? $config['breeze-exclude-urls'] : array()
|
179 |
+
);
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
if( class_exists('WC_Facebook_Loader')){
|
184 |
+
$woocommerce_fb_feed_link = Breeze_Ecommerce_Cache::factory()->wc_facebook_feed();
|
185 |
+
|
186 |
+
if(!empty($woocommerce_fb_feed_link)){
|
187 |
+
$storage['exclude_url'] = array_merge(
|
188 |
+
$woocommerce_fb_feed_link,
|
189 |
+
! empty( $config['breeze-exclude-urls'] ) ? $config['breeze-exclude-urls'] : array()
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
return self::write_config( $storage );
|
195 |
}
|
196 |
|
220 |
|
221 |
$config_file_string = '<?php ' . "\n\r" . "defined( 'ABSPATH' ) || exit;" . "\n\r" . 'return ' . var_export( $config, true ) . '; ' . "\n\r";
|
222 |
|
223 |
+
|
224 |
+
return $wp_filesystem->put_contents( $config_file, $config_file_string );
|
225 |
}
|
226 |
//turn on / off wp cache
|
227 |
public function toggle_caching( $status ) {
|
inc/cache/ecommerce-cache.php
CHANGED
@@ -85,6 +85,21 @@ class Breeze_Ecommerce_Cache {
|
|
85 |
return $urls;
|
86 |
}
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
/*
|
89 |
* Return basic url without translate plugin
|
90 |
*/
|
85 |
return $urls;
|
86 |
}
|
87 |
|
88 |
+
/**
|
89 |
+
* Removes from cache WooCommerce Facebook Product Feed.
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
* @since 1.1.8
|
93 |
+
* @access public
|
94 |
+
*/
|
95 |
+
public function wc_facebook_feed() {
|
96 |
+
$urls = array();
|
97 |
+
if ( class_exists( 'WC_Facebook_Loader' ) ) {
|
98 |
+
$urls[] = SkyVerge\WooCommerce\Facebook\Products\Feed::get_feed_data_url();
|
99 |
+
}
|
100 |
+
|
101 |
+
return $urls;
|
102 |
+
}
|
103 |
/*
|
104 |
* Return basic url without translate plugin
|
105 |
*/
|
inc/cache/execute-cache.php
CHANGED
@@ -16,6 +16,10 @@ if ( strpos( $_SERVER['REQUEST_URI'], 'robots.txt' ) !== false || strpos( $_SERV
|
|
16 |
return;
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
19 |
// Don't cache non-GET requests
|
20 |
if ( ! isset( $_SERVER['REQUEST_METHOD'] ) || $_SERVER['REQUEST_METHOD'] !== 'GET' ) {
|
21 |
return;
|
@@ -63,10 +67,16 @@ if ( ! empty( $_COOKIE ) ) {
|
|
63 |
foreach ( $_COOKIE as $k => $v ) {
|
64 |
if ( strpos( $k, 'wordpress_logged_in_' ) !== false ) {
|
65 |
$nameuser = substr( $v, 0, strpos( $v, '|' ) );
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
}
|
69 |
}
|
|
|
70 |
if ( ! empty( $_COOKIE['breeze_commented_posts'] ) ) {
|
71 |
foreach ( $_COOKIE['breeze_commented_posts'] as $path ) {
|
72 |
if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) {
|
@@ -83,7 +93,6 @@ $domain = ( ( ( ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) ||
|
|
83 |
$current_url = $domain . rawurldecode( $_SERVER['REQUEST_URI'] );
|
84 |
$opts_config = $GLOBALS['breeze_config'];
|
85 |
$check_exclude = check_exclude_page( $opts_config, $current_url );
|
86 |
-
|
87 |
//load cache
|
88 |
if ( ! $check_exclude ) {
|
89 |
$devices = $opts_config['cache_options'];
|
@@ -118,11 +127,11 @@ if ( ! $check_exclude ) {
|
|
118 |
/**
|
119 |
* Cache output before it goes to the browser
|
120 |
*
|
121 |
-
* @param
|
122 |
-
* @param
|
123 |
*
|
124 |
-
* @since 1.0
|
125 |
* @return string
|
|
|
126 |
*/
|
127 |
function breeze_cache( $buffer, $flags ) {
|
128 |
// No cache for pages without 200 response status
|
@@ -211,7 +220,13 @@ function breeze_cache( $buffer, $flags ) {
|
|
211 |
if ( is_user_logged_in() ) {
|
212 |
$current_user = wp_get_current_user();
|
213 |
if ( $current_user->user_login ) {
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
}
|
216 |
} else {
|
217 |
global $filename_guest_suffix;
|
@@ -273,8 +288,8 @@ function breeze_cache( $buffer, $flags ) {
|
|
273 |
/**
|
274 |
* Get URL path for caching
|
275 |
*
|
276 |
-
* @since 1.0
|
277 |
* @return string
|
|
|
278 |
*/
|
279 |
function breeze_get_url_path() {
|
280 |
|
@@ -352,6 +367,13 @@ function breeze_serve_cache( $filename, $url_path, $X1, $opts ) {
|
|
352 |
}
|
353 |
|
354 |
function check_exclude_page( $opts_config, $current_url ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
//check disable cache for page
|
356 |
if ( ! empty( $opts_config['exclude_url'] ) ) {
|
357 |
foreach ( $opts_config['exclude_url'] as $v ) {
|
16 |
return;
|
17 |
}
|
18 |
|
19 |
+
if ( strpos( $_SERVER['REQUEST_URI'], 'breeze-minification' ) !== false ) {
|
20 |
+
return;
|
21 |
+
}
|
22 |
+
|
23 |
// Don't cache non-GET requests
|
24 |
if ( ! isset( $_SERVER['REQUEST_METHOD'] ) || $_SERVER['REQUEST_METHOD'] !== 'GET' ) {
|
25 |
return;
|
67 |
foreach ( $_COOKIE as $k => $v ) {
|
68 |
if ( strpos( $k, 'wordpress_logged_in_' ) !== false ) {
|
69 |
$nameuser = substr( $v, 0, strpos( $v, '|' ) );
|
70 |
+
if ( substr_count( $url_path, '?' ) > 0 ) {
|
71 |
+
$filename = $url_path .'&'. strtolower( $nameuser );
|
72 |
+
}else{
|
73 |
+
$filename = $url_path .'?'. strtolower( $nameuser );
|
74 |
+
}
|
75 |
+
|
76 |
}
|
77 |
}
|
78 |
}
|
79 |
+
|
80 |
if ( ! empty( $_COOKIE['breeze_commented_posts'] ) ) {
|
81 |
foreach ( $_COOKIE['breeze_commented_posts'] as $path ) {
|
82 |
if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) {
|
93 |
$current_url = $domain . rawurldecode( $_SERVER['REQUEST_URI'] );
|
94 |
$opts_config = $GLOBALS['breeze_config'];
|
95 |
$check_exclude = check_exclude_page( $opts_config, $current_url );
|
|
|
96 |
//load cache
|
97 |
if ( ! $check_exclude ) {
|
98 |
$devices = $opts_config['cache_options'];
|
127 |
/**
|
128 |
* Cache output before it goes to the browser
|
129 |
*
|
130 |
+
* @param string $buffer
|
131 |
+
* @param int $flags
|
132 |
*
|
|
|
133 |
* @return string
|
134 |
+
* @since 1.0
|
135 |
*/
|
136 |
function breeze_cache( $buffer, $flags ) {
|
137 |
// No cache for pages without 200 response status
|
220 |
if ( is_user_logged_in() ) {
|
221 |
$current_user = wp_get_current_user();
|
222 |
if ( $current_user->user_login ) {
|
223 |
+
|
224 |
+
if ( substr_count( $url_path, '?' ) > 0 ) {
|
225 |
+
$url_path .= '&'. $current_user->user_login;
|
226 |
+
}else{
|
227 |
+
$url_path .= '?'. $current_user->user_login;
|
228 |
+
}
|
229 |
+
#$url_path .= $current_user->user_login;
|
230 |
}
|
231 |
} else {
|
232 |
global $filename_guest_suffix;
|
288 |
/**
|
289 |
* Get URL path for caching
|
290 |
*
|
|
|
291 |
* @return string
|
292 |
+
* @since 1.0
|
293 |
*/
|
294 |
function breeze_get_url_path() {
|
295 |
|
367 |
}
|
368 |
|
369 |
function check_exclude_page( $opts_config, $current_url ) {
|
370 |
+
$is_feed = breeze_is_feed( $current_url );
|
371 |
+
|
372 |
+
if ( true === $is_feed ) {
|
373 |
+
return true;
|
374 |
+
}
|
375 |
+
|
376 |
+
|
377 |
//check disable cache for page
|
378 |
if ( ! empty( $opts_config['exclude_url'] ) ) {
|
379 |
foreach ( $opts_config['exclude_url'] as $v ) {
|
inc/cache/purge-cache.php
CHANGED
@@ -119,8 +119,8 @@ class Breeze_PurgeCache {
|
|
119 |
|
120 |
WP_Filesystem();
|
121 |
|
122 |
-
$cache_path = breeze_get_cache_base_path( is_network_admin()
|
123 |
-
|
124 |
|
125 |
if ( function_exists( 'wp_cache_flush' ) ) {
|
126 |
wp_cache_flush();
|
119 |
|
120 |
WP_Filesystem();
|
121 |
|
122 |
+
$cache_path = breeze_get_cache_base_path( is_network_admin() );
|
123 |
+
$wp_filesystem->rmdir( untrailingslashit( $cache_path ), true );
|
124 |
|
125 |
if ( function_exists( 'wp_cache_flush' ) ) {
|
126 |
wp_cache_flush();
|
inc/class-exclude-pages-by-shortcode.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
header( 'Status: 403 Forbidden' );
|
4 |
+
header( 'HTTP/1.1 403 Forbidden' );
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Exclude pages from cache based on the specific given shortcodes.
|
10 |
+
*
|
11 |
+
* Class Exclude_Pages_By_Shortcode
|
12 |
+
* @since 1.1.8
|
13 |
+
*/
|
14 |
+
class Exclude_Pages_By_Shortcode {
|
15 |
+
|
16 |
+
function __construct() {
|
17 |
+
add_action( 'save_post', [ &$this, 'post_check_content_on_save' ], 10, 3 );
|
18 |
+
}
|
19 |
+
|
20 |
+
public function post_check_content_on_save( $post_id = 0, $post = null, $update = false ) {
|
21 |
+
$content = trim( $post->post_content );
|
22 |
+
|
23 |
+
|
24 |
+
if ( 'page' !== $post->post_type ) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
preg_match_all( '/\[([^<>&\/\[\]\x00-\x20=]++)/ms', $content, $output_shortcodes );
|
28 |
+
|
29 |
+
$saved_pages = get_option( 'breeze_exclude_url_pages', array() );
|
30 |
+
$saved_pages = array_map( 'absint', $saved_pages );
|
31 |
+
$page_id = (int) $post->ID;
|
32 |
+
$found = false;
|
33 |
+
$action_taken = false;
|
34 |
+
|
35 |
+
$shortcode_list = self::shortcode_exception_list_fixed();
|
36 |
+
|
37 |
+
if ( ! empty( $output_shortcodes ) ) {
|
38 |
+
|
39 |
+
if ( isset( $output_shortcodes[1] ) && ! empty( $output_shortcodes[1] ) ) {
|
40 |
+
|
41 |
+
$data = $output_shortcodes[1];
|
42 |
+
$data = array_unique( $data );
|
43 |
+
|
44 |
+
|
45 |
+
foreach ( $shortcode_list as $shortcode ) {
|
46 |
+
$result = array_filter( $data, function ( $item ) use ( $shortcode ) {
|
47 |
+
$shortcode = str_replace( '(.*)', '', $shortcode );
|
48 |
+
if ( stripos( $item, $shortcode ) !== false ) {
|
49 |
+
return true;
|
50 |
+
}
|
51 |
+
|
52 |
+
return false;
|
53 |
+
} );
|
54 |
+
|
55 |
+
if ( ! empty( $result ) ) {
|
56 |
+
$found = true;
|
57 |
+
break;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( true === $found ) {
|
64 |
+
if ( ! in_array( $page_id, $saved_pages, true ) ) {
|
65 |
+
$saved_pages[] = $page_id;
|
66 |
+
update_option( 'breeze_exclude_url_pages', $saved_pages );
|
67 |
+
$action_taken = true;
|
68 |
+
}
|
69 |
+
} else {
|
70 |
+
|
71 |
+
if ( in_array( $page_id, $saved_pages, true ) ) {
|
72 |
+
$saved_pages_modified = array();
|
73 |
+
foreach ( $saved_pages as $index => $saved_page ) {
|
74 |
+
if ( $page_id !== $saved_page ) {
|
75 |
+
$saved_pages_modified[] = $saved_page;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
update_option( 'breeze_exclude_url_pages', $saved_pages_modified );
|
79 |
+
$action_taken = true;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( true === $action_taken ) {
|
85 |
+
// reset the config file.
|
86 |
+
global $wp_filesystem;
|
87 |
+
if ( empty( $wp_filesystem ) ) {
|
88 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
89 |
+
WP_Filesystem();
|
90 |
+
}
|
91 |
+
|
92 |
+
// import these file in front-end when required.
|
93 |
+
if ( ! class_exists( 'Breeze_Ecommerce_Cache' ) ) {
|
94 |
+
//cache when ecommerce installed
|
95 |
+
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/ecommerce-cache.php' );
|
96 |
+
}
|
97 |
+
|
98 |
+
// import these file in front-end when required.
|
99 |
+
if ( ! class_exists( 'Breeze_ConfigCache' ) ) {
|
100 |
+
//config to cache
|
101 |
+
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/config-cache.php' );
|
102 |
+
}
|
103 |
+
|
104 |
+
Breeze_ConfigCache::factory()->write_config_cache();
|
105 |
+
}
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
static public function shortcode_exception_list_fixed() {
|
110 |
+
$shortcode_exceptions = array(
|
111 |
+
'mycred_(.*)',
|
112 |
+
);
|
113 |
+
|
114 |
+
$shortcode_exceptions = apply_filters( 'breeze_shortcode_page_exclude', $shortcode_exceptions );
|
115 |
+
|
116 |
+
return $shortcode_exceptions;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
new Exclude_Pages_By_Shortcode();
|
inc/functions.php
CHANGED
@@ -29,9 +29,14 @@ defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
|
|
29 |
*/
|
30 |
function breeze_get_cache_base_path( $is_network = false, $blog_id_requested = 0 ) {
|
31 |
|
|
|
|
|
|
|
|
|
32 |
if ( ! $is_network && is_multisite() ) {
|
33 |
|
34 |
if ( empty( $blog_id_requested ) ) {
|
|
|
35 |
global $blog_id;
|
36 |
$path = rtrim( WP_CONTENT_DIR, '/\\' ) . '/cache/breeze/';
|
37 |
if ( ! empty( $blog_id ) ) {
|
@@ -101,3 +106,23 @@ function breeze_all_user_folders() {
|
|
101 |
'contributor',
|
102 |
);
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
*/
|
30 |
function breeze_get_cache_base_path( $is_network = false, $blog_id_requested = 0 ) {
|
31 |
|
32 |
+
if ( empty( $blog_id_requested ) ) {
|
33 |
+
$blog_id_requested = isset( $GLOBALS['breeze_config']['blog_id'] ) ? $GLOBALS['breeze_config']['blog_id'] : 0;
|
34 |
+
}
|
35 |
+
|
36 |
if ( ! $is_network && is_multisite() ) {
|
37 |
|
38 |
if ( empty( $blog_id_requested ) ) {
|
39 |
+
|
40 |
global $blog_id;
|
41 |
$path = rtrim( WP_CONTENT_DIR, '/\\' ) . '/cache/breeze/';
|
42 |
if ( ! empty( $blog_id ) ) {
|
106 |
'contributor',
|
107 |
);
|
108 |
}
|
109 |
+
|
110 |
+
function breeze_is_feed( $url ) {
|
111 |
+
|
112 |
+
$parse_result = parse_url( $url );
|
113 |
+
|
114 |
+
if ( isset( $parse_result['query'] ) ) {
|
115 |
+
if ( substr_count( $parse_result['query'], 'feed=' ) > 0 ) {
|
116 |
+
return true;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( isset( $parse_result['path'] ) ) {
|
121 |
+
if ( substr_count( $parse_result['path'], '/feed' ) > 0 ) {
|
122 |
+
return true;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
return false;
|
127 |
+
|
128 |
+
}
|
inc/helpers.php
CHANGED
@@ -619,3 +619,16 @@ function breeze_unlock_process( $path = '' ) {
|
|
619 |
|
620 |
return false;
|
621 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
|
620 |
return false;
|
621 |
}
|
622 |
+
|
623 |
+
function multisite_blog_id_config() {
|
624 |
+
global $blog_id;
|
625 |
+
|
626 |
+
$blog_id_requested = isset( $GLOBALS['breeze_config']['blog_id'] ) ? $GLOBALS['breeze_config']['blog_id'] : 0;
|
627 |
+
if ( ! empty( $blog_id_requested ) ) {
|
628 |
+
return $blog_id_requested;
|
629 |
+
}
|
630 |
+
|
631 |
+
if ( ! empty( $blog_id ) ) {
|
632 |
+
|
633 |
+
}
|
634 |
+
}
|
inc/minification/breeze-minification-cache.php
CHANGED
@@ -246,8 +246,9 @@ class Breeze_MinificationCache {
|
|
246 |
foreach ( $sites as $blog_id ) {
|
247 |
switch_to_blog( $blog_id );
|
248 |
self::clear_site_minification();
|
|
|
249 |
}
|
250 |
-
|
251 |
} else {
|
252 |
self::clear_site_minification();
|
253 |
}
|
246 |
foreach ( $sites as $blog_id ) {
|
247 |
switch_to_blog( $blog_id );
|
248 |
self::clear_site_minification();
|
249 |
+
restore_current_blog();
|
250 |
}
|
251 |
+
|
252 |
} else {
|
253 |
self::clear_site_minification();
|
254 |
}
|
inc/minification/breeze-minify-main.php
CHANGED
@@ -34,9 +34,9 @@ class Breeze_Minify {
|
|
34 |
//cache html
|
35 |
//cache minification
|
36 |
if ( Breeze_MinificationCache::create_cache_minification_folder() ) {
|
37 |
-
$conf
|
38 |
$config_advanced = breeze_get_option( 'advanced_settings' );
|
39 |
-
if ( ! empty( $conf['breeze-minify-html'] ) || ! empty( $conf['breeze-minify-css'] ) || ! empty( $conf['breeze-minify-js'] ) || ! empty( $config_advanced['breeze-defer-js'] )) {
|
40 |
|
41 |
if ( defined( 'breeze_INIT_EARLIER' ) ) {
|
42 |
add_action( 'init', array( $this, 'breeze_start_buffering' ), - 1 );
|
@@ -96,7 +96,7 @@ class Breeze_Minify {
|
|
96 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-scripts.php' );
|
97 |
|
98 |
// JS/CSS minifier library
|
99 |
-
include_once(BREEZE_PLUGIN_DIR.'vendor/autoload.php');
|
100 |
|
101 |
if ( ! defined( 'CONCATENATE_SCRIPTS' ) ) {
|
102 |
define( 'CONCATENATE_SCRIPTS', false );
|
@@ -222,13 +222,22 @@ class Breeze_Minify {
|
|
222 |
),
|
223 |
'Breeze_Js_Deferred_Loading' => array(
|
224 |
'move_to_footer_js' => $minify['breeze-move-to-footer-js'],
|
225 |
-
'defer_js'
|
226 |
),
|
227 |
);
|
228 |
|
229 |
$content = apply_filters( 'breeze_filter_html_before_minify', $content );
|
230 |
|
231 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
$content = apply_filters( 'breeze_html_after_minify', $content );
|
233 |
|
234 |
} else {
|
@@ -269,12 +278,27 @@ class Breeze_Minify {
|
|
269 |
return $content;
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
/*
|
273 |
* check url from Never cache the following pages area
|
274 |
*/
|
275 |
public function check_exclude_url( $current_url ) {
|
276 |
$opts_config = breeze_get_option( 'advanced_settings' );
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
$is_exclude = breeze_check_for_exclude_values( $current_url, $opts_config['breeze-exclude-urls'] );
|
279 |
if ( ! empty( $is_exclude ) ) {
|
280 |
return true;
|
@@ -301,9 +325,24 @@ class Breeze_Minify {
|
|
301 |
}
|
302 |
|
303 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
// Whole path
|
305 |
if ( $v == $current_url ) {
|
306 |
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
308 |
}
|
309 |
}
|
@@ -312,4 +351,32 @@ class Breeze_Minify {
|
|
312 |
return false;
|
313 |
|
314 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
}
|
34 |
//cache html
|
35 |
//cache minification
|
36 |
if ( Breeze_MinificationCache::create_cache_minification_folder() ) {
|
37 |
+
$conf = breeze_get_option( 'basic_settings' );
|
38 |
$config_advanced = breeze_get_option( 'advanced_settings' );
|
39 |
+
if ( ! empty( $conf['breeze-minify-html'] ) || ! empty( $conf['breeze-minify-css'] ) || ! empty( $conf['breeze-minify-js'] ) || ! empty( $config_advanced['breeze-defer-js'] ) ) {
|
40 |
|
41 |
if ( defined( 'breeze_INIT_EARLIER' ) ) {
|
42 |
add_action( 'init', array( $this, 'breeze_start_buffering' ), - 1 );
|
96 |
include_once( BREEZE_PLUGIN_DIR . 'inc/minification/breeze-minification-scripts.php' );
|
97 |
|
98 |
// JS/CSS minifier library
|
99 |
+
include_once( BREEZE_PLUGIN_DIR . 'vendor/autoload.php' );
|
100 |
|
101 |
if ( ! defined( 'CONCATENATE_SCRIPTS' ) ) {
|
102 |
define( 'CONCATENATE_SCRIPTS', false );
|
222 |
),
|
223 |
'Breeze_Js_Deferred_Loading' => array(
|
224 |
'move_to_footer_js' => $minify['breeze-move-to-footer-js'],
|
225 |
+
'defer_js' => $minify['breeze-defer-js'],
|
226 |
),
|
227 |
);
|
228 |
|
229 |
$content = apply_filters( 'breeze_filter_html_before_minify', $content );
|
230 |
|
231 |
+
if (
|
232 |
+
! empty( $conf ) &&
|
233 |
+
$conf['breeze-disable-admin'] &&
|
234 |
+
(
|
235 |
+
current_user_can( 'administrator' ) ||
|
236 |
+
current_user_can( 'editor' ) ||
|
237 |
+
current_user_can( 'author' ) ||
|
238 |
+
current_user_can( 'contributor' )
|
239 |
+
)
|
240 |
+
) {
|
241 |
$content = apply_filters( 'breeze_html_after_minify', $content );
|
242 |
|
243 |
} else {
|
278 |
return $content;
|
279 |
}
|
280 |
|
281 |
+
/*
|
282 |
+
* Remove '/' chacracter of end url
|
283 |
+
*/
|
284 |
+
public function rtrim_urls( $url ) {
|
285 |
+
return rtrim( $url, '/' );
|
286 |
+
}
|
287 |
+
|
288 |
/*
|
289 |
* check url from Never cache the following pages area
|
290 |
*/
|
291 |
public function check_exclude_url( $current_url ) {
|
292 |
$opts_config = breeze_get_option( 'advanced_settings' );
|
293 |
|
294 |
+
$config_options = $this->read_the_config_file();
|
295 |
+
if ( ! empty( $config_options ) ) {
|
296 |
+
$opts_config['breeze-exclude-urls'] = array_merge( $opts_config['breeze-exclude-urls'], $config_options );
|
297 |
+
$urls = array_unique( $opts_config['breeze-exclude-urls'] );
|
298 |
+
$opts_config['breeze-exclude-urls'] = array_map( array( $this, 'rtrim_urls' ), $urls );
|
299 |
+
|
300 |
+
}
|
301 |
+
|
302 |
$is_exclude = breeze_check_for_exclude_values( $current_url, $opts_config['breeze-exclude-urls'] );
|
303 |
if ( ! empty( $is_exclude ) ) {
|
304 |
return true;
|
325 |
}
|
326 |
|
327 |
} else {
|
328 |
+
|
329 |
+
$v = rtrim( $v, '/' );
|
330 |
+
$current_url = rtrim( $current_url, '/' );
|
331 |
+
$v = ltrim( $v, 'https:' );
|
332 |
+
$current_url = ltrim( $current_url, 'https:' );
|
333 |
+
|
334 |
// Whole path
|
335 |
if ( $v == $current_url ) {
|
336 |
return true;
|
337 |
+
} else {
|
338 |
+
$v = $str = strtok( $v, '?' );
|
339 |
+
$current_url = $str = strtok( $current_url, '?' );
|
340 |
+
$v = rtrim( $v, '/' );
|
341 |
+
$current_url = rtrim( $current_url, '/' );
|
342 |
+
|
343 |
+
if ( $v == $current_url ) {
|
344 |
+
return true;
|
345 |
+
}
|
346 |
}
|
347 |
}
|
348 |
}
|
351 |
return false;
|
352 |
|
353 |
}
|
354 |
+
|
355 |
+
/*
|
356 |
+
* Will Return the options for the current website
|
357 |
+
*
|
358 |
+
* @since 1.1.8
|
359 |
+
* @access public
|
360 |
+
*/
|
361 |
+
public function read_the_config_file() {
|
362 |
+
$config_dir = trailingslashit( WP_CONTENT_DIR ) . 'breeze-config';
|
363 |
+
$filename = 'breeze-config';
|
364 |
+
if ( is_multisite() && ! is_network_admin() ) {
|
365 |
+
$filename .= '-' . get_current_blog_id();
|
366 |
+
}
|
367 |
+
|
368 |
+
$config_file = $config_dir . DIRECTORY_SEPARATOR . $filename . '.php';
|
369 |
+
|
370 |
+
if ( file_exists( $config_file ) ) {
|
371 |
+
$config = include $config_file;
|
372 |
+
if ( empty( $config ) || ! isset( $config['exclude_url'] ) || empty( $config['exclude_url'] ) ) {
|
373 |
+
return false;
|
374 |
+
}
|
375 |
+
|
376 |
+
return $config['exclude_url'];
|
377 |
+
} else {
|
378 |
+
return false;
|
379 |
+
}
|
380 |
+
|
381 |
+
}
|
382 |
}
|
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: 5.
|
6 |
-
Stable tag: 1.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -145,6 +145,12 @@ Using Gzip, Breeze compresses the request files, further reducing the size of th
|
|
145 |
|
146 |
== Changelog ==
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
= 1.1.8 =
|
149 |
* Fix: Cache refresh issue when Varnish is disabled.
|
150 |
* Fix: Replaced functions deprecated in WordPress 5.5 that were causing warning messages.
|
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: 5.7
|
6 |
+
Stable tag: 1.1.9
|
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.9 =
|
149 |
+
|
150 |
+
Add: Improved handling of minification for Query stirng based exclusion in Never Cache These URLs option.
|
151 |
+
Add: Increase compatibility with Multilingual .
|
152 |
+
|
153 |
+
|
154 |
= 1.1.8 =
|
155 |
* Fix: Cache refresh issue when Varnish is disabled.
|
156 |
* Fix: Replaced functions deprecated in WordPress 5.5 that were causing warning messages.
|