From bd386266c27b31abadb72f9259d75ab5651a5edf Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Wed, 30 Oct 2024 15:04:06 -0700 Subject: [PATCH] Update object-cache.php Co-authored-by: Chris Reynolds --- object-cache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/object-cache.php b/object-cache.php index 75d921d..7ac0757 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1226,7 +1226,8 @@ protected function _connect_redis() { * not with a message describing the issue. */ public function check_client_dependencies() { - if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) ) { + $has_relay = defined( 'WP_REDIS_USE_RELAY' ) && class_exists( 'Relay\Relay' ); + if ( ! $has_relay || ! class_exists( 'Redis' ) ) { return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.'; } return true;