From 9d9f0b34c5a8856c85ff48ab894c7aae10c3324e Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Fri, 6 Dec 2024 13:07:44 -0800 Subject: [PATCH] Check one or the other not both --- object-cache.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/object-cache.php b/object-cache.php index 1dab4ae..87d7ded 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1226,9 +1226,12 @@ protected function _connect_redis() { * not with a message describing the issue. */ public function check_client_dependencies() { - $has_relay = defined( 'WP_REDIS_USE_RELAY' ) && WP_REDIS_USE_RELAY && class_exists( 'Relay\Relay' ); + $class_to_check = 'Redis'; + if (defined( 'WP_REDIS_USE_RELAY' ) && WP_REDIS_USE_RELAY ) { + $class_to_check = 'Relay\Relay'; + } - if ( ! $has_relay || ! class_exists( 'Redis' ) ) { + if ( ! class_exists( $class_to_check ) ) { return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.'; } return true;