From a8c740d6f71c513d8cd2db9ff65b0d0dc820579c Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Sat, 11 Oct 2014 15:17:18 -0700 Subject: [PATCH] Don't load when the underlying class isn't available, such as when using WP CLI. --- wp-redis-user-session-storage.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-redis-user-session-storage.php b/wp-redis-user-session-storage.php index c82f87d..ee14ea2 100644 --- a/wp-redis-user-session-storage.php +++ b/wp-redis-user-session-storage.php @@ -22,6 +22,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/** + * Don't load in contexts that lack the WP_Session_Tokens class + */ +if ( ! class_exists( 'WP_Session_Tokens' ) ) { + return; +} + /** * Redis-based user sessions token manager. * -- GitLab