Bug, WP_CACHE left behind in wp-config.php
-
The line
define( 'WP_CACHE', true );is not removed fromwp-config.phpafter deactivation / deletion of plugin.As a sidenote we would recommend better handling of return codes of functions, e.g. when dealing with
wp-config.phpinsurge/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
$configisfalsefromfile_get_contents()it will be empty atfile_put_contents()which can return0written bytes which will write2insurge_installedwhich 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
identicalcomparison 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.