PluginProbe ʕ •ᴥ•ʔ
Core Web Vitals & PageSpeed Booster / 1.0.27
Core Web Vitals & PageSpeed Booster v1.0.27
trunk 1.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.7.1 1.0.7.2 1.0.8 1.0.9
core-web-vitals-pagespeed-booster / uninstall.php
core-web-vitals-pagespeed-booster Last commit date
css-extractor 6 months ago images 6 months ago includes 6 months ago languages 6 months ago changelog.txt 6 months ago core-web-vitals-pagespeed-booster.php 6 months ago readme.txt 6 months ago uninstall.php 6 months ago
uninstall.php
37 lines
1 <?php
2
3 defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
4
5 if ( ! defined( 'CWVPSB_CACHE_DIR' ) ) {
6 define( 'CWVPSB_CACHE_DIR', WP_CONTENT_DIR. '/cache/cwvpsb/' );
7 }
8
9 if ( ! defined( 'CWVPSB_IMAGE_DIR' ) ) {
10 define('CWVPSB_GRAVATARS_DIR',WP_CONTENT_DIR.'/gravatars/');
11 }
12 $cwvpb_settings = get_option( 'cwvpsb_get_settings',false);
13
14 if($cwvpb_settings && isset($cwvpb_settings['delete_on_uninstall']) && $cwvpb_settings['delete_on_uninstall'] == 1){
15 global $wpdb, $table_prefix;
16 if (function_exists('is_multisite') && is_multisite()) {
17 $original_blog_id = get_current_blog_id();
18 $blog_ids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); //phpcs:ignore
19
20 foreach ($blog_ids as $blog_id) {
21 switch_to_blog($blog_id);
22 $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}cwvpb_critical_urls`"); //phpcs:ignore --Reason: Direct DB call to delete table
23 delete_option('cwvpsb_get_settings');
24 }
25
26 switch_to_blog($original_blog_id);
27 } else {
28 $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}cwvpb_critical_urls`"); //phpcs:ignore --Reason: Direct DB call to delete table
29 }
30 require_once ( ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php' );
31 require_once ( ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php' );
32 $fileSystemDirect = new WP_Filesystem_Direct(false);
33 if($fileSystemDirect){
34 $fileSystemDirect->rmdir(CWVPSB_CACHE_DIR, true);
35 $fileSystemDirect->rmdir(CWVPSB_GRAVATARS_DIR, true);
36 }
37 }