Automattic / Automattic/wp-super-cache

WP_Cache added to wp-config.php in a place that gets erased by iThemes files updates.

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

Description

WP Super cache Version 1.7.4 -

We have iThemes Security installed. One of the options in iThemes is to Disallow File Edits. This setting in iThemes adds the following to wp-config.php:

```
// BEGIN iThemes Security - Do not modify or remove this line
// iThemes Security Config Details: 2
define( 'DISALLOW_FILE_EDIT', true ); // Disable File Editor - Security > Settings > WordPress Tweaks > File Editor
// END iThemes Security - Do not modify or remove this line
```

With WP Super Cache, it attempts to set a few variables, WP_CACHE and WPCACHEHOME. When it does, they seem to be added to that iThemes block so it looks like this:

```
// BEGIN iThemes Security - Do not modify or remove this line
define( 'WPCACHEHOME', '/actual/path/removed' );
define('WP_CACHE', true);
// iThemes Security Config Details: 2
define( 'DISALLOW_FILE_EDIT', true ); // Disable File Editor - Security > Settings > WordPress Tweaks > File Editor
// END iThemes Security - Do not modify or remove this line
```

This causes those two variables to be removed when iThemes re-writes that file with its settings.

as noted here: https://wordpress.org/support/topic/define-wp_cache-getting-erased-by-ithemes/

Can the WP Super cache variables be managed in their own block like iThemes? so it doesn't get overwritten and removed?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the code that writes WP_CACHE and WPCACHEHOME into wp-config.php, then compare how it interacts with the iThemes Security block described here. Done means the WP Super Cache variables are placed in their own protected block and remain present after iThemes rewrites the file.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.