Skip to content

Commit

Permalink
[BUGS-5623] Set missing_redis_message if Redis service is not connect…
Browse files Browse the repository at this point in the history
…ed (#391)

* Set missing_redis_message if Redis is not connected

* i18n
  • Loading branch information
John Spellman authored Mar 7, 2023
1 parent cfec1e0 commit 78fb2a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wp-redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ function wp_redis_get_info() {
}

if ( ! defined( 'WP_REDIS_OBJECT_CACHE' ) || ! WP_REDIS_OBJECT_CACHE ) {
return new WP_Error( 'wp-redis', 'WP Redis object-cache.php file is missing from the wp-content/ directory.' );
return new WP_Error( 'wp-redis', __( 'WP Redis object-cache.php file is missing from the wp-content/ directory.', 'wp-redis' ) );
}

if ( ! $wp_object_cache->is_redis_connected ) {
if ( ! isset( $wp_object_cache->missing_redis_message ) ) {
$wp_object_cache->missing_redis_message = __( 'A Redis service needs to be enabled before the WP Redis object cache will function properly.', 'wp-redis' );
}

return new WP_Error( 'wp-redis', $wp_object_cache->missing_redis_message );
}

Expand Down

0 comments on commit 78fb2a4

Please sign in to comment.