pantheon-systems / wp-redis

WordPress Object Cache using Redis.
https://wordpress.org/plugins/wp-redis/
GNU General Public License v2.0
225 stars 68 forks source link

Add basic info to WordPress' health check screen #353

Open dsXLII opened 2 years ago

dsXLII commented 2 years ago

Since there's a wp-cli command to display some basic Redis info, why not make it available in WordPress' own health check interface?

This is the "I banged it out in like half an hour" version, feel free to completely rewrite it, put this code somewhere else. Think of it as a starting point more than anything else.

mwt commented 2 years ago

Thanks! I think this is an important feature even for Pantheon users.

timnolte commented 2 years ago

This code apparently has some problems when connecting to a Redis 6 instance. I'm doing some digging into it as this would be helpful to have somewhere in the Dashboard.

timnolte commented 2 years ago

Actually, I was having issues locally with the Redis 6 Docker image and I determined that I needed to set the password in the redis.conf and have it matching in the plugin setup. Then it worked.

jazzsequence commented 1 year ago

Resurrecting this. Tracking internally as CMSP-344. Tentatively looks good but since Behat tests are failing, I'd like to pull it down and test it before we merge.

timnolte commented 1 year ago

Just noting that I created a MU Plugin for our agency to use on our sites to provide site health for Redis when using this plugin. https://gist.github.com/timnolte/d295f24457698f65f00d301074494394

jazzsequence commented 1 year ago

Thanks for sharing the gist @timnolte!

timnolte commented 1 year ago

It would be nice if the wp_redis_get_info() function also included the following in it's output.

        'redis_version'     => $info['redis_version'],
        'redis_mode'        => $info['redis_mode'],
        'maxclients'        => $info['maxclients'],
        'connected_clients' => $info['connected_clients'],
timnolte commented 1 year ago

Just noting that I created a MU Plugin for our agency to use on our sites to provide site health for Redis when using this plugin. https://gist.github.com/timnolte/d295f24457698f65f00d301074494394

I've updated this Gist to leverage some better error handling as well as incorporate changes in a patch to 1.4.2 I made here(https://gist.github.com/timnolte/267e2a502f05156c0fe2a0d7028c2854) that includes the redis_version, redis_mode, maxclients, and connected_clients attributes.