PluginProbe
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score / 1.2
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score v1.2
trunk 1.0 1.0.1 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1 2.1.1 2.1.2 2.2 2.2.1 All 69 releases
powered-cache / uninstall.php

uninstall.php in Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score 1.2, at uninstall.php

53 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall Powered Cache
4 * Deletes all plugin related data and configurations
5 */
6
7 // Exit if accessed directly.
8 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
9 exit;
10 }
11
12 include_once( 'powered-cache.php' );
13
14 global $powered_cache_fs;
15
16 // clean cache
17 powered_cache_flush();
18
19 // delete settings
20 delete_option( 'powered_cache_settings' );
21 // delete preloader runtime option, just in case
22 delete_option( 'powered_cache_preload_runtime_option' );
23
24 // turn off page cache
25 Powered_Cache_Config::factory()->define_wp_cache( false );
26
27 // delete object cache file
28 if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' ) ) {
29 $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/object-cache.php' );
30 }
31
32 // delete advanced cache file
33 if ( file_exists( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' ) ) {
34 $powered_cache_fs->delete( untrailingslashit( WP_CONTENT_DIR ) . '/advanced-cache.php' );
35 }
36
37 // delete cache directory
38 if ( file_exists( powered_cache_get_cache_dir() ) ) {
39 $powered_cache_fs->delete( powered_cache_get_cache_dir(), true );
40 }
41
42 // delete configuration files
43 if ( file_exists( WP_CONTENT_DIR . '/pc-config' ) ) {
44 $powered_cache_fs->delete( WP_CONTENT_DIR . '/pc-config', true );
45 }
46
47
48 // remove cron tasks
49 wp_clear_scheduled_hook( 'powered_cache_preload_hook' );
50 wp_clear_scheduled_hook( 'powered_cache_preload_child_process' );
51 wp_clear_scheduled_hook( 'powered_cache_purge_cache' );
52
53