Redis Object Cache - Version 2.0.19

Version Description

  • Make metric identifier unique
  • Set unique prefix for sites hosted on Cloudways
  • Don't print HTML debug comment when WP_CLI is true
Download this release

Release Info

Developer tillkruess
Plugin Icon 128x128 Redis Object Cache
Version 2.0.19
Comparing to
See all releases

Code changes from version 2.0.18 to 2.0.19

includes/class-metrics.php CHANGED
@@ -146,7 +146,7 @@ class Metrics {
146
 
147
  $info = $wp_object_cache->info();
148
 
149
- $this->id = substr( uniqid(), -7 );
150
  $this->hits = $info->hits;
151
  $this->misses = $info->misses;
152
  $this->ratio = $info->ratio;
146
 
147
  $info = $wp_object_cache->info();
148
 
149
+ $this->id = substr( md5( uniqid( strval( mt_rand() ), true ) ), 12 );
150
  $this->hits = $info->hits;
151
  $this->misses = $info->misses;
152
  $this->ratio = $info->ratio;
includes/class-plugin.php CHANGED
@@ -865,6 +865,7 @@ class Plugin {
865
  global $wp_object_cache;
866
 
867
  if (
 
868
  ( defined( 'DOING_CRON' ) && DOING_CRON ) ||
869
  ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ||
870
  ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
865
  global $wp_object_cache;
866
 
867
  if (
868
+ ( defined( 'WP_CLI' ) && WP_CLI ) ||
869
  ( defined( 'DOING_CRON' ) && DOING_CRON ) ||
870
  ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ||
871
  ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
includes/object-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Redis Object Cache Drop-In
4
  * Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  * Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication, clustering and WP-CLI.
6
- * Version: 2.0.18
7
  * Author: Till Krüss
8
  * Author URI: https://objectcache.pro
9
  * License: GPLv3
@@ -165,6 +165,11 @@ function wp_cache_init() {
165
  define( 'WP_REDIS_PREFIX', WP_CACHE_KEY_SALT );
166
  }
167
 
 
 
 
 
 
168
  if ( ! ( $wp_object_cache instanceof WP_Object_Cache ) ) {
169
  $fail_gracefully = ! defined( 'WP_REDIS_GRACEFUL' ) || WP_REDIS_GRACEFUL;
170
 
3
  * Plugin Name: Redis Object Cache Drop-In
4
  * Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  * Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication, clustering and WP-CLI.
6
+ * Version: 2.0.20-dev
7
  * Author: Till Krüss
8
  * Author URI: https://objectcache.pro
9
  * License: GPLv3
165
  define( 'WP_REDIS_PREFIX', WP_CACHE_KEY_SALT );
166
  }
167
 
168
+ // Set unique prefix for sites hosted on Cloudways
169
+ if ( ! defined( 'WP_REDIS_PREFIX' ) && isset( $_SERVER['cw_allowed_ip'] ) ) {
170
+ define( 'WP_REDIS_PREFIX', getenv( 'HTTP_X_APP_USER' ) );
171
+ }
172
+
173
  if ( ! ( $wp_object_cache instanceof WP_Object_Cache ) ) {
174
  $fail_gracefully = ! defined( 'WP_REDIS_GRACEFUL' ) || WP_REDIS_GRACEFUL;
175
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: redis, predis, phpredis, credis, hhvm, pecl, caching, cache, object cache,
5
  Requires at least: 3.3
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.18
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -83,6 +83,12 @@ To see a list of all available WP-CLI commands, please see the [WP CLI commands
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
86
  = 2.0.18 =
87
 
88
  - Added `redis_object_cache_trace` action and `WP_REDIS_TRACE` constant
5
  Requires at least: 3.3
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.19
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
83
 
84
  == Changelog ==
85
 
86
+ = 2.0.19 =
87
+
88
+ - Make metric identifier unique
89
+ - Set unique prefix for sites hosted on Cloudways
90
+ - Don't print HTML debug comment when `WP_CLI` is `true`
91
+
92
  = 2.0.18 =
93
 
94
  - Added `redis_object_cache_trace` action and `WP_REDIS_TRACE` constant
redis-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Redis Object Cache
4
  * Plugin URI: https://wordpress.org/plugins/redis-cache/
5
  * Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication, clustering and WP-CLI.
6
- * Version: 2.0.18
7
  * Text Domain: redis-cache
8
  * Domain Path: /languages
9
  * Network: true
3
  * Plugin Name: Redis Object Cache
4
  * Plugin URI: https://wordpress.org/plugins/redis-cache/
5
  * Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, Credis, HHVM, replication, clustering and WP-CLI.
6
+ * Version: 2.0.20-dev
7
  * Text Domain: redis-cache
8
  * Domain Path: /languages
9
  * Network: true