Automattic / Automattic/wp-super-cache

Check that web server user/group can write to files before attempting to write to files

Open
#922 0 comments 2 reactions 0 assignees View on GitHub
[Plugin] Super Cache bug
Dominant language
PHP
Stars
436
Forks
130
Avg merge
15h 11m
Merged PRs (30d)
10

Description

While dealing with the bug reported here:

https://wordpress.org/support/topic/fatal-error-with-latest-update-4/

I noticed this error message from the wp-super-cache plugin after network deactivating the plugin (can't recall if that was after a wp-cli network deactivate, or the subsequent attempt to do it through the GUI when I noticed it was still listed as active):

`Could not remove WP_CACHE define from /wordpress-data/wordpress/wp-config.php. Please edit that file and remove the line containing the text 'WP_CACHE'. Then refresh this page.`

For security reasons, we don’t allow the apache user/group to edit any www files directly, which might have something to do with why this update failed for us (and others) so spectacularly. This isn’t an unheard of practice, so I’d suggest that, as part of an update pre-check, if possible, first check to see if you can write to the necessary files, and if not, back out of the update at that point and log an admin error message at that point with instructions on what changes are needed and in what files.

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace the update and deactivation path that edits /wordpress-data/wordpress/wp-config.php and removes the WP_CACHE define. Check where file writes are attempted, then verify the process detects insufficient permissions before changing files, stops the update, and reports which files and permission changes are required to the administrator.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.