Example #1
0
function wpsupercache_deactivate()
{
    global $wp_cache_config_file, $wp_cache_link, $cache_path;
    $files = array($wp_cache_config_file, $wp_cache_link);
    foreach ($files as $file) {
        if (file_exists($file)) {
            unlink($file);
        }
    }
    if (!function_exists('prune_super_cache')) {
        include_once 'wp-cache-phase2.php';
    }
    prune_super_cache($cache_path, true);
    @unlink($cache_path . '.htaccess');
    @unlink($cache_path . 'meta');
    @unlink($cache_path . 'supercache');
    wp_clear_scheduled_hook('wp_cache_check_site_hook');
    wp_cache_disable_plugin();
}
function wpsupercache_deactivate()
{
    global $wp_cache_config_file, $wp_cache_link, $cache_path;
    if (file_exists($wp_cache_link)) {
        unlink($wp_cache_link);
    }
    if (!function_exists('wp_cache_debug')) {
        include_once 'wp-cache-phase1.php';
    }
    if (!function_exists('prune_super_cache')) {
        include_once 'wp-cache-phase2.php';
    }
    prune_super_cache($cache_path, true);
    wp_cache_remove_index();
    @unlink($cache_path . '.htaccess');
    @unlink($cache_path . 'meta');
    @unlink($cache_path . 'supercache');
    wp_clear_scheduled_hook('wp_cache_check_site_hook');
    wp_clear_scheduled_hook('wp_cache_gc');
    wp_clear_scheduled_hook('wp_cache_gc_watcher');
    wp_cache_replace_line('^ *\\$cache_enabled', '$cache_enabled = false;', $wp_cache_config_file);
    wp_cache_disable_plugin(false);
    // don't delete configuration file
}