Version Description
- Fix : Compatibility issues of WooCommerce
Download this release
Release Info
Developer | adeelkhan |
Plugin | Breeze – WordPress Cache Plugin |
Version | 1.0.2-beta |
Comparing to | |
See all releases |
Code changes from version 1.0.1-beta to 1.0.2-beta
- breeze.php +6 -4
- inc/cache/config-cache.php +6 -3
- inc/cache/ecommerce-cache.php +214 -0
- inc/cache/execute-cache.php +40 -42
- inc/minification/breeze-minify-main.php +31 -41
- readme.txt +8 -5
breeze.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Breeze
|
4 |
* Description: Breeze is a WordPress cache plugin with extensive options to speed up your website. All the options including Varnish Cache are compatible with Cloudways hosting.
|
5 |
-
* Version: 1.0.
|
6 |
* Text Domain: breeze
|
7 |
* Domain Path: /languages
|
8 |
* Author: Cloudways
|
@@ -68,6 +68,10 @@ if(is_admin()){
|
|
68 |
require_once(BREEZE_PLUGIN_DIR . 'inc/breeze-configuration.php');
|
69 |
//config to cache
|
70 |
require_once(BREEZE_PLUGIN_DIR . 'inc/cache/config-cache.php');
|
|
|
|
|
|
|
|
|
71 |
}else{
|
72 |
$cdn_conf = get_option('breeze_cdn_integration');
|
73 |
$basic_conf = get_option('breeze_basic_settings');
|
@@ -101,6 +105,4 @@ if( !class_exists('Breeze_CDN_Integration')){
|
|
101 |
require_once ( BREEZE_PLUGIN_DIR. 'inc/cdn-integration/breeze-cdn-integration.php');
|
102 |
require_once ( BREEZE_PLUGIN_DIR. 'inc/cdn-integration/breeze-cdn-rewrite.php');
|
103 |
new Breeze_CDN_Integration();
|
104 |
-
}
|
105 |
-
|
106 |
-
|
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
|
68 |
require_once(BREEZE_PLUGIN_DIR . 'inc/breeze-configuration.php');
|
69 |
//config to cache
|
70 |
require_once(BREEZE_PLUGIN_DIR . 'inc/cache/config-cache.php');
|
71 |
+
|
72 |
+
//cache when ecommerce installed
|
73 |
+
require_once( BREEZE_PLUGIN_DIR . 'inc/cache/ecommerce-cache.php');
|
74 |
+
new Breeze_Ecommerce_Cache();
|
75 |
}else{
|
76 |
$cdn_conf = get_option('breeze_cdn_integration');
|
77 |
$basic_conf = get_option('breeze_basic_settings');
|
105 |
require_once ( BREEZE_PLUGIN_DIR. 'inc/cdn-integration/breeze-cdn-integration.php');
|
106 |
require_once ( BREEZE_PLUGIN_DIR. 'inc/cdn-integration/breeze-cdn-rewrite.php');
|
107 |
new Breeze_CDN_Integration();
|
108 |
+
}
|
|
|
|
inc/cache/config-cache.php
CHANGED
@@ -63,6 +63,7 @@ class Breeze_ConfigCache {
|
|
63 |
public static function write_config_cache(){
|
64 |
$settings = get_option('breeze_basic_settings');
|
65 |
$config = get_option('breeze_advanced_settings');
|
|
|
66 |
|
67 |
$storage = array(
|
68 |
'homepage' => get_site_url(),
|
@@ -71,12 +72,14 @@ class Breeze_ConfigCache {
|
|
71 |
'exclude_url' => array(),
|
72 |
);
|
73 |
|
|
|
|
|
|
|
74 |
if(!empty($settings['breeze-disable-admin'])){
|
75 |
$storage['disable_per_adminuser'] = $settings['breeze-disable-admin'];
|
76 |
}
|
77 |
-
|
78 |
-
|
79 |
-
}
|
80 |
|
81 |
if(! self::write_config($storage)){
|
82 |
return false;
|
63 |
public static function write_config_cache(){
|
64 |
$settings = get_option('breeze_basic_settings');
|
65 |
$config = get_option('breeze_advanced_settings');
|
66 |
+
$ecommerce_exclude_urls = array();
|
67 |
|
68 |
$storage = array(
|
69 |
'homepage' => get_site_url(),
|
72 |
'exclude_url' => array(),
|
73 |
);
|
74 |
|
75 |
+
if( class_exists('WooCommerce')){
|
76 |
+
$ecommerce_exclude_urls = Breeze_Ecommerce_Cache::factory()->ecommerce_exclude_pages();
|
77 |
+
}
|
78 |
if(!empty($settings['breeze-disable-admin'])){
|
79 |
$storage['disable_per_adminuser'] = $settings['breeze-disable-admin'];
|
80 |
}
|
81 |
+
|
82 |
+
$storage['exclude_url'] = array_merge($ecommerce_exclude_urls, $config['breeze-exclude-urls']);
|
|
|
83 |
|
84 |
if(! self::write_config($storage)){
|
85 |
return false;
|
inc/cache/ecommerce-cache.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) or die('Not allow!');
|
3 |
+
|
4 |
+
/*
|
5 |
+
* Class for E-commerce Cache
|
6 |
+
*/
|
7 |
+
class Breeze_Ecommerce_Cache {
|
8 |
+
public function __construct() {
|
9 |
+
add_action( 'activated_plugin', array($this,'detect_ecommerce_activation') );
|
10 |
+
add_action( 'deactivated_plugin', array($this,'detect_ecommerce_deactivation') );
|
11 |
+
add_action( 'wp_loaded', array($this,'update_ecommerce_activation') );
|
12 |
+
}
|
13 |
+
|
14 |
+
// After woocommerce active,merge array disable page config
|
15 |
+
public function detect_ecommerce_activation($plugin){
|
16 |
+
if( 'woocommerce/woocommerce.php' == $plugin){
|
17 |
+
update_option('breeze_ecommerce_detect',1);
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
// Delete option detect when deactivate woo
|
22 |
+
public function detect_ecommerce_deactivation($plugin){
|
23 |
+
if( 'woocommerce/woocommerce.php' == $plugin){
|
24 |
+
delete_option('breeze_ecommerce_detect');
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
// Update option when Woocimmerce active
|
29 |
+
public function update_ecommerce_activation() {
|
30 |
+
$check = get_option('breeze_ecommerce_detect');
|
31 |
+
if( stripos($_SERVER['REQUEST_URI'],'wc-setup&step=locale') !== false){
|
32 |
+
global $wp_filesystem;
|
33 |
+
if ( empty( $wp_filesystem ) ) {
|
34 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
35 |
+
WP_Filesystem();
|
36 |
+
}
|
37 |
+
Breeze_ConfigCache::write_config_cache();
|
38 |
+
}
|
39 |
+
if (!empty($check) && $check == 1) {
|
40 |
+
global $wp_filesystem;
|
41 |
+
if ( empty( $wp_filesystem ) ) {
|
42 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
43 |
+
WP_Filesystem();
|
44 |
+
}
|
45 |
+
Breeze_ConfigCache::write_config_cache();
|
46 |
+
update_option('breeze_ecommerce_detect', 0);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
// Exclude pages of Ecommerce from cache
|
51 |
+
public function ecommerce_exclude_pages() {
|
52 |
+
$urls = array();
|
53 |
+
|
54 |
+
// WooCommerce
|
55 |
+
if ( function_exists( 'WC' ) && function_exists( 'wc_get_page_id' ) ) {
|
56 |
+
if( wc_get_page_id( 'checkout' ) && wc_get_page_id( 'checkout' ) != '-1' ) {
|
57 |
+
$checkout_urls = $this->breeze_translated_post_urls( wc_get_page_id( 'checkout' ), 'page', '(.*)' );
|
58 |
+
$urls = array_merge( $urls, $checkout_urls );
|
59 |
+
}
|
60 |
+
if ( wc_get_page_id( 'cart' ) && wc_get_page_id( 'cart' ) != '-1' ) {
|
61 |
+
$cart_urls = $this->breeze_translated_post_urls( wc_get_page_id( 'cart' ) );
|
62 |
+
$urls = array_merge( $urls, $cart_urls );
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( wc_get_page_id( 'myaccount' ) && wc_get_page_id( 'myaccount' ) != '-1' ) {
|
66 |
+
$cart_urls = $this->breeze_translated_post_urls( wc_get_page_id( 'myaccount' ), 'page', '(.*)' );
|
67 |
+
$urls = array_merge( $urls, $cart_urls );
|
68 |
+
}
|
69 |
+
}
|
70 |
+
return $urls;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Check whether the plugin is active by checking the active_plugins list.
|
75 |
+
*/
|
76 |
+
public static function breeze_is_plugin_active( $plugin ) {
|
77 |
+
return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || self::breeze_is_plugin_active_for_network( $plugin );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Check whether the plugin is active for the entire network.
|
82 |
+
*/
|
83 |
+
public static function breeze_is_plugin_active_for_network( $plugin ) {
|
84 |
+
if ( !is_multisite() ) {
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
|
88 |
+
$plugins = get_site_option( 'active_sitewide_plugins');
|
89 |
+
if ( isset($plugins[$plugin]) ) {
|
90 |
+
return true;
|
91 |
+
}
|
92 |
+
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Get all translated path of a specific post with ID.
|
98 |
+
*
|
99 |
+
* @param int $post_id Post ID
|
100 |
+
* @param string $post_type Post Type
|
101 |
+
* @param string $regex Regex to include at the end
|
102 |
+
* @return array $urls
|
103 |
+
*/
|
104 |
+
public function breeze_translated_post_urls( $post_id, $post_type = 'page', $regex = null ) {
|
105 |
+
$urls = array();
|
106 |
+
$permark_link = get_option('permalink_structure');
|
107 |
+
if(empty($permark_link)){
|
108 |
+
if(!empty($regex)){
|
109 |
+
$urls[]= get_permalink( $post_id ).'&'. $regex;
|
110 |
+
}else{
|
111 |
+
$urls[]= get_permalink( $post_id );
|
112 |
+
}
|
113 |
+
return $urls;
|
114 |
+
}
|
115 |
+
$path = parse_url( get_permalink( $post_id ), PHP_URL_PATH );
|
116 |
+
$langs = $this->get_all_languages();
|
117 |
+
if ( empty( $path ) ) {
|
118 |
+
return $urls;
|
119 |
+
}
|
120 |
+
|
121 |
+
// WPML
|
122 |
+
if ( self::breeze_is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
|
123 |
+
foreach( $langs as $lang ) {
|
124 |
+
$urls[] = parse_url( get_permalink( icl_object_id( $post_id, $post_type, true, $lang ) ), PHP_URL_PATH ) . $regex;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
// qTranslate & qTranslate-x
|
129 |
+
if ( self::breeze_is_plugin_active( 'qtranslate/qtranslate.php' ) || self::breeze_is_plugin_active( 'qtranslate-x/qtranslate.php' ) ) {
|
130 |
+
$langs = $GLOBALS['q_config']['enabled_languages'];
|
131 |
+
$langs = array_diff( $langs, array( $GLOBALS['q_config']['default_language'] ) );
|
132 |
+
$url = get_permalink( $post_id );
|
133 |
+
$urls[] = parse_url( get_permalink( $post_id ), PHP_URL_PATH ) . $regex;
|
134 |
+
|
135 |
+
foreach( $langs as $lang ) {
|
136 |
+
if ( self::breeze_is_plugin_active( 'qtranslate/qtranslate.php' ) ) {
|
137 |
+
$urls[] = parse_url( qtrans_convertURL( $url, $lang, true ), PHP_URL_PATH ) . $regex;
|
138 |
+
} else if ( self::breeze_is_plugin_active( 'qtranslate/qtranslate.php' ) ) {
|
139 |
+
$urls[] = parse_url( qtranxf_convertURL( $url, $lang, true ), PHP_URL_PATH ) . $regex;
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
// Polylang
|
145 |
+
if ( self::breeze_is_plugin_active( 'polylang/polylang.php' ) || self::breeze_is_plugin_active( 'polylang-pro/polylang.php' ) ) {
|
146 |
+
if ( function_exists( 'PLL' ) && is_object( PLL()->model ) ) {
|
147 |
+
$translations = pll_get_post_translations( $post_id );
|
148 |
+
} else if ( is_object( $GLOBALS['polylang']->model ) ) {
|
149 |
+
$translations = $GLOBALS['polylang']->model->get_translations( 'page', $post_id );
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( ! empty( $translations ) ) {
|
153 |
+
foreach ( $translations as $post_id ) {
|
154 |
+
$urls[] = parse_url( get_permalink( $post_id ), PHP_URL_PATH ) . $regex;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( trim( $path, '/' ) != '' ) {
|
160 |
+
$urls[] = $path . $regex;
|
161 |
+
}
|
162 |
+
$urls = array_unique( $urls );
|
163 |
+
|
164 |
+
return $urls;
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Check if a translation plugin is activated
|
169 |
+
*
|
170 |
+
* @return bool True if a plugin is activated
|
171 |
+
*/
|
172 |
+
public static function check_trans_plugin() {
|
173 |
+
if ( self::breeze_is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) // WPML
|
174 |
+
|| self::breeze_is_plugin_active( 'qtranslate/qtranslate.php' ) // qTranslate
|
175 |
+
|| self::breeze_is_plugin_active( 'qtranslate-x/qtranslate.php' ) // qTranslate-x
|
176 |
+
|| self::breeze_is_plugin_active( 'polylang/polylang.php' ) // Polylang
|
177 |
+
|| self::breeze_is_plugin_active( 'polylang-pro/polylang.php' ) ) { // Polylang Pro
|
178 |
+
return true;
|
179 |
+
}
|
180 |
+
|
181 |
+
return false;
|
182 |
+
}
|
183 |
+
/**
|
184 |
+
* Get info of all active languages
|
185 |
+
*
|
186 |
+
* @return array List of language code
|
187 |
+
*/
|
188 |
+
public static function get_all_languages() {
|
189 |
+
if( ! self::check_trans_plugin() ) {
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
|
193 |
+
if ( self::breeze_is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
|
194 |
+
return array_keys( $GLOBALS['sitepress']->get_active_languages() );
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( self::breeze_is_plugin_active( 'qtranslate/qtranslate.php' ) || self::breeze_is_plugin_active( 'qtranslate-x/qtranslate.php' ) ) {
|
198 |
+
return $GLOBALS['q_config']['enabled_languages'];
|
199 |
+
}
|
200 |
+
|
201 |
+
if ( self::breeze_is_plugin_active( 'polylang/polylang.php' ) || self::breeze_is_plugin_active( 'polylang-pro/polylang.php' ) ) {
|
202 |
+
return pll_languages_list();
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
public static function factory() {
|
207 |
+
static $instance;
|
208 |
+
|
209 |
+
if ( ! $instance ) {
|
210 |
+
$instance = new self();
|
211 |
+
}
|
212 |
+
return $instance;
|
213 |
+
}
|
214 |
+
}
|
inc/cache/execute-cache.php
CHANGED
@@ -64,51 +64,11 @@ if (!empty($_COOKIE)) {
|
|
64 |
$domain = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
|
65 |
//decode url with russian language
|
66 |
$current_url = $domain . rawurldecode($_SERVER['REQUEST_URI']);
|
67 |
-
$check_url = array();
|
68 |
$opts_config = $GLOBALS['breeze_config'];
|
69 |
-
|
70 |
-
foreach ($opts_config['exclude_url'] as $v) {
|
71 |
-
if ($v && $v[0] == '/') {
|
72 |
-
//part url
|
73 |
-
if (preg_match('[\*]', $v) == 1) {
|
74 |
-
$v = substr($v, 0, strpos($v, "/(.*)"));
|
75 |
-
|
76 |
-
if (!empty($v)) {
|
77 |
-
if (strpos($current_url, $v) != false) {
|
78 |
-
$check_url[] = $current_url;
|
79 |
-
}
|
80 |
-
}
|
81 |
|
82 |
-
} else {
|
83 |
-
if (!empty($v)) {
|
84 |
-
if (strpos($current_url, $v) != false) {
|
85 |
-
$url = $current_url;
|
86 |
-
} else {
|
87 |
-
$homepage = $opts_config['homepage'];
|
88 |
-
$url = $homepage . $v;
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
$check_url[] = $url;
|
93 |
-
}
|
94 |
-
} else {
|
95 |
-
if (preg_match('[\*]', $v) == 1) {
|
96 |
-
$v = substr($v, 0, strpos($v, "&(.*)"));
|
97 |
-
$v = substr($v, -10);
|
98 |
-
if (!empty($v)) {
|
99 |
-
if (strpos($current_url, $v) != false) {
|
100 |
-
$check_url[] = $current_url;
|
101 |
-
}
|
102 |
-
}
|
103 |
-
} else {
|
104 |
-
//full url
|
105 |
-
$check_url[] = trim($v);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
//load cache
|
111 |
-
if (
|
112 |
$devices = $opts_config['cache_options'];
|
113 |
$X1 = '';
|
114 |
// Detect devices
|
@@ -375,3 +335,41 @@ function breeze_serve_cache($filename, $url_path, $X1,$opts)
|
|
375 |
}
|
376 |
}
|
377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
$domain = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
|
65 |
//decode url with russian language
|
66 |
$current_url = $domain . rawurldecode($_SERVER['REQUEST_URI']);
|
|
|
67 |
$opts_config = $GLOBALS['breeze_config'];
|
68 |
+
$check_exclude = check_exclude_page($opts_config, $current_url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
//load cache
|
71 |
+
if (!$check_exclude) {
|
72 |
$devices = $opts_config['cache_options'];
|
73 |
$X1 = '';
|
74 |
// Detect devices
|
335 |
}
|
336 |
}
|
337 |
|
338 |
+
function check_exclude_page($opts_config,$current_url){
|
339 |
+
//check disable cache for page
|
340 |
+
if (!empty($opts_config['exclude_url'])) {
|
341 |
+
foreach ($opts_config['exclude_url'] as $v) {
|
342 |
+
// Clear blank character
|
343 |
+
$v = trim($v);
|
344 |
+
if( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $v , $matches)){
|
345 |
+
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
346 |
+
$pattent = substr($v , 0, strpos($v,$matches[0]));
|
347 |
+
if($v[0] == '/'){
|
348 |
+
// A path of exclude url with regex
|
349 |
+
if((@preg_match( '@'.$pattent.'@', $current_url, $matches ) > 0)){
|
350 |
+
return true;
|
351 |
+
}
|
352 |
+
}else{
|
353 |
+
// Full exclude url with regex
|
354 |
+
if(strpos( $current_url,$pattent) !== false){
|
355 |
+
return true;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
}else{
|
360 |
+
if($v[0] == '/'){
|
361 |
+
// A path of exclude
|
362 |
+
if((@preg_match( '@'.$v.'@', $current_url, $matches ) > 0)){
|
363 |
+
return true;
|
364 |
+
}
|
365 |
+
} else { // Whole path
|
366 |
+
if($v == $current_url){
|
367 |
+
return true;
|
368 |
+
}
|
369 |
+
}
|
370 |
+
}
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
return false;
|
375 |
+
}
|
inc/minification/breeze-minify-main.php
CHANGED
@@ -31,7 +31,7 @@ class Breeze_Minify {
|
|
31 |
$check_url = $this->check_exclude_url($current_url);
|
32 |
|
33 |
//load config file when redirect template
|
34 |
-
if (
|
35 |
//cache html
|
36 |
//cache minification
|
37 |
if (Breeze_MinificationCache::create_cache_minification_folder()) {
|
@@ -209,47 +209,37 @@ class Breeze_Minify {
|
|
209 |
* check url from Never cache the following pages area
|
210 |
*/
|
211 |
public function check_exclude_url($current_url){
|
212 |
-
|
213 |
-
$check_url = array();
|
214 |
$opts_config = get_option('breeze_advanced_settings');
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
}else{
|
246 |
-
//full url
|
247 |
-
$check_url[] = $v;
|
248 |
-
}
|
249 |
-
}
|
250 |
-
}
|
251 |
-
}
|
252 |
|
253 |
-
return $check_url;
|
254 |
}
|
255 |
}
|
31 |
$check_url = $this->check_exclude_url($current_url);
|
32 |
|
33 |
//load config file when redirect template
|
34 |
+
if (!$check_url) {
|
35 |
//cache html
|
36 |
//cache minification
|
37 |
if (Breeze_MinificationCache::create_cache_minification_folder()) {
|
209 |
* check url from Never cache the following pages area
|
210 |
*/
|
211 |
public function check_exclude_url($current_url){
|
|
|
|
|
212 |
$opts_config = get_option('breeze_advanced_settings');
|
213 |
+
//check disable cache for page
|
214 |
+
if (!empty($opts_config['breeze-exclude-urls'])) {
|
215 |
+
foreach ($opts_config['breeze-exclude-urls'] as $v) {
|
216 |
+
// Clear blank character
|
217 |
+
$v = trim($v);
|
218 |
+
if( preg_match( '/(\&?\/?\(\.?\*\)|\/\*|\*)$/', $v , $matches)){
|
219 |
+
// End of rules is *, /*, [&][/](*) , [&][/](.*)
|
220 |
+
$pattent = substr($v , 0, strpos($v,$matches[0]));
|
221 |
+
if($v[0] == '/'){
|
222 |
+
// A path of exclude url with regex
|
223 |
+
if((@preg_match( '@'.$pattent.'@', $current_url, $matches ) > 0)){
|
224 |
+
return true;
|
225 |
+
}
|
226 |
+
}else{
|
227 |
+
// Full exclude url with regex
|
228 |
+
if(strpos( $current_url,$pattent) !== false){
|
229 |
+
return true;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
}else{
|
234 |
+
// Whole path
|
235 |
+
if($v == $current_url){
|
236 |
+
return true;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
|
|
|
244 |
}
|
245 |
}
|
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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -13,8 +13,6 @@ Breeze is a WordPress Caching Plugin developed by Cloudways. Breeze uses advance
|
|
13 |
|
14 |
Breeze is a free, simple (yet powerful) and user-friendly WordPress Caching Plugin developed by the Cloudways team. It offers various options to optimize WordPress performance at various levels. It works equally great with WordPress, WordPress with WooCommerce and WordPress Multisite.
|
15 |
|
16 |
-
**Breeze is in beta phase, therefore we recommend testing it on a Staging website before deploying on a live website.**
|
17 |
-
|
18 |
Breeze excels in the following areas:
|
19 |
|
20 |
* **Performance:** Breeze improves website speed and resource optimization. Other features include file level cache system, database cleanup, minification, support for Varnish cache and simplified CDN integration options.
|
@@ -27,6 +25,8 @@ What makes Breeze WordPress Cache Plugin awesome is that it comes with builtin s
|
|
27 |
|
28 |
**Support:** We love to provide support! Post your questions on the WordPress.org support forums, or if you are a Cloudways Customer you may ask questions on the <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
|
29 |
|
|
|
|
|
30 |
**Special Thanks:** We would like to give special mention to WP Speed Of Light for being an inspiration for Breeze.
|
31 |
|
32 |
== Installation ==
|
@@ -116,9 +116,12 @@ You can get your questions answered on the WordPress support forums. If you are
|
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
119 |
= 1.0.1-beta =
|
120 |
-
* Fix : Purging issue to allow only admin users to Purge
|
121 |
-
* Add :
|
122 |
|
123 |
= 1.0.0 =
|
124 |
* Add : First Beta release
|
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 |
|
13 |
|
14 |
Breeze is a free, simple (yet powerful) and user-friendly WordPress Caching Plugin developed by the Cloudways team. It offers various options to optimize WordPress performance at various levels. It works equally great with WordPress, WordPress with WooCommerce and WordPress Multisite.
|
15 |
|
|
|
|
|
16 |
Breeze excels in the following areas:
|
17 |
|
18 |
* **Performance:** Breeze improves website speed and resource optimization. Other features include file level cache system, database cleanup, minification, support for Varnish cache and simplified CDN integration options.
|
25 |
|
26 |
**Support:** We love to provide support! Post your questions on the WordPress.org support forums, or if you are a Cloudways Customer you may ask questions on the <a href="https://community.cloudways.com/">Cloudways Community Forum</a>.
|
27 |
|
28 |
+
**Note:** This plugin is still in Beta phase and this plugin is tested on Cloudways WordPress hosting servers.
|
29 |
+
|
30 |
**Special Thanks:** We would like to give special mention to WP Speed Of Light for being an inspiration for Breeze.
|
31 |
|
32 |
== Installation ==
|
116 |
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 1.0.2-beta =
|
120 |
+
* Fix : Compatibility issues of WooCommerce
|
121 |
+
|
122 |
= 1.0.1-beta =
|
123 |
+
* Fix : Purging issue to allow only admin users to Purge
|
124 |
+
* Add : Feedback link
|
125 |
|
126 |
= 1.0.0 =
|
127 |
* Add : First Beta release
|