Wp-calypso: Extensions: Enabling WP Super Cache in Calypso kills the site

Created on 11 Apr 2018  路  5Comments  路  Source: Automattic/wp-calypso

Apparently, in order for WP Super Cache to work in Calypso, you have to do a first time setup in wp-admin, even if just enabling the caching on the "Easy" tab.

Doing it in Calypso results in 500-ing the site, which then requires to manually remove a couple of php files from the plugins directory to bring it back up (advanced-cache.php and wp-cache-config.php).

To check if a site requires a first-time setup in wp-admin, head to /extensions/wp-super-cache/debug and check the value of the "Username and Password" field.
If it's false instead of a random alphanumeric string, it means that WP Super Cache has not been initialized yet, and doing so in Calypso will kill the site.

Steps to reproduce

  1. Navigate to /plugins/wp-super-cache for a Jetpack site that has never installed it before, and install WP Super Cache.
  2. Now navigate to its settings, and notice that, in the "Debug" tab (/extensions/wp-super-cache/debug), the "Username and Password" field contains a false instead of a random alphanumeric string. There should also be a couple of console errors related to this.
  3. Enable the caching in the "Easy" tab (/extensions/wp-super-cache).
  4. The site is now down, throwing a 500 error.

What I expected

To be able to enable WP Super Cache caching in Calypso.

What happened instead

I've killed my site!

Extensions [Pri] High [Type] Bug

All 5 comments

cc @Automattic/guardians Would anyone have time to look into this?

@donnchawp Could you take a look at this when you get a chance? Likely will need a plugin side fix and would be good to include in the next release.

The problem isn't with enabling caching. That worked fine for me, but when I tried to enable debugging the text "$1 = 0;" was added to wp-content/wp-cache-config.php

I deactivated WP Super Cache on odd.blog which admittedly isn't the same as the ticket above, but I removed the config file, wp-content/wp-cache-config.php. I made sure that WP_CACHE and WP_CACHEHOME were removed from wp-config.php and that wp-content/advanced-cache.php was deleted.

I activated WP Super Cache through Calypso, saw that caching was disabled, and then saw the "false" value in the debug Username and Password field. I enabled caching from the easy page and the site worked ok. When I tried to enable debugging through Calypso the site died with the above PHP error due to the error in the config file.

The plugin needs to do more work making sure that debugging is set up correctly when the plugin is activated. I'll get a fix into the plugin and a new release out in the next few days.

https://github.com/Automattic/wp-super-cache/pull/542 should fix the problem, and also fixes a few warnings, and the username = false problem too.

Fixed as of the latest release of the plugin.

Was this page helpful?
0 / 5 - 0 ratings