Redis Object Cache - Version 1.5.6

Version Description

  • Added object cloning to in-memory cache
  • Fixed PHP notice related to read_timeout parameter
Download this release

Release Info

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

Code changes from version 1.5.5 to 1.5.6

includes/admin-page.php CHANGED
@@ -15,11 +15,12 @@
15
  </p>
16
  <ul>
17
  <li>Rewritten for raw performance</li>
18
- <li>100% WordPress object cache API compliant</li>
19
- <li>Easy debugging & logging</li>
 
20
  <li>Fully unit tested (100% code coverage)</li>
21
  <li>Secure connections with TLS</li>
22
- <li>Seamless WP CLI & Debug Bar integration</li>
23
  <li>Optimized for WooCommerce, Jetpack & Yoast SEO</li>
24
  </ul>
25
  <p>
15
  </p>
16
  <ul>
17
  <li>Rewritten for raw performance</li>
18
+ <li>WordPress object cache API compliant</li>
19
+ <li>Easy debugging &amp; logging</li>
20
+ <li>Cache analytics and preloading</li>
21
  <li>Fully unit tested (100% code coverage)</li>
22
  <li>Secure connections with TLS</li>
23
+ <li>Health checks via WordPress, WP CLI &amp; Debug Bar</li>
24
  <li>Optimized for WooCommerce, Jetpack & Yoast SEO</li>
25
  </ul>
26
  <p>
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, HHVM, replication, clustering and WP-CLI.
6
- Version: 1.5.5
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  License: GPLv3
@@ -550,7 +550,7 @@ class WP_Object_Cache
550
  $options['cluster'] = 'redis';
551
  }
552
 
553
- if ($parameters['read_timeout']) {
554
  $parameters['read_write_timeout'] = $parameters['read_timeout'];
555
  }
556
 
@@ -1319,6 +1319,10 @@ LUA;
1319
  */
1320
  public function add_to_internal_cache($derived_key, $value)
1321
  {
 
 
 
 
1322
  $this->cache[$derived_key] = $value;
1323
  }
1324
 
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, HHVM, replication, clustering and WP-CLI.
6
+ Version: 1.5.6
7
  Author: Till Krüss
8
  Author URI: https://till.im/
9
  License: GPLv3
550
  $options['cluster'] = 'redis';
551
  }
552
 
553
+ if (isset($parameters['read_timeout']) && $parameters['read_timeout']) {
554
  $parameters['read_write_timeout'] = $parameters['read_timeout'];
555
  }
556
 
1319
  */
1320
  public function add_to_internal_cache($derived_key, $value)
1321
  {
1322
+ if (is_object($value)) {
1323
+ $value = clone $value;
1324
+ }
1325
+
1326
  $this->cache[$derived_key] = $value;
1327
  }
1328
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: redis, predis, phpredis, hhvm, pecl, caching, cache, object cache, perform
5
  Requires at least: 3.3
6
  Tested up to: 5.3
7
  Requires PHP: 5.4
8
- Stable tag: 1.5.5
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -27,9 +27,10 @@ A **business class** Redis object cache backend. Truly reliable, highly optimize
27
  * Rewritten for raw performance
28
  * WordPress object cache API compliant
29
  * Easy debugging & logging
 
30
  * Fully unit tested (100% code coverage)
31
  * Secure connections with TLS
32
- * Seamless WP CLI & Debug Bar integration
33
  * Optimized for WooCommerce, Jetpack & Yoast SEO
34
 
35
  Learn more about [Redis Cache Pro](https://wprediscache.com/?utm_source=wp-plugin&amp;utm_medium=readme).
@@ -140,7 +141,7 @@ To adjust the configuration, define any of the following constants in your `wp-c
140
 
141
  * `WP_REDIS_DISABLE_BANNERS` (default: _not set_)
142
 
143
- Set to `false` to disable promotions for [Redis Cache Pro](https://wprediscache.com/).
144
 
145
  == Replication & Clustering ==
146
 
@@ -217,6 +218,11 @@ The following commands are supported:
217
 
218
  == Changelog ==
219
 
 
 
 
 
 
220
  = 1.5.5 =
221
 
222
  Please flush the object cache after updating the drop to v1.5.5 to avoid dead keys filling up Redis memory.
5
  Requires at least: 3.3
6
  Tested up to: 5.3
7
  Requires PHP: 5.4
8
+ Stable tag: 1.5.6
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
27
  * Rewritten for raw performance
28
  * WordPress object cache API compliant
29
  * Easy debugging & logging
30
+ * Cache analytics and preloading
31
  * Fully unit tested (100% code coverage)
32
  * Secure connections with TLS
33
+ * Health checks via WordPress, WP CLI & Debug Bar
34
  * Optimized for WooCommerce, Jetpack & Yoast SEO
35
 
36
  Learn more about [Redis Cache Pro](https://wprediscache.com/?utm_source=wp-plugin&amp;utm_medium=readme).
141
 
142
  * `WP_REDIS_DISABLE_BANNERS` (default: _not set_)
143
 
144
+ Set to `true` to disable promotions for [Redis Cache Pro](https://wprediscache.com/).
145
 
146
  == Replication & Clustering ==
147
 
218
 
219
  == Changelog ==
220
 
221
+ = 1.5.6 =
222
+
223
+ - Added object cloning to in-memory cache
224
+ - Fixed PHP notice related to `read_timeout` parameter
225
+
226
  = 1.5.5 =
227
 
228
  Please flush the object cache after updating the drop to v1.5.5 to avoid dead keys filling up Redis memory.
redis-cache.php CHANGED
@@ -3,11 +3,12 @@
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, HHVM, replication, clustering and WP-CLI.
6
- Version: 1.5.5
7
  Text Domain: redis-cache
8
  Domain Path: /languages
9
  Author: Till Krüss
10
  Author URI: https://till.im/
 
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
  */
@@ -16,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'WP_REDIS_VERSION', '1.5.5' );
20
 
21
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
22
  require_once dirname( __FILE__ ) . '/includes/wp-cli-commands.php';
@@ -43,6 +44,7 @@ class RedisObjectCache {
43
  add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( $this, 'add_admin_menu_page' ) );
44
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
45
  add_action( 'admin_notices', array( $this, 'pro_notice' ) );
 
46
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
47
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
48
  add_action( 'load-' . $this->screen, array( $this, 'do_admin_actions' ) );
@@ -139,7 +141,13 @@ class RedisObjectCache {
139
  return;
140
  }
141
 
142
- if ( ! in_array( $screen->id, array( 'dashboard', $this->screen ) ) ) {
 
 
 
 
 
 
143
  return;
144
  }
145
 
@@ -406,7 +414,7 @@ class RedisObjectCache {
406
  return;
407
  }
408
 
409
- if ( ! in_array( $screen->id, array( 'dashboard', $this->screen ) ) ) {
410
  return;
411
  }
412
 
@@ -432,6 +440,43 @@ class RedisObjectCache {
432
  );
433
  }
434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  public function initialize_filesystem( $url, $silent = false ) {
436
 
437
  if ( $silent ) {
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, HHVM, replication, clustering and WP-CLI.
6
+ Version: 1.5.6
7
  Text Domain: redis-cache
8
  Domain Path: /languages
9
  Author: Till Krüss
10
  Author URI: https://till.im/
11
+ GitHub Plugin URI: https://github.com/tillkruss/redis-cache
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
  */
17
  exit;
18
  }
19
 
20
+ define( 'WP_REDIS_VERSION', '1.5.6' );
21
 
22
  if ( defined( 'WP_CLI' ) && WP_CLI ) {
23
  require_once dirname( __FILE__ ) . '/includes/wp-cli-commands.php';
44
  add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( $this, 'add_admin_menu_page' ) );
45
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
46
  add_action( 'admin_notices', array( $this, 'pro_notice' ) );
47
+ add_filter( 'admin_notices', array( $this, 'wc_pro_notice' ) );
48
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
49
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
50
  add_action( 'load-' . $this->screen, array( $this, 'do_admin_actions' ) );
141
  return;
142
  }
143
 
144
+ if ( ! in_array( $screen->id, array(
145
+ 'dashboard',
146
+ 'edit-shop_order',
147
+ 'edit-product',
148
+ 'woocommerce_page_wc-admin',
149
+ $this->screen
150
+ ) ) ) {
151
  return;
152
  }
153
 
414
  return;
415
  }
416
 
417
+ if ( ! in_array( $screen->id, array( 'dashboard' ) ) ) {
418
  return;
419
  }
420
 
440
  );
441
  }
442
 
443
+ public function wc_pro_notice() {
444
+ if ( ! class_exists( 'WooCommerce' ) ) {
445
+ return;
446
+ }
447
+
448
+ $screen = get_current_screen();
449
+
450
+ if ( ! isset( $screen->id ) ) {
451
+ return;
452
+ }
453
+
454
+ if ( ! in_array( $screen->id, array( 'edit-shop_order', 'edit-product', 'woocommerce_page_wc-admin' ) ) ) {
455
+ return;
456
+ }
457
+
458
+ if ( ! current_user_can( 'manage_options' ) ) {
459
+ return;
460
+ }
461
+
462
+ if ( defined( 'WP_REDIS_DISABLE_BANNERS' ) && WP_REDIS_DISABLE_BANNERS ) {
463
+ return;
464
+ }
465
+
466
+ if ( get_user_meta( get_current_user_id(), 'roc_dismissed_wc_pro_notice', true ) == '1' ) {
467
+ return;
468
+ }
469
+
470
+ printf(
471
+ '<div class="notice woocommerce-message woocommerce-admin-promo-messages is-dismissible" data-dismissible="wc_pro_notice"><p><strong>%s</strong></p><p>%s</p></div>',
472
+ __( 'Redis Cache Pro + WooCommerce = ❤️', 'redis-cache' ),
473
+ sprintf(
474
+ __( 'Redis Cache Pro is a <u>business class</u> object cache that’s highly-optimized for WooCommerce to provide true reliability, peace of mind and faster load times for your store. <a style="color: #bb77ae;" href="%1$s">Learn more »</a>', 'redis-cache' ),
475
+ network_admin_url( $this->page )
476
+ )
477
+ );
478
+ }
479
+
480
  public function initialize_filesystem( $url, $silent = false ) {
481
 
482
  if ( $silent ) {