Redis Object Cache - Version 1.3.2

Version Description

  • Make sure $result is not false in WP_Object_Cache::get()
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

Files changed (3) hide show
  1. includes/object-cache.php +14 -6
  2. readme.txt +10 -2
  3. redis-cache.php +2 -2
includes/object-cache.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: Redis Object Cache
4
  Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  Description: A persistent object cache backend powered by Redis. Supports HHVM's Redis extension, the PECL Redis Extension and the Predis library for PHP.
6
- Version: 1.3.1
7
  Author: Till Krüss
8
- Author URI: http://till.kruss.me/
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -610,7 +610,7 @@ class WP_Object_Cache {
610
 
611
  $result = $this->redis->get( $derived_key );
612
 
613
- if ($result === NULL) {
614
  $found = false;
615
  $this->cache_misses++;
616
 
@@ -625,9 +625,15 @@ class WP_Object_Cache {
625
 
626
  $value = is_object( $value ) ? clone $value : $value;
627
 
628
- do_action( 'redis_object_cache_get', $key, $value, $group, $force, $found );
 
 
629
 
630
- return apply_filters( 'redis_object_cache_get', $value, $key, $group, $force, $found );
 
 
 
 
631
  }
632
 
633
  /**
@@ -722,7 +728,9 @@ class WP_Object_Cache {
722
  $this->add_to_internal_cache( $derived_key, $value );
723
  }
724
 
725
- do_action( 'redis_object_cache_set', $key, $value, $group, $expiration );
 
 
726
 
727
  return $result;
728
  }
3
  Plugin Name: Redis Object Cache
4
  Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  Description: A persistent object cache backend powered by Redis. Supports HHVM's Redis extension, the PECL Redis Extension and the Predis library for PHP.
6
+ Version: 1.3.2
7
  Author: Till Krüss
8
+ Author URI: https://till.im/
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
610
 
611
  $result = $this->redis->get( $derived_key );
612
 
613
+ if ($result === null || $result === false) {
614
  $found = false;
615
  $this->cache_misses++;
616
 
625
 
626
  $value = is_object( $value ) ? clone $value : $value;
627
 
628
+ if ( function_exists( 'do_action' ) ) {
629
+ do_action( 'redis_object_cache_get', $key, $value, $group, $force, $found );
630
+ }
631
 
632
+ if ( function_exists( 'apply_filters' ) ) {
633
+ return apply_filters( 'redis_object_cache_get', $value, $key, $group, $force, $found );
634
+ } else {
635
+ return $value;
636
+ }
637
  }
638
 
639
  /**
728
  $this->add_to_internal_cache( $derived_key, $value );
729
  }
730
 
731
+ if ( function_exists( 'do_action' ) ) {
732
+ do_action( 'redis_object_cache_set', $key, $value, $group, $expiration );
733
+ }
734
 
735
  return $result;
736
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: tillkruess
3
  Donate link: https://www.paypal.me/tillkruss
4
  Tags: redis, predis, hhvm, pecl, caching, cache, object cache, wp object cache, server, performance, optimize, speed, load, replication, clustering
5
  Requires at least: 3.3
6
- Tested up to: 4.5
7
- Stable tag: 1.3.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -109,6 +109,10 @@ __Clustering via Client-side Sharding Example:__
109
 
110
  == Changelog ==
111
 
 
 
 
 
112
  = 1.3.1 =
113
 
114
  * Fixed connection issue
@@ -182,6 +186,10 @@ __Clustering via Client-side Sharding Example:__
182
 
183
  == Upgrade Notice ==
184
 
 
 
 
 
185
  = 1.3.1 =
186
 
187
  This update includes a critical connection issue fix.
3
  Donate link: https://www.paypal.me/tillkruss
4
  Tags: redis, predis, hhvm, pecl, caching, cache, object cache, wp object cache, server, performance, optimize, speed, load, replication, clustering
5
  Requires at least: 3.3
6
+ Tested up to: 4.6
7
+ Stable tag: 1.3.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.3.2 =
113
+
114
+ * Make sure `$result` is not `false` in `WP_Object_Cache::get()`
115
+
116
  = 1.3.1 =
117
 
118
  * Fixed connection issue
186
 
187
  == Upgrade Notice ==
188
 
189
+ = 1.3.2 =
190
+
191
+ This update includes a critical fix for PhpRedis.
192
+
193
  = 1.3.1 =
194
 
195
  This update includes a critical connection issue fix.
redis-cache.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Redis Object Cache
4
  Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication and clustering.
6
- Version: 1.3.1
7
  Text Domain: redis-cache
8
  Domain Path: /languages
9
  Author: Till Krüss
10
- Author URI: http://till.kruss.me/
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
  */
3
  Plugin Name: Redis Object Cache
4
  Plugin URI: http://wordpress.org/plugins/redis-cache/
5
  Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication and clustering.
6
+ Version: 1.3.2
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
  */