In advanced-cache.php, a variable $cache_enabler_constants_file is defined with a "junk" value that needs to be changed upon installation. If the wp-content directory is writable, then the cache-enabler activation routine will copy the included advanced-cache.php into it, modifying the junk value to point to the real location of constants.php.
If, however, wp-content is hardened to prevent writes to the plugins subdirectory [0], then the user has to copy advanced-cache.php into wp-content himself, and edit $cache_enabler_constants_file manually. To avoid this step, it would be nice if the user could simply symlink wp-content/advanced-cache.php to the sample copy provided by the plugin and have everything work "out of the box."
This commit replaces the junk default $cache_enabler_constants_file with one that allows said symlinking. Since the old value could never work, this should not be any worse for anyone's use case. The find/replace that the activation routine uses when wp-content is writable has also been updated and is a tiny bit uglier, but otherwise still works the same.
In advanced-cache.php, a variable
$cache_enabler_constants_file
is defined with a "junk" value that needs to be changed upon installation. If the wp-content directory is writable, then the cache-enabler activation routine will copy the included advanced-cache.php into it, modifying the junk value to point to the real location of constants.php.If, however, wp-content is hardened to prevent writes to the plugins subdirectory [0], then the user has to copy advanced-cache.php into wp-content himself, and edit
$cache_enabler_constants_file manually
. To avoid this step, it would be nice if the user could simply symlink wp-content/advanced-cache.php to the sample copy provided by the plugin and have everything work "out of the box."This commit replaces the junk default
$cache_enabler_constants_file
with one that allows said symlinking. Since the old value could never work, this should not be any worse for anyone's use case. The find/replace that the activation routine uses when wp-content is writable has also been updated and is a tiny bit uglier, but otherwise still works the same.[0] https://wordpress.org/documentation/article/hardening-wordpress/