is_dir( $cache_dir ) ) { $wp_filesystem->delete( $cache_dir, true ); } $drop_in = WP_CONTENT_DIR . '/advanced-cache.php'; if ( $wp_filesystem->exists( $drop_in ) ) { $contents = $wp_filesystem->get_contents( $drop_in ); if ( is_string( $contents ) && false !== strpos( $contents, 'XSPEED_DROPIN' ) ) { $wp_filesystem->delete( $drop_in ); } } $wp_config = ABSPATH . 'wp-config.php'; if ( defined( 'WP_CACHE' ) && WP_CACHE && $wp_filesystem->is_writable( $wp_config ) ) { $config = $wp_filesystem->get_contents( $wp_config ); if ( is_string( $config ) ) { $config = preg_replace( "/define\\(\\s*['\"]WP_CACHE['\"]\\s*,\\s*true\\s*\\);\\s*\\n?/", '', $config ); $wp_filesystem->put_contents( $wp_config, $config, FS_CHMOD_FILE ); } } }