Object caching can interfere with module activation
Bug Description
When attempting to activate a module (eg. Analytics) in an object cached environment, the activation status update may appear to fail.
Steps to reproduce
- In an object cached environment set up the plugin and attempt to activate the Analytics module
Expected result: Module is activated, setup flow continues.
Actual results: Module not activated, page shows error. Clearing the object cache at this point and reloading causes setup to continue as expected.
Screenshots
Failure:

REST request to module/analytics active:true returns active: false:

Analytics Module missing after activating:

Additional Context
@westonruter can you provide any additional details around your caching environment?
- PHP Version:
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Plugin Version [e.g. 22]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Changelog entry
I was trying this on my Pantheon-hosted production environment:
- PHP 7.2
- WP Redis object caching plugin
- Plugin version: 1.0.0-beta.1.0.4
@adamsilverstein agree this is quite a frustrating issue, I've encountered it a few times myself while testing and doing demos. It could stump a lot of users, especially the less savvy ones. If it's possible to figure out what exactly is causing this and how we can clear that specific part of the object cache, that would be great. Then I can define more specific ACs for what should change.
I'll dig into this a bit further to see how we can mitigate.
Sorry, but for clarification: what does "object caching" mean here? Is it specifically using the https://wordpress.org/plugins/wp-redis/ plugin or any other type of server-side/PHP object cache?
Sorry, but for clarification: what does "object caching" mean here? Is it specifically using the https://wordpress.org/plugins/wp-redis/ plugin or any other type of server-side/PHP object cache?
Object caching is essentially WP_Object_Cache which is core's caching layer where things like posts, meta, and options are kept to prevent querying the database every time these are requested. By default, this is a simple in-memory implementation which only lasts for the current request. However, it is possible (and sometimes necessary) to use alternate implementations of WP_Object_Cache which use other backends as persistent, external object caches. The two most popular options are Redis and Memcache. In order to use them, you need to have access to the cache backend, not just the plugin 😄
@cole10up it would be great to have a look if this is still an issue. If not, we can close it.
Tested:
Enabled Object Cache

Confirmed Existing configuration of Analytics functions

Uninstalled and tried new setup Also functioned. Going to chat with @aaemnnosttv about other scenarios to try on the backend tomorrow.
@cole10up I see you installed the Redis plugin but it looks like it's not connected to a Redis backend so the persistent object cache won't work yet.
Ping me and I'll see about helping you get this set up locally.
Tested Ran some tests with @aaemnnosttv using evanmattson.10uplabs.com

Didn't see this issue. Going to reach out to try on a Pantheon hosted environment next.
Hey @cole10up, have you heard anything from Pantheon on this one?
Hey @marrrmarrr, we've got a service ticket in on our end to get access to a Pantheon environment as of yesterday. I will followup tomorrow on the status of the ticket if I don't get access today.
I have access to Pantheon, working through the setup and will have feedback tomorrow.
Tested
Setup Pantheon server with Redis object caching.

- Installed and activated latest develop build of SK
- Setup SK and configured Analytics
- Confirmed Analytics on the dashboard is displayed and no errors occurred

Confirmed Tag Manager, Search Console, and Page Speed Insights also functioned properly.
Wasn't able to reproduce this issue on the latest pre 1.3 build @marrrmarrr
Closing since it is not reproducable