Bug, WP_CACHE left behind in wp-config.php
-
The line
define( 'WP_CACHE', true );
is not removed fromwp-config.php
after deactivation / deletion of plugin.As a sidenote we would recommend better handling of return codes of functions, e.g. when dealing with
wp-config.php
insurge/include/install.php
:$config = file_get_contents( $config_path ); $pattern = '..removed..'; $config = preg_replace( $pattern, '', $config );
$bytes = file_put_contents( $config_path, $config ); update_option( 'surge_installed', $bytes ? 1 : 2 );
Theoretical code flow:
If
$config
isfalse
fromfile_get_contents()
it will be empty atfile_put_contents()
which can return0
written bytes which will write2
insurge_installed
which somewhere else might be interpreted as write-permission problem but actually isn’t.Not sure if this can ever happen, the recommendation comes from experience with typical problems which can arise when not checking return codes and/or not with
identical
comparison operator.WordPress 5.8.2, Twenty Twenty-One 1.4, Surge 1.0.1
- The topic ‘Bug, WP_CACHE left behind in wp-config.php’ is closed to new replies.