Version Description
- Made Object Cache Pro card translatable
- Added
WP_REDIS_SERIALIZER
to diagnostics - Improved speed of
build_key()
- Support settings
WP_REDIS_PREFIX
andWP_REDIS_SELECTIVE_FLUSH
via environment variable - Added
WP_REDIS_METRICS_MAX_TIME
to adjust stored metrics timeframe - Delay loading of text domain and schedule until
init
hook - Upgraded bundled Predis library to v1.1.6
- Prevent variable referencing issue in
connect_using_credis()
Download this release
Release Info
Developer | tillkruess |
Plugin | Redis Object Cache |
Version | 2.0.14 |
Comparing to | |
See all releases |
Code changes from version 2.0.13 to 2.0.14
- dependencies/predis/predis/CHANGELOG.md +37 -0
- dependencies/predis/predis/VERSION +1 -1
- dependencies/predis/predis/package.ini +1 -1
- dependencies/predis/predis/src/Client.php +1 -1
- dependencies/predis/predis/src/ClientContextInterface.php +1 -1
- dependencies/predis/predis/src/Configuration/ReplicationOption.php +7 -5
- dependencies/predis/predis/src/Connection/Aggregate/SentinelReplication.php +7 -2
- dependencies/predis/predis/src/Connection/Parameters.php +10 -1
- dependencies/predis/predis/src/Connection/PhpiredisStreamConnection.php +16 -2
- dependencies/predis/predis/src/Connection/WebdisConnection.php +1 -1
- includes/class-plugin.php +33 -34
- includes/object-cache.php +22 -8
- includes/ui/diagnostics.php +2 -0
- includes/ui/settings.php +11 -11
- languages/redis-cache.pot +88 -44
- readme.txt +14 -3
- redis-cache.php +1 -1
dependencies/predis/predis/CHANGELOG.md
CHANGED
@@ -1,3 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
v1.1.4 (2020-08-31)
|
2 |
================================================================================
|
3 |
|
1 |
+
v1.1.6 (2020-09-11)
|
2 |
+
================================================================================
|
3 |
+
|
4 |
+
- __FIX__: reverted support for sentinels authentication implemented in v1.1.5
|
5 |
+
as it was bugged (see ISSUE #658), sorry for the trouble. This is now postponed
|
6 |
+
as it requires a more thorough investigation.
|
7 |
+
|
8 |
+
|
9 |
+
v1.1.5 (2020-09-10)
|
10 |
+
================================================================================
|
11 |
+
|
12 |
+
- __FIX__:~~authentication for sentinels is now supported, previously it was not
|
13 |
+
possible to specify a `password` for sentinels as its value was stripped during
|
14 |
+
initialization because sentinels did not support authentication until Redis 5.
|
15 |
+
**Please note** that with the current implementation each sentinel must have
|
16 |
+
its own `password` parameter set in the parameters list despite this password is
|
17 |
+
the same for all sentinels (read how `requirepass` works on the Redis docs). In
|
18 |
+
this case you should avoid using the global `parameters` client option used to
|
19 |
+
set default parameters for every connection created by Predis as this would end
|
20 |
+
up using the same password even when connecting to actual Redis nodes.~~
|
21 |
+
|
22 |
+
- __FIX__: the username is now correctly retrieved from the userinfo fragment of
|
23 |
+
the URI when using the "redis" scheme and a "username:password" pair is present.
|
24 |
+
Values retrieved from the userinfo fragment always override the ones specified
|
25 |
+
in `username` and `password` if those fields are present in the query string.
|
26 |
+
|
27 |
+
- __FIX__: `Predis\Connection\WebdisConnection` was unable to connect to Webdis
|
28 |
+
when using an IPv4 address in the URL and this is probably due to some change in
|
29 |
+
cURL internals since the last time we tested it.
|
30 |
+
|
31 |
+
- __FIX__: an exception is thrown whe passing `FALSE` or any value evaluating to
|
32 |
+
`FALSE` to the `replication` client option. This was supposed to be unsupported,
|
33 |
+
in fact it actually breaks client initialization and raises a PHP warning. Now
|
34 |
+
the user is alerted with an `InvalidArgumentException` and a proper message.
|
35 |
+
(PR #381).
|
36 |
+
|
37 |
+
|
38 |
v1.1.4 (2020-08-31)
|
39 |
================================================================================
|
40 |
|
dependencies/predis/predis/VERSION
CHANGED
@@ -1 +1 @@
|
|
1 |
-
1.1.
|
1 |
+
1.1.6
|
dependencies/predis/predis/package.ini
CHANGED
@@ -10,7 +10,7 @@ name = "Predis"
|
|
10 |
desc = "Flexible and feature-complete Redis client for PHP and HHVM"
|
11 |
homepage = "http://github.com/nrk/predis"
|
12 |
license = "MIT"
|
13 |
-
version = "1.1.
|
14 |
stability = "stable"
|
15 |
channel = "pear.nrk.io"
|
16 |
|
10 |
desc = "Flexible and feature-complete Redis client for PHP and HHVM"
|
11 |
homepage = "http://github.com/nrk/predis"
|
12 |
license = "MIT"
|
13 |
+
version = "1.1.6"
|
14 |
stability = "stable"
|
15 |
channel = "pear.nrk.io"
|
16 |
|
dependencies/predis/predis/src/Client.php
CHANGED
@@ -40,7 +40,7 @@ use Predis\Transaction\MultiExec as MultiExecTransaction;
|
|
40 |
*/
|
41 |
class Client implements ClientInterface, \IteratorAggregate
|
42 |
{
|
43 |
-
const VERSION = '1.1.
|
44 |
|
45 |
protected $connection;
|
46 |
protected $options;
|
40 |
*/
|
41 |
class Client implements ClientInterface, \IteratorAggregate
|
42 |
{
|
43 |
+
const VERSION = '1.1.6';
|
44 |
|
45 |
protected $connection;
|
46 |
protected $options;
|
dependencies/predis/predis/src/ClientContextInterface.php
CHANGED
@@ -118,7 +118,7 @@ use Predis\Command\CommandInterface;
|
|
118 |
* @method $this zremrangebyrank($key, $start, $stop)
|
119 |
* @method $this zremrangebyscore($key, $min, $max)
|
120 |
* @method $this zrevrange($key, $start, $stop, array $options = null)
|
121 |
-
* @method $this zrevrangebyscore($key, $
|
122 |
* @method $this zrevrank($key, $member)
|
123 |
* @method $this zunionstore($destination, array|string $keys, array $options = null)
|
124 |
* @method $this zscore($key, $member)
|
118 |
* @method $this zremrangebyrank($key, $start, $stop)
|
119 |
* @method $this zremrangebyscore($key, $min, $max)
|
120 |
* @method $this zrevrange($key, $start, $stop, array $options = null)
|
121 |
+
* @method $this zrevrangebyscore($key, $max, $min, array $options = null)
|
122 |
* @method $this zrevrank($key, $member)
|
123 |
* @method $this zunionstore($destination, array|string $keys, array $options = null)
|
124 |
* @method $this zscore($key, $member)
|
dependencies/predis/predis/src/Configuration/ReplicationOption.php
CHANGED
@@ -36,10 +36,6 @@ class ReplicationOption implements OptionInterface
|
|
36 |
return $value;
|
37 |
}
|
38 |
|
39 |
-
if (is_bool($value) || $value === null) {
|
40 |
-
return $value ? $this->getDefault($options) : null;
|
41 |
-
}
|
42 |
-
|
43 |
if ($value === 'sentinel') {
|
44 |
return function ($sentinels, $options) {
|
45 |
return new SentinelReplication($options->service, $sentinels, $options->connections);
|
@@ -50,7 +46,13 @@ class ReplicationOption implements OptionInterface
|
|
50 |
!is_object($value) &&
|
51 |
null !== $asbool = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)
|
52 |
) {
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
throw new \InvalidArgumentException(
|
36 |
return $value;
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
39 |
if ($value === 'sentinel') {
|
40 |
return function ($sentinels, $options) {
|
41 |
return new SentinelReplication($options->service, $sentinels, $options->connections);
|
46 |
!is_object($value) &&
|
47 |
null !== $asbool = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)
|
48 |
) {
|
49 |
+
if (true === $asbool) {
|
50 |
+
return $this->getDefault($options);
|
51 |
+
} else {
|
52 |
+
throw new \InvalidArgumentException(
|
53 |
+
"Values evaluating to FALSE are not accepted for `replication`"
|
54 |
+
);
|
55 |
+
}
|
56 |
}
|
57 |
|
58 |
throw new \InvalidArgumentException(
|
dependencies/predis/predis/src/Connection/Aggregate/SentinelReplication.php
CHANGED
@@ -239,9 +239,14 @@ class SentinelReplication implements ReplicationInterface
|
|
239 |
}
|
240 |
|
241 |
if (is_array($parameters)) {
|
242 |
-
//
|
243 |
-
//
|
|
|
|
|
|
|
|
|
244 |
$parameters['database'] = null;
|
|
|
245 |
$parameters['password'] = null;
|
246 |
|
247 |
if (!isset($parameters['timeout'])) {
|
239 |
}
|
240 |
|
241 |
if (is_array($parameters)) {
|
242 |
+
// NOTE: sentinels do not accept AUTH and SELECT commands so we must
|
243 |
+
// explicitly set them to NULL to avoid problems when using default
|
244 |
+
// parameters set via client options. Actually AUTH is supported for
|
245 |
+
// sentinels starting with Redis 5 but we have to differentiate from
|
246 |
+
// sentinels passwords and nodes passwords, this will be implemented
|
247 |
+
// in a later release.
|
248 |
$parameters['database'] = null;
|
249 |
+
$parameters['username'] = null;
|
250 |
$parameters['password'] = null;
|
251 |
|
252 |
if (!isset($parameters['timeout'])) {
|
dependencies/predis/predis/src/Connection/Parameters.php
CHANGED
@@ -109,8 +109,17 @@ class Parameters implements ParametersInterface
|
|
109 |
}
|
110 |
|
111 |
if (stripos($uri, 'redis') === 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
if (isset($parsed['pass'])) {
|
113 |
-
|
|
|
|
|
114 |
unset($parsed['pass']);
|
115 |
}
|
116 |
|
109 |
}
|
110 |
|
111 |
if (stripos($uri, 'redis') === 0) {
|
112 |
+
if (isset($parsed['user'])) {
|
113 |
+
if (strlen($parsed['user'])) {
|
114 |
+
$parsed['username'] = $parsed['user'];
|
115 |
+
}
|
116 |
+
unset($parsed['user']);
|
117 |
+
}
|
118 |
+
|
119 |
if (isset($parsed['pass'])) {
|
120 |
+
if (strlen($parsed['pass'])) {
|
121 |
+
$parsed['password'] = $parsed['pass'];
|
122 |
+
}
|
123 |
unset($parsed['pass']);
|
124 |
}
|
125 |
|
dependencies/predis/predis/src/Connection/PhpiredisStreamConnection.php
CHANGED
@@ -87,9 +87,23 @@ class PhpiredisStreamConnection extends StreamConnection
|
|
87 |
/**
|
88 |
* {@inheritdoc}
|
89 |
*/
|
90 |
-
protected function
|
91 |
{
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
/**
|
87 |
/**
|
88 |
* {@inheritdoc}
|
89 |
*/
|
90 |
+
protected function assertParameters(ParametersInterface $parameters)
|
91 |
{
|
92 |
+
switch ($parameters->scheme) {
|
93 |
+
case 'tcp':
|
94 |
+
case 'redis':
|
95 |
+
case 'unix':
|
96 |
+
break;
|
97 |
+
|
98 |
+
case 'tls':
|
99 |
+
case 'rediss':
|
100 |
+
throw new \InvalidArgumentException('SSL encryption is not supported by this connection backend.');
|
101 |
+
|
102 |
+
default:
|
103 |
+
throw new \InvalidArgumentException("Invalid scheme: '$parameters->scheme'.");
|
104 |
+
}
|
105 |
+
|
106 |
+
return $parameters;
|
107 |
}
|
108 |
|
109 |
/**
|
dependencies/predis/predis/src/Connection/WebdisConnection.php
CHANGED
@@ -119,7 +119,7 @@ class WebdisConnection implements NodeConnectionInterface
|
|
119 |
$parameters = $this->getParameters();
|
120 |
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0) * 1000;
|
121 |
|
122 |
-
if (filter_var($host = $parameters->host, FILTER_VALIDATE_IP)) {
|
123 |
$host = "[$host]";
|
124 |
}
|
125 |
|
119 |
$parameters = $this->getParameters();
|
120 |
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0) * 1000;
|
121 |
|
122 |
+
if (filter_var($host = $parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
123 |
$host = "[$host]";
|
124 |
}
|
125 |
|
includes/class-plugin.php
CHANGED
@@ -69,7 +69,6 @@ class Plugin {
|
|
69 |
private function __construct() {
|
70 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
71 |
|
72 |
-
load_plugin_textdomain( 'redis-cache', false, 'redis-cache/languages' );
|
73 |
register_activation_hook( WP_REDIS_FILE, 'wp_cache_flush' );
|
74 |
|
75 |
if ( is_multisite() ) {
|
@@ -81,10 +80,6 @@ class Plugin {
|
|
81 |
}
|
82 |
|
83 |
$this->add_actions_and_filters();
|
84 |
-
|
85 |
-
if ( is_admin() && ! wp_next_scheduled( 'rediscache_discard_metrics' ) ) {
|
86 |
-
wp_schedule_event( time(), 'hourly', 'rediscache_discard_metrics' );
|
87 |
-
}
|
88 |
}
|
89 |
|
90 |
/**
|
@@ -95,13 +90,12 @@ class Plugin {
|
|
95 |
public function add_actions_and_filters() {
|
96 |
add_action( 'deactivate_plugin', [ $this, 'on_deactivation' ] );
|
97 |
add_action( 'admin_init', [ $this, 'maybe_update_dropin' ] );
|
|
|
98 |
|
99 |
add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', [ $this, 'add_admin_menu_page' ] );
|
100 |
|
101 |
add_action( 'admin_notices', [ $this, 'show_admin_notices' ] );
|
102 |
add_action( 'network_admin_notices', [ $this, 'show_admin_notices' ] );
|
103 |
-
add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
|
104 |
-
|
105 |
|
106 |
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_styles' ] );
|
107 |
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] );
|
@@ -125,6 +119,19 @@ class Plugin {
|
|
125 |
add_filter( 'qm/outputter/html', [ $this, 'register_qm_output' ] );
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
/**
|
129 |
* Adds a submenu page to "Settings"
|
130 |
*
|
@@ -146,29 +153,6 @@ class Plugin {
|
|
146 |
*
|
147 |
* @return void
|
148 |
*/
|
149 |
-
public function add_admin_bar_menu( $wp_admin_bar ) {
|
150 |
-
if ( ! current_user_can( is_multisite() ? 'manage_network_options' : 'manage_options' ) ) {
|
151 |
-
return;
|
152 |
-
}
|
153 |
-
|
154 |
-
if ( ! $this->get_redis_status() ) {
|
155 |
-
return;
|
156 |
-
}
|
157 |
-
|
158 |
-
if ( ! defined( 'WP_REDIS_DISABLE_ADMINBAR' ) || WP_REDIS_DISABLE_ADMINBAR ) {
|
159 |
-
return;
|
160 |
-
}
|
161 |
-
|
162 |
-
$wp_admin_bar->add_node( [
|
163 |
-
'id' => 'redis-cache-flush',
|
164 |
-
'title' => __( 'Flush Object Cache', 'redis-cache' ),
|
165 |
-
'href' => $this->action_link( 'flush-cache' ),
|
166 |
-
'meta' => [
|
167 |
-
'title' => __( 'Flush the Redis object cache', 'redis-cache' ),
|
168 |
-
],
|
169 |
-
] );
|
170 |
-
}
|
171 |
-
|
172 |
public function show_admin_page() {
|
173 |
// Request filesystem credentials?
|
174 |
if ( isset( $_GET['_wpnonce'], $_GET['action'] ) ) {
|
@@ -364,9 +348,13 @@ class Plugin {
|
|
364 |
}
|
365 |
|
366 |
try {
|
|
|
|
|
|
|
|
|
367 |
$metrics = $wp_object_cache->redis_instance()->zrangebyscore(
|
368 |
$wp_object_cache->build_key( 'metrics', 'redis-cache' ),
|
369 |
-
time() -
|
370 |
time() - MINUTE_IN_SECONDS,
|
371 |
[ 'withscores' => true ]
|
372 |
);
|
@@ -596,8 +584,6 @@ class Plugin {
|
|
596 |
$message = sprintf( __( 'The Redis object cache drop-in is outdated. Please <a href="%s">update the drop-in</a>.', 'redis-cache' ), $url );
|
597 |
}
|
598 |
} else {
|
599 |
-
// Ignore Pro version !!!
|
600 |
-
|
601 |
// translators: %s = Action link to update the drop-in.
|
602 |
$message = sprintf( __( 'A foreign object cache drop-in was found. To use Redis for object caching, please <a href="%s">enable the drop-in</a>.', 'redis-cache' ), $url );
|
603 |
}
|
@@ -926,7 +912,7 @@ class Plugin {
|
|
926 |
$wp_object_cache->redis_instance()->zremrangebyscore(
|
927 |
$wp_object_cache->build_key( 'metrics', 'redis-cache' ),
|
928 |
0,
|
929 |
-
time() -
|
930 |
);
|
931 |
} catch ( Exception $exception ) {
|
932 |
error_log( $exception ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
|
@@ -994,6 +980,19 @@ class Plugin {
|
|
994 |
);
|
995 |
}
|
996 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
997 |
/**
|
998 |
* Initializes the WP filesystem API to be ready for use
|
999 |
*
|
69 |
private function __construct() {
|
70 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
71 |
|
|
|
72 |
register_activation_hook( WP_REDIS_FILE, 'wp_cache_flush' );
|
73 |
|
74 |
if ( is_multisite() ) {
|
80 |
}
|
81 |
|
82 |
$this->add_actions_and_filters();
|
|
|
|
|
|
|
|
|
83 |
}
|
84 |
|
85 |
/**
|
90 |
public function add_actions_and_filters() {
|
91 |
add_action( 'deactivate_plugin', [ $this, 'on_deactivation' ] );
|
92 |
add_action( 'admin_init', [ $this, 'maybe_update_dropin' ] );
|
93 |
+
add_action( 'init', [ $this, 'init' ] );
|
94 |
|
95 |
add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', [ $this, 'add_admin_menu_page' ] );
|
96 |
|
97 |
add_action( 'admin_notices', [ $this, 'show_admin_notices' ] );
|
98 |
add_action( 'network_admin_notices', [ $this, 'show_admin_notices' ] );
|
|
|
|
|
99 |
|
100 |
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_styles' ] );
|
101 |
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] );
|
119 |
add_filter( 'qm/outputter/html', [ $this, 'register_qm_output' ] );
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* Callback of the `init` hook.
|
124 |
+
*
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
public function init() {
|
128 |
+
load_plugin_textdomain( 'redis-cache', false, 'redis-cache/languages' );
|
129 |
+
|
130 |
+
if ( is_admin() && ! wp_next_scheduled( 'rediscache_discard_metrics' ) ) {
|
131 |
+
wp_schedule_event( time(), 'hourly', 'rediscache_discard_metrics' );
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
/**
|
136 |
* Adds a submenu page to "Settings"
|
137 |
*
|
153 |
*
|
154 |
* @return void
|
155 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
public function show_admin_page() {
|
157 |
// Request filesystem credentials?
|
158 |
if ( isset( $_GET['_wpnonce'], $_GET['action'] ) ) {
|
348 |
}
|
349 |
|
350 |
try {
|
351 |
+
$min_time = $screen->id === $this->screen
|
352 |
+
? self::metrics_max_time()
|
353 |
+
: MINUTE_IN_SECONDS * 30;
|
354 |
+
|
355 |
$metrics = $wp_object_cache->redis_instance()->zrangebyscore(
|
356 |
$wp_object_cache->build_key( 'metrics', 'redis-cache' ),
|
357 |
+
time() - $min_time,
|
358 |
time() - MINUTE_IN_SECONDS,
|
359 |
[ 'withscores' => true ]
|
360 |
);
|
584 |
$message = sprintf( __( 'The Redis object cache drop-in is outdated. Please <a href="%s">update the drop-in</a>.', 'redis-cache' ), $url );
|
585 |
}
|
586 |
} else {
|
|
|
|
|
587 |
// translators: %s = Action link to update the drop-in.
|
588 |
$message = sprintf( __( 'A foreign object cache drop-in was found. To use Redis for object caching, please <a href="%s">enable the drop-in</a>.', 'redis-cache' ), $url );
|
589 |
}
|
912 |
$wp_object_cache->redis_instance()->zremrangebyscore(
|
913 |
$wp_object_cache->build_key( 'metrics', 'redis-cache' ),
|
914 |
0,
|
915 |
+
time() - self::metrics_max_time()
|
916 |
);
|
917 |
} catch ( Exception $exception ) {
|
918 |
error_log( $exception ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
|
980 |
);
|
981 |
}
|
982 |
|
983 |
+
/**
|
984 |
+
* Retrieves metrix max time
|
985 |
+
*
|
986 |
+
* @return int
|
987 |
+
*/
|
988 |
+
public static function metrics_max_time() {
|
989 |
+
if ( defined( 'WP_REDIS_METRICS_MAX_TIME' ) ) {
|
990 |
+
return intval( WP_REDIS_METRICS_MAX_TIME );
|
991 |
+
}
|
992 |
+
|
993 |
+
return HOUR_IN_SECONDS;
|
994 |
+
}
|
995 |
+
|
996 |
/**
|
997 |
* Initializes the WP filesystem API to be ready for use
|
998 |
*
|
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.
|
7 |
* Author: Till Krüss
|
8 |
* Author URI: https://objectcache.pro
|
9 |
* License: GPLv3
|
@@ -152,6 +152,14 @@ function wp_cache_incr( $key, $offset = 1, $group = '' ) {
|
|
152 |
function wp_cache_init() {
|
153 |
global $wp_object_cache;
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
// Backwards compatibility: map `WP_CACHE_KEY_SALT` constant to `WP_REDIS_PREFIX`.
|
156 |
if ( defined( 'WP_CACHE_KEY_SALT' ) && ! defined( 'WP_REDIS_PREFIX' ) ) {
|
157 |
define( 'WP_REDIS_PREFIX', WP_CACHE_KEY_SALT );
|
@@ -742,7 +750,7 @@ class WP_Object_Cache {
|
|
742 |
$is_cluster = defined( 'WP_REDIS_CLUSTER' );
|
743 |
$clients = $is_cluster ? WP_REDIS_CLUSTER : WP_REDIS_SERVERS;
|
744 |
|
745 |
-
foreach ( $clients as $index =>
|
746 |
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
|
747 |
$url_components = parse_url( $connection_string );
|
748 |
|
@@ -758,12 +766,12 @@ class WP_Object_Cache {
|
|
758 |
$add_params['alias'] = "redis-$index";
|
759 |
}
|
760 |
|
761 |
-
$
|
762 |
}
|
763 |
|
764 |
$this->redis = new Credis_Cluster( $clients );
|
765 |
|
766 |
-
foreach ( $clients as
|
767 |
$connection_string = "{$_client['scheme']}://{$_client['host']}:{$_client['port']}";
|
768 |
unset( $_client['scheme'], $_client['host'], $_client['port'] );
|
769 |
|
@@ -773,7 +781,7 @@ class WP_Object_Cache {
|
|
773 |
$connection_string .= '?' . http_build_query( $params, null, '&' );
|
774 |
}
|
775 |
|
776 |
-
$
|
777 |
}
|
778 |
|
779 |
$args['servers'] = $clients;
|
@@ -1743,8 +1751,6 @@ LUA;
|
|
1743 |
);
|
1744 |
|
1745 |
return (object) [
|
1746 |
-
// Connected, Disabled, Unknown, Not connected
|
1747 |
-
'status' => '...',
|
1748 |
'hits' => $this->cache_hits,
|
1749 |
'misses' => $this->cache_misses,
|
1750 |
'ratio' => $total > 0 ? round( $this->cache_hits / ( $total / 100 ), 1 ) : 100,
|
@@ -1773,10 +1779,18 @@ LUA;
|
|
1773 |
* @return string
|
1774 |
*/
|
1775 |
public function build_key( $key, $group = 'default' ) {
|
|
|
|
|
1776 |
if ( empty( $group ) ) {
|
1777 |
$group = 'default';
|
1778 |
}
|
1779 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1780 |
$salt = defined( 'WP_REDIS_PREFIX' ) ? trim( WP_REDIS_PREFIX ) : '';
|
1781 |
$prefix = $this->is_global_group( $group ) ? $this->global_prefix : $this->blog_prefix;
|
1782 |
|
@@ -1785,7 +1799,7 @@ LUA;
|
|
1785 |
|
1786 |
$prefix = trim( $prefix, '_-:$' );
|
1787 |
|
1788 |
-
return "{$salt}{$prefix}:{$group}:{$key}";
|
1789 |
}
|
1790 |
|
1791 |
/**
|
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.14
|
7 |
* Author: Till Krüss
|
8 |
* Author URI: https://objectcache.pro
|
9 |
* License: GPLv3
|
152 |
function wp_cache_init() {
|
153 |
global $wp_object_cache;
|
154 |
|
155 |
+
if ( ! defined( 'WP_REDIS_PREFIX' ) && getenv( 'WP_REDIS_PREFIX' ) ) {
|
156 |
+
define( 'WP_REDIS_PREFIX', getenv( 'WP_REDIS_PREFIX' ) );
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( ! defined( 'WP_REDIS_SELECTIVE_FLUSH' ) && getenv( 'WP_REDIS_SELECTIVE_FLUSH' ) ) {
|
160 |
+
define( 'WP_REDIS_SELECTIVE_FLUSH', (bool) getenv( 'WP_REDIS_SELECTIVE_FLUSH' ) );
|
161 |
+
}
|
162 |
+
|
163 |
// Backwards compatibility: map `WP_CACHE_KEY_SALT` constant to `WP_REDIS_PREFIX`.
|
164 |
if ( defined( 'WP_CACHE_KEY_SALT' ) && ! defined( 'WP_REDIS_PREFIX' ) ) {
|
165 |
define( 'WP_REDIS_PREFIX', WP_CACHE_KEY_SALT );
|
750 |
$is_cluster = defined( 'WP_REDIS_CLUSTER' );
|
751 |
$clients = $is_cluster ? WP_REDIS_CLUSTER : WP_REDIS_SERVERS;
|
752 |
|
753 |
+
foreach ( $clients as $index => $connection_string ) {
|
754 |
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
|
755 |
$url_components = parse_url( $connection_string );
|
756 |
|
766 |
$add_params['alias'] = "redis-$index";
|
767 |
}
|
768 |
|
769 |
+
$clients[ $index ] = array_merge( $parameters, $add_params );
|
770 |
}
|
771 |
|
772 |
$this->redis = new Credis_Cluster( $clients );
|
773 |
|
774 |
+
foreach ( $clients as $index => $_client ) {
|
775 |
$connection_string = "{$_client['scheme']}://{$_client['host']}:{$_client['port']}";
|
776 |
unset( $_client['scheme'], $_client['host'], $_client['port'] );
|
777 |
|
781 |
$connection_string .= '?' . http_build_query( $params, null, '&' );
|
782 |
}
|
783 |
|
784 |
+
$clients[ $index ] = $connection_string;
|
785 |
}
|
786 |
|
787 |
$args['servers'] = $clients;
|
1751 |
);
|
1752 |
|
1753 |
return (object) [
|
|
|
|
|
1754 |
'hits' => $this->cache_hits,
|
1755 |
'misses' => $this->cache_misses,
|
1756 |
'ratio' => $total > 0 ? round( $this->cache_hits / ( $total / 100 ), 1 ) : 100,
|
1779 |
* @return string
|
1780 |
*/
|
1781 |
public function build_key( $key, $group = 'default' ) {
|
1782 |
+
static $keys = [];
|
1783 |
+
|
1784 |
if ( empty( $group ) ) {
|
1785 |
$group = 'default';
|
1786 |
}
|
1787 |
|
1788 |
+
$key_index = "{$key}:{$group}";
|
1789 |
+
|
1790 |
+
if ( isset( $keys[ $key_index ] ) ) {
|
1791 |
+
return $keys[ $key_index ];
|
1792 |
+
}
|
1793 |
+
|
1794 |
$salt = defined( 'WP_REDIS_PREFIX' ) ? trim( WP_REDIS_PREFIX ) : '';
|
1795 |
$prefix = $this->is_global_group( $group ) ? $this->global_prefix : $this->blog_prefix;
|
1796 |
|
1799 |
|
1800 |
$prefix = trim( $prefix, '_-:$' );
|
1801 |
|
1802 |
+
return $keys[ $key_index ] = "{$salt}{$prefix}:{$group}:{$key}";
|
1803 |
}
|
1804 |
|
1805 |
/**
|
includes/ui/diagnostics.php
CHANGED
@@ -77,12 +77,14 @@ $constants = [
|
|
77 |
'WP_REDIS_SHARDS',
|
78 |
'WP_REDIS_SENTINEL',
|
79 |
'WP_REDIS_IGBINARY',
|
|
|
80 |
'WP_REDIS_MAXTTL',
|
81 |
'WP_REDIS_PREFIX',
|
82 |
'WP_CACHE_KEY_SALT',
|
83 |
'WP_REDIS_GLOBAL_GROUPS',
|
84 |
'WP_REDIS_IGNORED_GROUPS',
|
85 |
'WP_REDIS_UNFLUSHABLE_GROUPS',
|
|
|
86 |
];
|
87 |
|
88 |
foreach ( $constants as $constant ) {
|
77 |
'WP_REDIS_SHARDS',
|
78 |
'WP_REDIS_SENTINEL',
|
79 |
'WP_REDIS_IGBINARY',
|
80 |
+
'WP_REDIS_SERIALIZER',
|
81 |
'WP_REDIS_MAXTTL',
|
82 |
'WP_REDIS_PREFIX',
|
83 |
'WP_CACHE_KEY_SALT',
|
84 |
'WP_REDIS_GLOBAL_GROUPS',
|
85 |
'WP_REDIS_IGNORED_GROUPS',
|
86 |
'WP_REDIS_UNFLUSHABLE_GROUPS',
|
87 |
+
'WP_REDIS_METRICS_MAX_TIME',
|
88 |
];
|
89 |
|
90 |
foreach ( $constants as $constant ) {
|
includes/ui/settings.php
CHANGED
@@ -77,22 +77,22 @@ defined( '\\ABSPATH' ) || exit;
|
|
77 |
Object Cache Pro
|
78 |
</h2>
|
79 |
<p>
|
80 |
-
<
|
81 |
</p>
|
82 |
<ul>
|
83 |
-
<li
|
84 |
-
<li
|
85 |
-
<li
|
86 |
-
<li
|
87 |
-
<li
|
88 |
-
<li
|
89 |
-
<li
|
90 |
-
<li
|
91 |
-
<li
|
92 |
</ul>
|
93 |
<p>
|
94 |
<a class="button button-primary" target="_blank" rel="noopener" href="https://objectcache.pro/?utm_source=wp-plugin&utm_medium=settings">
|
95 |
-
Learn more
|
96 |
</a>
|
97 |
</p>
|
98 |
</div>
|
77 |
Object Cache Pro
|
78 |
</h2>
|
79 |
<p>
|
80 |
+
<?php wp_kses_post( __( '<strong>A business class object cache backend.</strong> Truly reliable, highly-optimized and fully customizable, with a <u>dedicated engineer</u> when you most need it.', 'redis-cache' ) ); ?>
|
81 |
</p>
|
82 |
<ul>
|
83 |
+
<li><?php esc_html_e( 'Rewritten for raw performance', 'redis-cache' ); ?></li>
|
84 |
+
<li><?php esc_html_e( '100% WordPress API compliant', 'redis-cache' ); ?></li>
|
85 |
+
<li><?php esc_html_e( 'Faster serialization and compression', 'redis-cache' ); ?></li>
|
86 |
+
<li><?php esc_html_e( 'Easy debugging & logging', 'redis-cache' ); ?></li>
|
87 |
+
<li><?php esc_html_e( 'Cache analytics and preloading', 'redis-cache' ); ?></li>
|
88 |
+
<li><?php esc_html_e( 'Fully unit tested (100% code coverage)', 'redis-cache' ); ?></li>
|
89 |
+
<li><?php esc_html_e( 'Secure connections with TLS', 'redis-cache' ); ?></li>
|
90 |
+
<li><?php esc_html_e( 'Health checks via WordPress & WP CLI', 'redis-cache' ); ?></li>
|
91 |
+
<li><?php esc_html_e( 'Optimized for WooCommerce, Jetpack & Yoast SEO', 'redis-cache' ); ?></li>
|
92 |
</ul>
|
93 |
<p>
|
94 |
<a class="button button-primary" target="_blank" rel="noopener" href="https://objectcache.pro/?utm_source=wp-plugin&utm_medium=settings">
|
95 |
+
<?php esc_html_e( 'Learn more', 'redis-cache' ); ?>
|
96 |
</a>
|
97 |
</p>
|
98 |
</div>
|
languages/redis-cache.pot
CHANGED
@@ -2,21 +2,21 @@
|
|
2 |
# This file is distributed under the GPLv3.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Redis Object Cache 2.0.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/redis-cache\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: redis-cache\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
18 |
-
#: includes/class-plugin.php:
|
19 |
-
#: includes/class-plugin.php:
|
20 |
#: includes/ui/settings.php:18
|
21 |
msgid "Redis Object Cache"
|
22 |
msgstr ""
|
@@ -37,181 +37,181 @@ msgstr ""
|
|
37 |
msgid "https://objectcache.pro"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: includes/class-plugin.php:
|
41 |
msgid "Redis"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: includes/class-plugin.php:
|
45 |
#: includes/ui/tabs/overview.php:20
|
46 |
msgid "Overview"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: includes/class-plugin.php:
|
50 |
msgid "Metrics"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: includes/class-plugin.php:
|
54 |
msgid "Diagnostics"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: includes/class-plugin.php:
|
58 |
msgid "Settings"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: includes/class-plugin.php:
|
62 |
#: includes/ui/tabs/metrics.php:17
|
63 |
#: includes/ui/widget.php:16
|
64 |
msgid "Time"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: includes/class-plugin.php:
|
68 |
#: includes/ui/tabs/metrics.php:22
|
69 |
#: includes/ui/widget.php:21
|
70 |
msgid "Bytes"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: includes/class-plugin.php:
|
74 |
#: includes/ui/tabs/metrics.php:27
|
75 |
#: includes/ui/widget.php:26
|
76 |
msgid "Ratio"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: includes/class-plugin.php:
|
80 |
#: includes/ui/tabs/metrics.php:32
|
81 |
#: includes/ui/widget.php:31
|
82 |
msgid "Calls"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: includes/class-plugin.php:
|
86 |
msgid "Not enough data collected, yet."
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: includes/class-plugin.php:
|
90 |
msgid "Enable object cache to collect data."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: includes/class-plugin.php:
|
94 |
#: includes/class-qm-collector.php:66
|
95 |
msgid "Disabled"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: includes/class-plugin.php:
|
99 |
msgid "Drop-in not installed"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: includes/class-plugin.php:
|
103 |
msgid "Drop-in is invalid"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: includes/class-plugin.php:
|
107 |
msgid "Connected"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: includes/class-plugin.php:
|
111 |
msgid "Not connected"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: includes/class-plugin.php:
|
115 |
#: includes/ui/tabs/overview.php:229
|
116 |
msgid "Unknown"
|
117 |
msgstr ""
|
118 |
|
119 |
#. translators: %s = Action link to update the drop-in.
|
120 |
-
#: includes/class-plugin.php:
|
121 |
msgid "The Redis object cache drop-in is outdated. Please <a href=\"%s\">update the drop-in</a>."
|
122 |
msgstr ""
|
123 |
|
124 |
#. translators: %s = Action link to update the drop-in.
|
125 |
-
#: includes/class-plugin.php:
|
126 |
msgid "A foreign object cache drop-in was found. To use Redis for object caching, please <a href=\"%s\">enable the drop-in</a>."
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: includes/class-plugin.php:
|
130 |
msgid "Object cache flushed."
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: includes/class-plugin.php:
|
134 |
msgid "Object cache could not be flushed."
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: includes/class-plugin.php:
|
138 |
#: includes/cli/class-commands.php:74
|
139 |
msgid "Object cache enabled."
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: includes/class-plugin.php:
|
143 |
#: includes/cli/class-commands.php:76
|
144 |
msgid "Object cache could not be enabled."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: includes/class-plugin.php:
|
148 |
#: includes/cli/class-commands.php:113
|
149 |
msgid "Object cache disabled."
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: includes/class-plugin.php:
|
153 |
#: includes/cli/class-commands.php:115
|
154 |
msgid "Object cache could not be disabled."
|
155 |
msgstr ""
|
156 |
|
157 |
-
#: includes/class-plugin.php:
|
158 |
#: includes/cli/class-commands.php:147
|
159 |
msgid "Updated object cache drop-in and enabled Redis object cache."
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: includes/class-plugin.php:
|
163 |
#: includes/cli/class-commands.php:149
|
164 |
msgid "Object cache drop-in could not be updated."
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: includes/class-plugin.php:
|
168 |
msgid "Object Cache Pro is out!"
|
169 |
msgstr ""
|
170 |
|
171 |
#. translators: %s = Link to the plugin setting screen.
|
172 |
-
#: includes/class-plugin.php:
|
173 |
msgid "A <u>business class</u> object cache backend. Truly reliable, highly-optimized and fully customizable, with a <u>dedicated engineer</u> when you most need it. <a href=\"%s\">Learn more »</a>"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: includes/class-plugin.php:
|
177 |
msgid "Object Cache Pro + WooCommerce = ❤️"
|
178 |
msgstr ""
|
179 |
|
180 |
#. translators: %s = Link to the plugin's settings screen.
|
181 |
-
#: includes/class-plugin.php:
|
182 |
msgid "Object 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=\"%s\">Learn more »</a>"
|
183 |
msgstr ""
|
184 |
|
185 |
#. translators: %1$d = number of objects. %2$s = human-readable size of cache. %3$s = name of the used client.
|
186 |
-
#: includes/class-plugin.php:
|
187 |
msgid "Retrieved %1$d objects (%2$s) from Redis using %3$s."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: includes/class-plugin.php:
|
191 |
msgid "Could not initialize filesystem."
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: includes/class-plugin.php:
|
195 |
msgid "Object cache file doesn’t exist."
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: includes/class-plugin.php:
|
199 |
msgid "Test file exists, but couldn’t be deleted."
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: includes/class-plugin.php:
|
203 |
msgid "Failed to copy test file."
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: includes/class-plugin.php:
|
207 |
msgid "Copied test file doesn’t exist."
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: includes/class-plugin.php:
|
211 |
msgid "Couldn’t verify test file contents."
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: includes/class-plugin.php:
|
215 |
msgid "Copied test file couldn’t be deleted."
|
216 |
msgstr ""
|
217 |
|
@@ -246,7 +246,7 @@ msgid "No object cache drop-in found."
|
|
246 |
msgstr ""
|
247 |
|
248 |
#. translators: %s = Tab label.
|
249 |
-
#: includes/ui/class-tab.php:
|
250 |
msgid "%s are disabled for this site."
|
251 |
msgstr ""
|
252 |
|
@@ -294,6 +294,50 @@ msgstr ""
|
|
294 |
msgid "Resources"
|
295 |
msgstr ""
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
#: includes/ui/settings.php:108
|
298 |
msgid "Your site meets the system requirements for the Pro version."
|
299 |
msgstr ""
|
2 |
# This file is distributed under the GPLv3.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Redis Object Cache 2.0.14\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/redis-cache\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-09-24T23:36:57+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: redis-cache\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
18 |
+
#: includes/class-plugin.php:143
|
19 |
+
#: includes/class-plugin.php:211
|
20 |
#: includes/ui/settings.php:18
|
21 |
msgid "Redis Object Cache"
|
22 |
msgstr ""
|
37 |
msgid "https://objectcache.pro"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: includes/class-plugin.php:144
|
41 |
msgid "Redis"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: includes/class-plugin.php:180
|
45 |
#: includes/ui/tabs/overview.php:20
|
46 |
msgid "Overview"
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: includes/class-plugin.php:186
|
50 |
msgid "Metrics"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: includes/class-plugin.php:192
|
54 |
msgid "Diagnostics"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: includes/class-plugin.php:233
|
58 |
msgid "Settings"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: includes/class-plugin.php:304
|
62 |
#: includes/ui/tabs/metrics.php:17
|
63 |
#: includes/ui/widget.php:16
|
64 |
msgid "Time"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: includes/class-plugin.php:305
|
68 |
#: includes/ui/tabs/metrics.php:22
|
69 |
#: includes/ui/widget.php:21
|
70 |
msgid "Bytes"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: includes/class-plugin.php:306
|
74 |
#: includes/ui/tabs/metrics.php:27
|
75 |
#: includes/ui/widget.php:26
|
76 |
msgid "Ratio"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: includes/class-plugin.php:307
|
80 |
#: includes/ui/tabs/metrics.php:32
|
81 |
#: includes/ui/widget.php:31
|
82 |
msgid "Calls"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: includes/class-plugin.php:308
|
86 |
msgid "Not enough data collected, yet."
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: includes/class-plugin.php:309
|
90 |
msgid "Enable object cache to collect data."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: includes/class-plugin.php:453
|
94 |
#: includes/class-qm-collector.php:66
|
95 |
msgid "Disabled"
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: includes/class-plugin.php:457
|
99 |
msgid "Drop-in not installed"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: includes/class-plugin.php:461
|
103 |
msgid "Drop-in is invalid"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: includes/class-plugin.php:466
|
107 |
msgid "Connected"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: includes/class-plugin.php:467
|
111 |
msgid "Not connected"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: includes/class-plugin.php:470
|
115 |
#: includes/ui/tabs/overview.php:229
|
116 |
msgid "Unknown"
|
117 |
msgstr ""
|
118 |
|
119 |
#. translators: %s = Action link to update the drop-in.
|
120 |
+
#: includes/class-plugin.php:584
|
121 |
msgid "The Redis object cache drop-in is outdated. Please <a href=\"%s\">update the drop-in</a>."
|
122 |
msgstr ""
|
123 |
|
124 |
#. translators: %s = Action link to update the drop-in.
|
125 |
+
#: includes/class-plugin.php:588
|
126 |
msgid "A foreign object cache drop-in was found. To use Redis for object caching, please <a href=\"%s\">enable the drop-in</a>."
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: includes/class-plugin.php:624
|
130 |
msgid "Object cache flushed."
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: includes/class-plugin.php:630
|
134 |
msgid "Object cache could not be flushed."
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: includes/class-plugin.php:658
|
138 |
#: includes/cli/class-commands.php:74
|
139 |
msgid "Object cache enabled."
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: includes/class-plugin.php:664
|
143 |
#: includes/cli/class-commands.php:76
|
144 |
msgid "Object cache could not be enabled."
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: includes/class-plugin.php:684
|
148 |
#: includes/cli/class-commands.php:113
|
149 |
msgid "Object cache disabled."
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: includes/class-plugin.php:690
|
153 |
#: includes/cli/class-commands.php:115
|
154 |
msgid "Object cache could not be disabled."
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: includes/class-plugin.php:715
|
158 |
#: includes/cli/class-commands.php:147
|
159 |
msgid "Updated object cache drop-in and enabled Redis object cache."
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: includes/class-plugin.php:721
|
163 |
#: includes/cli/class-commands.php:149
|
164 |
msgid "Object cache drop-in could not be updated."
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: includes/class-plugin.php:788
|
168 |
msgid "Object Cache Pro is out!"
|
169 |
msgstr ""
|
170 |
|
171 |
#. translators: %s = Link to the plugin setting screen.
|
172 |
+
#: includes/class-plugin.php:791
|
173 |
msgid "A <u>business class</u> object cache backend. Truly reliable, highly-optimized and fully customizable, with a <u>dedicated engineer</u> when you most need it. <a href=\"%s\">Learn more »</a>"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: includes/class-plugin.php:828
|
177 |
msgid "Object Cache Pro + WooCommerce = ❤️"
|
178 |
msgstr ""
|
179 |
|
180 |
#. translators: %s = Link to the plugin's settings screen.
|
181 |
+
#: includes/class-plugin.php:831
|
182 |
msgid "Object 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=\"%s\">Learn more »</a>"
|
183 |
msgstr ""
|
184 |
|
185 |
#. translators: %1$d = number of objects. %2$s = human-readable size of cache. %3$s = name of the used client.
|
186 |
+
#: includes/class-plugin.php:970
|
187 |
msgid "Retrieved %1$d objects (%2$s) from Redis using %3$s."
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: includes/class-plugin.php:1040
|
191 |
msgid "Could not initialize filesystem."
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: includes/class-plugin.php:1047
|
195 |
msgid "Object cache file doesn’t exist."
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: includes/class-plugin.php:1052
|
199 |
msgid "Test file exists, but couldn’t be deleted."
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: includes/class-plugin.php:1057
|
203 |
msgid "Failed to copy test file."
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: includes/class-plugin.php:1061
|
207 |
msgid "Copied test file doesn’t exist."
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: includes/class-plugin.php:1067
|
211 |
msgid "Couldn’t verify test file contents."
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: includes/class-plugin.php:1071
|
215 |
msgid "Copied test file couldn’t be deleted."
|
216 |
msgstr ""
|
217 |
|
246 |
msgstr ""
|
247 |
|
248 |
#. translators: %s = Tab label.
|
249 |
+
#: includes/ui/class-tab.php:154
|
250 |
msgid "%s are disabled for this site."
|
251 |
msgstr ""
|
252 |
|
294 |
msgid "Resources"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: includes/ui/settings.php:80
|
298 |
+
msgid "<strong>A business class object cache backend.</strong> Truly reliable, highly-optimized and fully customizable, with a <u>dedicated engineer</u> when you most need it."
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: includes/ui/settings.php:83
|
302 |
+
msgid "Rewritten for raw performance"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: includes/ui/settings.php:84
|
306 |
+
msgid "100% WordPress API compliant"
|
307 |
+
msgstr ""
|
308 |
+
|
309 |
+
#: includes/ui/settings.php:85
|
310 |
+
msgid "Faster serialization and compression"
|
311 |
+
msgstr ""
|
312 |
+
|
313 |
+
#: includes/ui/settings.php:86
|
314 |
+
msgid "Easy debugging & logging"
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: includes/ui/settings.php:87
|
318 |
+
msgid "Cache analytics and preloading"
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
#: includes/ui/settings.php:88
|
322 |
+
msgid "Fully unit tested (100% code coverage)"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: includes/ui/settings.php:89
|
326 |
+
msgid "Secure connections with TLS"
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: includes/ui/settings.php:90
|
330 |
+
msgid "Health checks via WordPress & WP CLI"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: includes/ui/settings.php:91
|
334 |
+
msgid "Optimized for WooCommerce, Jetpack & Yoast SEO"
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: includes/ui/settings.php:95
|
338 |
+
msgid "Learn more"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
#: includes/ui/settings.php:108
|
342 |
msgid "Your site meets the system requirements for the Pro version."
|
343 |
msgstr ""
|
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.5
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 2.0.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -83,12 +83,23 @@ To see a list of all available WP-CLI commands, please see the [WP CLI commands
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 2.0.13 =
|
87 |
|
88 |
- Updated bundled Predis library to v1.1.4
|
89 |
- Made `redis-cache` a global group for improved metrics on multisite
|
90 |
- Switched to short array syntax
|
91 |
-
- Added `@since` tags to all
|
92 |
- Use `parse_url()` instead of `wp_parse_url()` in drop-in
|
93 |
- Fixed plugin instance variable name in `wp redis status`
|
94 |
|
@@ -459,6 +470,6 @@ Since Predis isn't maintained any longer, it's highly recommended to switch over
|
|
459 |
|
460 |
== Upgrade Notice ==
|
461 |
|
462 |
-
= 2.0.
|
463 |
|
464 |
Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 5.5
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.0.14
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 2.0.14 =
|
87 |
+
|
88 |
+
- Made Object Cache Pro card translatable
|
89 |
+
- Added `WP_REDIS_SERIALIZER` to diagnostics
|
90 |
+
- Improved speed of `build_key()`
|
91 |
+
- Support settings `WP_REDIS_PREFIX` and `WP_REDIS_SELECTIVE_FLUSH` via environment variable
|
92 |
+
- Added `WP_REDIS_METRICS_MAX_TIME` to adjust stored metrics timeframe
|
93 |
+
- Delay loading of text domain and schedule until `init` hook
|
94 |
+
- Upgraded bundled Predis library to v1.1.6
|
95 |
+
- Prevent variable referencing issue in `connect_using_credis()`
|
96 |
+
|
97 |
= 2.0.13 =
|
98 |
|
99 |
- Updated bundled Predis library to v1.1.4
|
100 |
- Made `redis-cache` a global group for improved metrics on multisite
|
101 |
- Switched to short array syntax
|
102 |
+
- Added `@since` tags to all hooks
|
103 |
- Use `parse_url()` instead of `wp_parse_url()` in drop-in
|
104 |
- Fixed plugin instance variable name in `wp redis status`
|
105 |
|
470 |
|
471 |
== Upgrade Notice ==
|
472 |
|
473 |
+
= 2.0.14 =
|
474 |
|
475 |
Version 2.0 is a significant rewrite of the plugin. Please read the v2.0.0 release notes.
|
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.
|
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.14
|
7 |
* Text Domain: redis-cache
|
8 |
* Domain Path: /languages
|
9 |
* Network: true
|