Redis Object Cache - Version 2.0.6

Version Description

  • Added experimental filesystem test to diagnostics
  • Refactored settings tab logic (fixed jumping, too)
  • Fixed issues with wp_cache_get_multiple()
  • Return boolean from wp_cache_delete()
  • Use redis-cache as JS event namespace
  • Hide Pro line in widget when banners are disabled
  • Renamed redis_object_cache_get_multi action to redis_object_cache_get_multiple
Download this release

Release Info

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

Code changes from version 2.0.5 to 2.0.6

assets/css/admin.css CHANGED
@@ -10,11 +10,11 @@
10
  border-bottom: 1px solid #ccc;
11
  }
12
 
13
- #rediscache .section {
14
  display: none;
15
  }
16
 
17
- #rediscache .section.active {
18
  display: block;
19
  }
20
 
@@ -42,7 +42,7 @@
42
  padding-left: 25px;
43
  }
44
 
45
- #rediscache .section-metrics .card {
46
  min-width: auto;
47
  max-width: 100%;
48
  padding: 0;
@@ -52,18 +52,14 @@
52
  height: 300px;
53
  }
54
 
55
- #rediscache .section-diagnostics p {
56
  margin-top: 20px;
57
  }
58
 
59
- #rediscache .section-diagnostics textarea {
60
  width: 100%;
61
  }
62
 
63
- #rediscache .section-support {
64
- margin-top: 3em;
65
- }
66
-
67
  #rediscache .compatiblity {
68
  display: flex;
69
  max-width: 520px;
10
  border-bottom: 1px solid #ccc;
11
  }
12
 
13
+ #rediscache .tab-pane {
14
  display: none;
15
  }
16
 
17
+ #rediscache .tab-pane.active {
18
  display: block;
19
  }
20
 
42
  padding-left: 25px;
43
  }
44
 
45
+ #rediscache .tab-pane-metrics .card {
46
  min-width: auto;
47
  max-width: 100%;
48
  padding: 0;
52
  height: 300px;
53
  }
54
 
55
+ #rediscache .tab-pane-diagnostics p {
56
  margin-top: 20px;
57
  }
58
 
59
+ #rediscache .tab-pane-diagnostics textarea {
60
  width: 100%;
61
  }
62
 
 
 
 
 
63
  #rediscache .compatiblity {
64
  display: flex;
65
  max-width: 520px;
assets/js/admin.js CHANGED
@@ -329,104 +329,95 @@
329
  };
330
 
331
  var setup_charts = function () {
332
- var time = rediscache.metrics.computed.map(
333
- function ( entry ) {
334
- return [ entry.date, entry.time ];
335
- }
336
- );
337
-
338
- var bytes = rediscache.metrics.computed.map(
339
- function ( entry ) {
340
- return [ entry.date, entry.bytes ];
341
- }
342
- )
343
-
344
- var ratio = rediscache.metrics.computed.map(
345
- function ( entry ) {
346
- return [ entry.date, entry.ratio ];
347
- }
348
- );
349
 
350
- var calls = rediscache.metrics.computed.map(
351
- function ( entry ) {
352
- return [ entry.date, entry.calls ];
353
  }
354
- );
355
 
356
- rediscache.charts.time.series = [{
357
- name: 'Time',
358
- type: 'area',
359
- data: time,
360
- }, {
361
- name: 'Pro',
362
- type: 'line',
363
- data: time.map(
364
  function ( entry ) {
365
- return [ entry[0], entry[1] * 0.5 ];
366
  }
367
- ),
368
- } ];
369
-
370
- rediscache.charts.bytes.series = [{
371
- name: rediscache.l10n.bytes,
372
- type: 'area',
373
- data: bytes,
374
- }, {
375
- name: 'Pro',
376
- type: 'line',
377
- data: bytes.map(
378
- function ( entry ) {
379
- return [ entry[0], entry[1] * 0.3 ];
380
- }
381
- ),
382
- } ];
383
-
384
- rediscache.charts.ratio.series = [{
385
- name: rediscache.l10n.ratio,
386
- type: 'area',
387
- data: ratio,
388
- }];
389
-
390
- rediscache.charts.calls.series = [{
391
- name: rediscache.l10n.calls,
392
- type: 'area',
393
- data: calls,
394
- }, {
395
- name: 'Pro',
396
- type: 'line',
397
- data: calls.map(
398
- function ( entry ) {
399
- return [ entry[0], Math.round( entry[1] / 50 ) + 5 ];
400
  }
401
- ),
402
- } ];
 
 
 
 
 
 
 
403
  };
404
 
405
  // executed on page load
406
  $(function () {
407
- var $tabs = $( '#redis-tabs' );
 
408
 
409
  $tabs.find( 'a' ).on(
410
- 'click.redis',
411
- function () {
412
- var $this = $( this );
413
- var $target = $( $this.data( 'target' ) );
414
-
415
- $tabs.find( 'a' ).removeClass( 'nav-tab-active' );
416
- $( '.section' ).removeClass( 'active' );
417
- $target.addClass( 'active' );
418
- $this.addClass( 'nav-tab-active' );
 
 
 
 
419
  }
420
  );
421
 
422
- var tabHash = window.location.hash.replace( '#', '' );
 
 
423
 
424
- if ( tabHash !== '' ) {
425
- $tabs.find( 'a' ).removeClass( 'nav-tab-active' );
426
- $( '.section' ).removeClass( 'active' );
427
- $( '#' + tabHash ).addClass( 'active' );
428
- $( '#' + tabHash + '-tab' ).addClass( 'nav-tab-active' ).trigger( 'click.redis' );
429
- }
 
 
 
 
 
 
 
 
 
430
 
431
  if ( $( '#widget-redis-stats' ).length ) {
432
  rediscache.metrics.computed = compute_metrics(
@@ -439,7 +430,7 @@
439
  }
440
 
441
  $( '#widget-redis-stats ul a' ).on(
442
- 'click.redis',
443
  function ( event ) {
444
  event.preventDefault();
445
 
329
  };
330
 
331
  var setup_charts = function () {
332
+ var metrics = {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
 
334
+ for ( var type in rediscache.charts ) {
335
+ if ( ! rediscache.charts.hasOwnProperty( type ) ) {
336
+ continue;
337
  }
 
338
 
339
+ metrics[type] = rediscache.metrics.computed.map(
 
 
 
 
 
 
 
340
  function ( entry ) {
341
+ return [ entry.date, entry[type] ];
342
  }
343
+ );
344
+
345
+ rediscache.charts[type].series = [{
346
+ name: rediscache.l10n[type],
347
+ type: 'area',
348
+ data: metrics[type],
349
+ }];
350
+ }
351
+
352
+ if ( ! rediscache.disable_pro || ! rediscache.disable_banners ) {
353
+ var pro_charts = {
354
+ time: function ( entry ) {
355
+ return [ entry[0], entry[1] * 0.5 ]
356
+ },
357
+ ratio: function ( entry ) {
358
+ return [ entry[0], entry[1] * 0.3 ]
359
+ },
360
+ calls: function ( entry ) {
361
+ return [ entry[0], Math.round( entry[1] / 50 ) + 5 ]
362
+ },
363
+ };
364
+
365
+ for ( var type in pro_charts ) {
366
+ if ( ! rediscache.charts[type] ) {
367
+ continue;
 
 
 
 
 
 
 
 
368
  }
369
+
370
+ rediscache.charts[type].series.push({
371
+ name: rediscache.l10n.pro,
372
+ type: 'line',
373
+ data: metrics[type].map( pro_charts[type] ),
374
+ });
375
+ }
376
+
377
+ }
378
  };
379
 
380
  // executed on page load
381
  $(function () {
382
+ var $tabs = $( '#rediscache .nav-tab-wrapper' );
383
+ var $panes = $( '#rediscache .content-column .tab-content' );
384
 
385
  $tabs.find( 'a' ).on(
386
+ 'click.redis-cache',
387
+ function ( event ) {
388
+ var toggle = $( this ).data( 'toggle' );
389
+
390
+ $( this ).blur();
391
+
392
+ show_tab( toggle );
393
+
394
+ if ( history.pushState ) {
395
+ history.pushState( null, null, '#' + toggle );
396
+ }
397
+
398
+ return false;
399
  }
400
  );
401
 
402
+ var show_tab = function ( name ) {
403
+ $tabs.find( '.nav-tab-active' ).removeClass( 'nav-tab-active' );
404
+ $panes.find( '.tab-pane.active' ).removeClass( 'active' );
405
 
406
+ $( '#' + name + '-tab' ).addClass( 'nav-tab-active' );
407
+ $( '#' + name + '-pane' ).addClass( 'active' );
408
+ };
409
+
410
+ var show_current_tab = function () {
411
+ var tabHash = window.location.hash.replace( '#', '' );
412
+
413
+ if ( tabHash !== '' && $( '#' + tabHash + '-tab' ) ) {
414
+ show_tab( tabHash );
415
+ }
416
+ };
417
+
418
+ show_current_tab();
419
+
420
+ $( window ).on( 'hashchange', show_current_tab );
421
 
422
  if ( $( '#widget-redis-stats' ).length ) {
423
  rediscache.metrics.computed = compute_metrics(
430
  }
431
 
432
  $( '#widget-redis-stats ul a' ).on(
433
+ 'click.redis-cache',
434
  function ( event ) {
435
  event.preventDefault();
436
 
dependencies/colinmollenhour/credis/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- .idea
2
- vendor
3
- phpunit.phar
4
- phpunit_*.log
 
 
 
 
dependencies/colinmollenhour/credis/composer.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "name": "colinmollenhour/credis",
3
- "type": "library",
4
- "description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.",
5
- "homepage": "https://github.com/colinmollenhour/credis",
6
- "license": "MIT",
7
- "authors": [
8
- {
9
- "name": "Colin Mollenhour",
10
- "email": "colin@mollenhour.com"
11
- }
12
- ],
13
- "require": {
14
- "php": ">=5.4.0"
15
- },
16
- "autoload": {
17
- "classmap": [
18
- "Client.php",
19
- "Cluster.php",
20
- "Sentinel.php",
21
- "Module.php"
22
- ]
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dependencies/colinmollenhour/credis/testenv/docker-compose.yml DELETED
@@ -1,32 +0,0 @@
1
- version: '2'
2
- services:
3
-
4
- php-55:
5
- build: env/php-5.5/
6
- volumes:
7
- - ../:/src/
8
-
9
- php-56:
10
- build: env/php-5.6/
11
- volumes:
12
- - ../:/src/
13
-
14
- php-70:
15
- build: env/php-7.0/
16
- volumes:
17
- - ../:/src/
18
-
19
- php-71:
20
- build: env/php-7.1/
21
- volumes:
22
- - ../:/src/
23
-
24
- php-72:
25
- build: env/php-7.2/
26
- volumes:
27
- - ../:/src/
28
-
29
- php-73:
30
- build: env/php-7.3/
31
- volumes:
32
- - ../:/src/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dependencies/colinmollenhour/credis/tests/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- *.pid
2
- *.rdb
3
- _reports/*
 
 
 
dependencies/predis/predis/composer.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "name": "predis/predis",
3
- "type": "library",
4
- "description": "Flexible and feature-complete Redis client for PHP and HHVM",
5
- "keywords": ["nosql", "redis", "predis"],
6
- "homepage": "http://github.com/nrk/predis",
7
- "license": "MIT",
8
- "support": {
9
- "issues": "https://github.com/nrk/predis/issues"
10
- },
11
- "authors": [
12
- {
13
- "name": "Daniele Alessandri",
14
- "email": "suppakilla@gmail.com",
15
- "homepage": "http://clorophilla.net"
16
- }
17
- ],
18
- "require": {
19
- "php": ">=5.3.9"
20
- },
21
- "require-dev": {
22
- "phpunit/phpunit": "~4.8"
23
- },
24
- "suggest": {
25
- "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol",
26
- "ext-curl": "Allows access to Webdis when paired with phpiredis"
27
- },
28
- "autoload": {
29
- "psr-4": {"Predis\\": "src/"}
30
- }
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-plugin.php CHANGED
@@ -7,6 +7,7 @@
7
 
8
  namespace Rhubarb\RedisCache;
9
 
 
10
  use Exception;
11
 
12
  defined( '\\ABSPATH' ) || exit;
@@ -71,8 +72,6 @@ class Plugin {
71
 
72
  add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( $this, 'add_admin_menu_page' ) );
73
 
74
- add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
75
-
76
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
77
  add_action( 'network_admin_notices', array( $this, 'show_admin_notices' ) );
78
 
@@ -110,29 +109,6 @@ class Plugin {
110
  );
111
  }
112
 
113
- public function add_admin_bar_menu( $wp_admin_bar ) {
114
- if ( ! current_user_can( is_multisite() ? 'manage_network_options' : 'manage_options' ) ) {
115
- return;
116
- }
117
-
118
- if ( ! $this->get_redis_status() ) {
119
- return;
120
- }
121
-
122
- if ( ! defined( 'WP_REDIS_DISABLE_ADMINBAR' ) || WP_REDIS_DISABLE_ADMINBAR ) {
123
- return;
124
- }
125
-
126
- $wp_admin_bar->add_node( [
127
- 'id' => 'redis-cache-flush',
128
- 'title' => __( 'Flush Object Cache', 'redis-cache' ),
129
- 'href' => $this->action_link( 'flush-cache' ),
130
- 'meta' => [
131
- 'title' => __( 'Flush the Redis object cache', 'redis-cache' ),
132
- ],
133
- ] );
134
- }
135
-
136
  public function show_admin_page() {
137
  // request filesystem credentials?
138
  if ( isset( $_GET['_wpnonce'], $_GET['action'] ) ) {
@@ -242,6 +218,8 @@ class Plugin {
242
  'rediscache',
243
  array(
244
  'jQuery' => 'jQuery',
 
 
245
  'l10n' => array(
246
  'time' => __( 'Time', 'redis-cache' ),
247
  'bytes' => __( 'Bytes', 'redis-cache' ),
@@ -797,6 +775,48 @@ class Plugin {
797
  return true;
798
  }
799
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
800
  public function maybe_update_dropin() {
801
  if ( defined( 'WP_REDIS_DISABLE_DROPIN_AUTOUPDATE' ) && WP_REDIS_DISABLE_DROPIN_AUTOUPDATE ) {
802
  return;
7
 
8
  namespace Rhubarb\RedisCache;
9
 
10
+ use WP_Error;
11
  use Exception;
12
 
13
  defined( '\\ABSPATH' ) || exit;
72
 
73
  add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( $this, 'add_admin_menu_page' ) );
74
 
 
 
75
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
76
  add_action( 'network_admin_notices', array( $this, 'show_admin_notices' ) );
77
 
109
  );
110
  }
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  public function show_admin_page() {
113
  // request filesystem credentials?
114
  if ( isset( $_GET['_wpnonce'], $_GET['action'] ) ) {
218
  'rediscache',
219
  array(
220
  'jQuery' => 'jQuery',
221
+ 'disable_pro' => $screen->id !== $this->screen,
222
+ 'disable_banners' => defined( 'WP_REDIS_DISABLE_BANNERS' ) && WP_REDIS_DISABLE_BANNERS,
223
  'l10n' => array(
224
  'time' => __( 'Time', 'redis-cache' ),
225
  'bytes' => __( 'Bytes', 'redis-cache' ),
775
  return true;
776
  }
777
 
778
+ public function test_filesystem_writing()
779
+ {
780
+ global $wp_filesystem;
781
+
782
+ if ( ! $this->initialize_filesystem( '', true ) ) {
783
+ return new WP_Error( 'fs', __( 'Could not initialize filesystem.', 'redis-cache' ) );
784
+ }
785
+
786
+ $cachefile = WP_REDIS_PLUGIN_PATH . '/includes/object-cache.php';
787
+ $testfile = WP_CONTENT_DIR . '/.redis-write-test.tmp';
788
+
789
+ if ( ! $wp_filesystem->exists( $cachefile ) ) {
790
+ return new WP_Error( 'exists', __( 'Object cache file doesn’t exist.', 'redis-cache' ) );
791
+ }
792
+
793
+ if ( $wp_filesystem->exists( $testfile ) ) {
794
+ if ( ! $wp_filesystem->delete( $testfile ) ) {
795
+ return new WP_Error( 'delete', __( 'Test file exists, but couldn’t be deleted.', 'redis-cache' ) );
796
+ }
797
+ }
798
+
799
+ if ( ! $wp_filesystem->copy( $cachefile, $testfile, true, FS_CHMOD_FILE ) ) {
800
+ return new WP_Error( 'copy', __( 'Failed to copy test file.', 'redis-cache' ) );
801
+ }
802
+
803
+ if ( ! $wp_filesystem->exists( $testfile ) ) {
804
+ return new WP_Error( 'exists', __( 'Copied test file doesn’t exist.', 'redis-cache' ) );
805
+ }
806
+
807
+ $meta = get_file_data( $testfile, [ 'Version' => 'Version' ] );
808
+
809
+ if ( $meta['Version'] !== WP_REDIS_VERSION ) {
810
+ return new WP_Error( 'version', __( 'Couldn’t verify test file contents.', 'redis-cache' ) );
811
+ }
812
+
813
+ if ( ! $wp_filesystem->delete( $testfile ) ) {
814
+ return new WP_Error( 'delete', __( 'Copied test file couldn’t be deleted.', 'redis-cache' ) );
815
+ }
816
+
817
+ return true;
818
+ }
819
+
820
  public function maybe_update_dropin() {
821
  if ( defined( 'WP_REDIS_DISABLE_DROPIN_AUTOUPDATE' ) && WP_REDIS_DISABLE_DROPIN_AUTOUPDATE ) {
822
  return;
includes/class-ui.php CHANGED
@@ -36,7 +36,6 @@ class UI {
36
  'label' => $label,
37
  'file' => WP_REDIS_PLUGIN_PATH . "/includes/ui/tabs/{$slug}.php",
38
  'slug' => $slug,
39
- 'target' => "#{$slug}",
40
  'default' => false,
41
  ]
42
  );
36
  'label' => $label,
37
  'file' => WP_REDIS_PLUGIN_PATH . "/includes/ui/tabs/{$slug}.php",
38
  'slug' => $slug,
 
39
  'default' => false,
40
  ]
41
  );
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.5
7
  * Author: Till Krüss
8
  * Author URI: https://wprediscache.com
9
  * License: GPLv3
@@ -1041,7 +1041,7 @@ class WP_Object_Cache {
1041
  do_action( 'redis_object_cache_delete', $key, $group, $execute_time );
1042
  }
1043
 
1044
- return $result;
1045
  }
1046
 
1047
  /**
@@ -1355,27 +1355,31 @@ LUA;
1355
  return $cache;
1356
  }
1357
 
1358
- $keys = array_values( $derived_keys );
1359
-
1360
  if ( ! $force ) {
1361
  foreach ( $keys as $key ) {
1362
- $cache[ $key ] = $this->get_from_internal_cache( $derived_keys[ $key ] );
 
 
 
 
 
 
 
1363
  }
 
1364
 
1365
- $keys = array_keys(
1366
- array_filter(
1367
- $cache,
1368
- function ( $value ) {
1369
- return $value === false;
1370
- }
1371
- )
1372
- );
1373
  }
1374
 
1375
  $start_time = microtime( true );
1376
 
1377
  try {
1378
- $results = array_combine( $keys, $this->redis->mget( $keys ) );
1379
  } catch ( Exception $exception ) {
1380
  $this->handle_exception( $exception );
1381
 
@@ -1388,21 +1392,21 @@ LUA;
1388
  $this->cache_time += $execute_time;
1389
 
1390
  foreach ( $results as $key => $value ) {
 
 
1391
  if ( $value === false ) {
1392
  $this->cache_misses++;
1393
- continue;
1394
- }
1395
-
1396
- $this->cache_hits++;
1397
 
1398
- $cache[ $key ] = $value;
1399
- $this->add_to_internal_cache( $derived_keys[ $key ], $value );
1400
  }
1401
 
1402
  $cache = array_map( array( $this, 'maybe_unserialize' ), $cache );
1403
 
1404
  if ( function_exists( 'do_action' ) ) {
1405
- do_action( 'redis_object_cache_get_multi', $keys, $cache, $group, $force, $execute_time );
1406
  }
1407
 
1408
  if ( function_exists( 'apply_filters' ) && function_exists( 'has_filter' ) ) {
@@ -1610,8 +1614,6 @@ LUA;
1610
  );
1611
 
1612
  return (object) [
1613
- // Connected, Disabled, Unknown, Not connected
1614
- 'status' => '...',
1615
  'hits' => $this->cache_hits,
1616
  'misses' => $this->cache_misses,
1617
  'ratio' => $total > 0 ? round( $this->cache_hits / ( $total / 100 ), 1 ) : 100,
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.6
7
  * Author: Till Krüss
8
  * Author URI: https://wprediscache.com
9
  * License: GPLv3
1041
  do_action( 'redis_object_cache_delete', $key, $group, $execute_time );
1042
  }
1043
 
1044
+ return (bool) $result;
1045
  }
1046
 
1047
  /**
1355
  return $cache;
1356
  }
1357
 
 
 
1358
  if ( ! $force ) {
1359
  foreach ( $keys as $key ) {
1360
+ $value = $this->get_from_internal_cache( $derived_keys[ $key ] );
1361
+
1362
+ if ( $value === false ) {
1363
+ $this->cache_misses++;
1364
+ } else {
1365
+ $cache[ $key ] = $value;
1366
+ $this->cache_hits++;
1367
+ }
1368
  }
1369
+ }
1370
 
1371
+ $remaining_keys = array_filter( $keys, function ( $key ) use ( $cache ) {
1372
+ return ! isset( $cache[ $key ] );
1373
+ } );
1374
+
1375
+ if ( empty( $remaining_keys ) ) {
1376
+ return $cache;
 
 
1377
  }
1378
 
1379
  $start_time = microtime( true );
1380
 
1381
  try {
1382
+ $results = array_combine( $keys, $this->redis->mget( $remaining_keys ) );
1383
  } catch ( Exception $exception ) {
1384
  $this->handle_exception( $exception );
1385
 
1392
  $this->cache_time += $execute_time;
1393
 
1394
  foreach ( $results as $key => $value ) {
1395
+ $cache[ $key ] = $value;
1396
+
1397
  if ( $value === false ) {
1398
  $this->cache_misses++;
1399
+ } else {
1400
+ $this->cache_hits++;
 
 
1401
 
1402
+ $this->add_to_internal_cache( $derived_keys[ $key ], $value );
1403
+ }
1404
  }
1405
 
1406
  $cache = array_map( array( $this, 'maybe_unserialize' ), $cache );
1407
 
1408
  if ( function_exists( 'do_action' ) ) {
1409
+ do_action( 'redis_object_cache_get_multiple', $keys, $cache, $group, $force, $execute_time );
1410
  }
1411
 
1412
  if ( function_exists( 'apply_filters' ) && function_exists( 'has_filter' ) ) {
1614
  );
1615
 
1616
  return (object) [
 
 
1617
  'hits' => $this->cache_hits,
1618
  'misses' => $this->cache_misses,
1619
  'ratio' => $total > 0 ? round( $this->cache_hits / ( $total / 100 ), 1 ) : 100,
includes/ui/diagnostics.php CHANGED
@@ -10,6 +10,7 @@ defined( '\\ABSPATH' ) || exit;
10
  global $wp_object_cache;
11
 
12
  $info = [];
 
13
  $dropin = $plugin->validate_object_cache_dropin();
14
  $disabled = defined( 'WP_REDIS_DISABLED' ) && WP_REDIS_DISABLED;
15
 
@@ -17,6 +18,7 @@ $info['Status'] = $plugin->get_status();
17
  $info['Client'] = $plugin->get_redis_client_name();
18
  $info['Drop-in'] = $dropin ? 'Valid' : 'Invalid';
19
  $info['Disabled'] = $disabled ? 'Yes' : 'No';
 
20
 
21
  if ( $dropin && ! $disabled ) {
22
  $info[ 'Ping' ] = $wp_object_cache->diagnostics[ 'ping' ];
@@ -49,7 +51,6 @@ $info['Plugin Version'] = WP_REDIS_VERSION;
49
  $info['Redis Version'] = $plugin->get_redis_version() ?: 'Unknown';
50
 
51
  $info['Multisite'] = is_multisite() ? 'Yes' : 'No';
52
- $info['Filesystem'] = $plugin->initialize_filesystem( '', true ) ? 'Yes' : 'No';
53
 
54
  if ( $dropin ) {
55
  $info['Global Prefix'] = wp_json_encode( $wp_object_cache->global_prefix );
10
  global $wp_object_cache;
11
 
12
  $info = [];
13
+ $filesystem = $plugin->test_filesystem_writing();
14
  $dropin = $plugin->validate_object_cache_dropin();
15
  $disabled = defined( 'WP_REDIS_DISABLED' ) && WP_REDIS_DISABLED;
16
 
18
  $info['Client'] = $plugin->get_redis_client_name();
19
  $info['Drop-in'] = $dropin ? 'Valid' : 'Invalid';
20
  $info['Disabled'] = $disabled ? 'Yes' : 'No';
21
+ $info['Filesystem'] = is_wp_error( $filesystem ) ? $filesystem->get_error_message() : 'Working';
22
 
23
  if ( $dropin && ! $disabled ) {
24
  $info[ 'Ping' ] = $wp_object_cache->diagnostics[ 'ping' ];
51
  $info['Redis Version'] = $plugin->get_redis_version() ?: 'Unknown';
52
 
53
  $info['Multisite'] = is_multisite() ? 'Yes' : 'No';
 
54
 
55
  if ( $dropin ) {
56
  $info['Global Prefix'] = wp_json_encode( $wp_object_cache->global_prefix );
includes/ui/settings.php CHANGED
@@ -24,22 +24,22 @@ defined( '\\ABSPATH' ) || exit;
24
 
25
  <div class="content-column">
26
 
27
- <h2 class="nav-tab-wrapper" id="redis-tabs">
28
  <?php foreach ( UI::get_tabs() as $ui_tab ) : ?>
29
  <a class="nav-tab <?php echo $ui_tab->default ? 'nav-tab-active' : ''; ?>"
30
  id="<?php echo esc_attr( $ui_tab->slug ); ?>-tab"
31
- data-target="<?php echo esc_attr( $ui_tab->target ); ?>"
32
- href="<?php echo esc_attr( $ui_tab->target ); ?>"
33
  >
34
  <?php echo esc_html( $ui_tab->label ); ?>
35
  </a>
36
  <?php endforeach; ?>
37
  </h2>
38
 
39
- <div class="sections">
40
  <?php foreach ( UI::get_tabs() as $ui_tab ) : ?>
41
- <div id="<?php echo esc_attr( $ui_tab->slug ); ?>"
42
- class="section section-<?php echo esc_attr( $ui_tab->slug ); ?> <?php echo $ui_tab->default ? ' active' : ''; ?>"
43
  >
44
  <?php include $ui_tab->file; ?>
45
  </div>
@@ -133,31 +133,6 @@ defined( '\\ABSPATH' ) || exit;
133
 
134
  </div>
135
 
136
- <!-- <div class="section-support">
137
-
138
- <div class="card">
139
- <h2 class="title">
140
- <?php esc_html_e('Support', 'redis-cache'); ?>
141
- </h2>
142
- <p>
143
- This plugin is maintained and supported <a target="_blank" rel="noopener" href="https://github.com/rhubarbgroup/redis-cache">on GitHub</a>,
144
- and its connection parameters and configuration options are outlined in the documentation.
145
- </p>
146
- <p>
147
- <a class="button button-secondary" target="_blank" rel="noopener" href="https://github.com/rhubarbgroup/redis-cache/wiki">
148
- <?php esc_html_e('Documentation', 'redis-cache'); ?>
149
- </a>
150
-
151
- &nbsp;
152
-
153
- <a class="button button-secondary" target="_blank" rel="noopener" href="https://github.com/rhubarbgroup/redis-cache/issues">
154
- <?php esc_html_e('Support', 'redis-cache'); ?>
155
- </a>
156
- </p>
157
- </div>
158
-
159
- </div> -->
160
-
161
  </div>
162
 
163
  </div>
24
 
25
  <div class="content-column">
26
 
27
+ <h2 class="nav-tab-wrapper">
28
  <?php foreach ( UI::get_tabs() as $ui_tab ) : ?>
29
  <a class="nav-tab <?php echo $ui_tab->default ? 'nav-tab-active' : ''; ?>"
30
  id="<?php echo esc_attr( $ui_tab->slug ); ?>-tab"
31
+ data-toggle="<?php echo esc_attr( $ui_tab->slug ); ?>"
32
+ href="<?php echo esc_attr( $ui_tab->slug ); ?>"
33
  >
34
  <?php echo esc_html( $ui_tab->label ); ?>
35
  </a>
36
  <?php endforeach; ?>
37
  </h2>
38
 
39
+ <div class="tab-content">
40
  <?php foreach ( UI::get_tabs() as $ui_tab ) : ?>
41
+ <div id="<?php echo esc_attr( $ui_tab->slug ); ?>-pane"
42
+ class="tab-pane tab-pane-<?php echo esc_attr( $ui_tab->slug ); ?> <?php echo $ui_tab->default ? 'active' : ''; ?>"
43
  >
44
  <?php include $ui_tab->file; ?>
45
  </div>
133
 
134
  </div>
135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  </div>
137
 
138
  </div>
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: tillkruess
3
  Donate link: https://github.com/sponsors/tillkruss
4
  Tags: redis, predis, phpredis, credis, hhvm, pecl, caching, cache, object cache, performance, replication, clustering, keydb
5
  Requires at least: 3.3
6
- Tested up to: 5.4
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.5
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -83,6 +83,16 @@ To see a list of all available WP-CLI commands, please see the [WP CLI commands
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
 
 
 
86
  = 2.0.5 =
87
 
88
  Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
@@ -408,7 +418,7 @@ Since Predis isn't maintained any longer, it's highly recommended to switch over
408
 
409
  == Upgrade Notice ==
410
 
411
- = 2.0.5 =
412
 
413
  Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
414
 
3
  Donate link: https://github.com/sponsors/tillkruss
4
  Tags: redis, predis, phpredis, credis, hhvm, pecl, caching, cache, object cache, performance, replication, clustering, keydb
5
  Requires at least: 3.3
6
+ Tested up to: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.6
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
83
 
84
  == Changelog ==
85
 
86
+ = 2.0.6 =
87
+
88
+ - Added experimental filesystem test to diagnostics
89
+ - Refactored settings tab logic (fixed jumping, too)
90
+ - Fixed issues with `wp_cache_get_multiple()`
91
+ - Return boolean from `wp_cache_delete()`
92
+ - Use `redis-cache` as JS event namespace
93
+ - Hide Pro line in widget when banners are disabled
94
+ - Renamed `redis_object_cache_get_multi` action to `redis_object_cache_get_multiple`
95
+
96
  = 2.0.5 =
97
 
98
  Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
418
 
419
  == Upgrade Notice ==
420
 
421
+ = 2.0.6 =
422
 
423
  Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
424
 
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.5
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.6
7
  * Text Domain: redis-cache
8
  * Domain Path: /languages
9
  * Network: true