Version Description
- Update default query string exclusion (#155)
- Update cache engine start check (#155)
Download this release
Release Info
| Developer | keycdn |
| Plugin | |
| Version | 1.5.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.5.3 to 1.5.4
- cache-enabler.php +2 -2
- inc/cache_enabler.class.php +1 -1
- inc/cache_enabler_engine.class.php +11 -6
- readme.txt +5 -0
cache-enabler.php
CHANGED
|
@@ -6,7 +6,7 @@ Description: Simple and fast WordPress caching plugin.
|
|
| 6 |
Author: KeyCDN
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
License: GPLv2 or later
|
| 9 |
-
Version: 1.5.
|
| 10 |
*/
|
| 11 |
|
| 12 |
/*
|
|
@@ -32,7 +32,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 32 |
}
|
| 33 |
|
| 34 |
// constants
|
| 35 |
-
define( 'CE_VERSION', '1.5.
|
| 36 |
define( 'CE_MIN_WP', '5.1' );
|
| 37 |
define( 'CE_FILE', __FILE__ );
|
| 38 |
define( 'CE_BASE', plugin_basename( __FILE__ ) );
|
| 6 |
Author: KeyCDN
|
| 7 |
Author URI: https://www.keycdn.com
|
| 8 |
License: GPLv2 or later
|
| 9 |
+
Version: 1.5.4
|
| 10 |
*/
|
| 11 |
|
| 12 |
/*
|
| 32 |
}
|
| 33 |
|
| 34 |
// constants
|
| 35 |
+
define( 'CE_VERSION', '1.5.4' );
|
| 36 |
define( 'CE_MIN_WP', '5.1' );
|
| 37 |
define( 'CE_FILE', __FILE__ );
|
| 38 |
define( 'CE_BASE', plugin_basename( __FILE__ ) );
|
inc/cache_enabler.class.php
CHANGED
|
@@ -1792,7 +1792,7 @@ final class Cache_Enabler {
|
|
| 1792 |
<input name="cache_enabler[excluded_query_strings]" type="text" id="excluded_query_strings" value="<?php echo esc_attr( Cache_Enabler_Engine::$settings['excluded_query_strings'] ) ?>" class="regular-text code" />
|
| 1793 |
<p class="description"><?php esc_html_e( 'A regex matching query strings that should bypass the cache.', 'cache-enabler' ); ?></p>
|
| 1794 |
<p><?php esc_html_e( 'Example:', 'cache-enabler' ); ?> <code class="code--form-control">/^nocache$/</code></p>
|
| 1795 |
-
<p><?php esc_html_e( 'Default if unset:', 'cache-enabler' ); ?> <code class="code--form-control">/^(?!(fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|
|
| 1796 |
</label>
|
| 1797 |
|
| 1798 |
<br />
|
| 1792 |
<input name="cache_enabler[excluded_query_strings]" type="text" id="excluded_query_strings" value="<?php echo esc_attr( Cache_Enabler_Engine::$settings['excluded_query_strings'] ) ?>" class="regular-text code" />
|
| 1793 |
<p class="description"><?php esc_html_e( 'A regex matching query strings that should bypass the cache.', 'cache-enabler' ); ?></p>
|
| 1794 |
<p><?php esc_html_e( 'Example:', 'cache-enabler' ); ?> <code class="code--form-control">/^nocache$/</code></p>
|
| 1795 |
+
<p><?php esc_html_e( 'Default if unset:', 'cache-enabler' ); ?> <code class="code--form-control">/^(?!(fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|usqp|cn-reloaded|_ga|_ke)).+$/</code></p>
|
| 1796 |
</label>
|
| 1797 |
|
| 1798 |
<br />
|
inc/cache_enabler_engine.class.php
CHANGED
|
@@ -58,10 +58,10 @@ final class Cache_Enabler_Engine {
|
|
| 58 |
|
| 59 |
public function __construct() {
|
| 60 |
|
| 61 |
-
// get settings from disk if cache exists
|
| 62 |
if ( Cache_Enabler_Disk::cache_exists() ) {
|
| 63 |
self::$settings = Cache_Enabler_Disk::get_settings();
|
| 64 |
-
// get settings from database otherwise
|
| 65 |
} elseif ( class_exists( 'Cache_Enabler' ) ) {
|
| 66 |
self::$settings = Cache_Enabler::get_settings();
|
| 67 |
// set deprecated settings
|
|
@@ -80,7 +80,7 @@ final class Cache_Enabler_Engine {
|
|
| 80 |
* check if engine should start
|
| 81 |
*
|
| 82 |
* @since 1.5.2
|
| 83 |
-
* @change 1.5.
|
| 84 |
*
|
| 85 |
* @return boolean true if engine should start, false otherwise
|
| 86 |
*/
|
|
@@ -92,8 +92,8 @@ final class Cache_Enabler_Engine {
|
|
| 92 |
return false;
|
| 93 |
}
|
| 94 |
|
| 95 |
-
// check if Ajax request
|
| 96 |
-
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
| 97 |
return false;
|
| 98 |
}
|
| 99 |
|
|
@@ -112,6 +112,11 @@ final class Cache_Enabler_Engine {
|
|
| 112 |
return false;
|
| 113 |
}
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
return true;
|
| 116 |
}
|
| 117 |
|
|
@@ -289,7 +294,7 @@ final class Cache_Enabler_Engine {
|
|
| 289 |
if ( ! empty( self::$settings['excluded_query_strings'] ) ) {
|
| 290 |
$query_string_regex = self::$settings['excluded_query_strings'];
|
| 291 |
} else {
|
| 292 |
-
$query_string_regex = '/^(?!(fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|
|
| 293 |
}
|
| 294 |
|
| 295 |
$query_string = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY );
|
| 58 |
|
| 59 |
public function __construct() {
|
| 60 |
|
| 61 |
+
// get settings from disk in early start if cache exists
|
| 62 |
if ( Cache_Enabler_Disk::cache_exists() ) {
|
| 63 |
self::$settings = Cache_Enabler_Disk::get_settings();
|
| 64 |
+
// get settings from database in late start otherwise
|
| 65 |
} elseif ( class_exists( 'Cache_Enabler' ) ) {
|
| 66 |
self::$settings = Cache_Enabler::get_settings();
|
| 67 |
// set deprecated settings
|
| 80 |
* check if engine should start
|
| 81 |
*
|
| 82 |
* @since 1.5.2
|
| 83 |
+
* @change 1.5.4
|
| 84 |
*
|
| 85 |
* @return boolean true if engine should start, false otherwise
|
| 86 |
*/
|
| 92 |
return false;
|
| 93 |
}
|
| 94 |
|
| 95 |
+
// check if Ajax request in early start
|
| 96 |
+
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && ! class_exists( 'Cache_Enabler' ) ) {
|
| 97 |
return false;
|
| 98 |
}
|
| 99 |
|
| 112 |
return false;
|
| 113 |
}
|
| 114 |
|
| 115 |
+
// check request URI
|
| 116 |
+
if ( str_replace( array( '.ico', '.txt', '.xml', '.xsl' ), '', $_SERVER['REQUEST_URI'] ) !== $_SERVER['REQUEST_URI'] ) {
|
| 117 |
+
return false;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
return true;
|
| 121 |
}
|
| 122 |
|
| 294 |
if ( ! empty( self::$settings['excluded_query_strings'] ) ) {
|
| 295 |
$query_string_regex = self::$settings['excluded_query_strings'];
|
| 296 |
} else {
|
| 297 |
+
$query_string_regex = '/^(?!(fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|usqp|cn-reloaded|_ga|_ke)).+$/';
|
| 298 |
}
|
| 299 |
|
| 300 |
$query_string = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY );
|
readme.txt
CHANGED
|
@@ -80,6 +80,11 @@ When combined with Optimus, the WordPress Cache Enabler allows you to easily del
|
|
| 80 |
|
| 81 |
== Changelog ==
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
= 1.5.3 =
|
| 84 |
|
| 85 |
* Add default query string exclusion (#154)
|
| 80 |
|
| 81 |
== Changelog ==
|
| 82 |
|
| 83 |
+
= 1.5.4 =
|
| 84 |
+
|
| 85 |
+
* Update default query string exclusion (#155)
|
| 86 |
+
* Update cache engine start check (#155)
|
| 87 |
+
|
| 88 |
= 1.5.3 =
|
| 89 |
|
| 90 |
* Add default query string exclusion (#154)
|
