PluginProbe ʕ •ᴥ•ʔ
Smush – Image Optimization, Compression, Lazy Load, WebP & CDN / 2.4.3
Smush – Image Optimization, Compression, Lazy Load, WebP & CDN v2.4.3
4.1.0 4.0.3 4.0.2 2.8.1 2.9.1 3.0.0 3.0.1 3.0.2 3.1.1 3.10.1 3.10.2 3.10.3 3.11.1 3.12.3 3.12.4 3.12.5 3.12.6 3.13.0 3.13.1 3.13.2 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.15.2 3.15.3 3.15.4 3.15.5 3.16.2 3.16.4 3.16.5 3.16.6 3.17.0 3.17.1 3.18.0 3.18.1 3.2.0.1 3.2.1 3.2.2.1 3.2.4 3.20.0 3.21.1 3.22.1 3.22.3 3.23.0 3.23.1 3.23.2 3.23.3 3.23.4 3.24.0 3.24.0-beta.2 3.3.0 3.3.1 3.3.2 3.4.1 3.4.2 3.6.1 3.6.3 3.7.0 3.7.1 3.7.2 3.7.3 3.8.2 3.8.3 3.8.4 3.8.5 3.8.7 3.8.8 3.9.0 3.9.1 3.9.11 3.9.2 3.9.4 3.9.5 3.9.8 3.9.9 trunk 1.0.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.2 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.5.1 1.6.5.2 1.6.5.3 1.6.5.4 1.7 1.7.1 1.7.1.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.6.2 2.0.6.3 2.0.6.5 2.0.7 2.0.7.1 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.2 2.3 2.3.1 2.4 2.4.2 2.4.3 2.4.4 2.4.5 2.5.2 2.5.3 2.6.1 2.6.2 2.6.3 2.7 2.7.1 2.7.4 2.7.4.1 2.7.5 2.7.6 2.7.8 2.7.8.1 2.7.9.1 2.8.0 2.8.0.1
wp-smushit / uninstall.php
wp-smushit Last commit date
assets 9 years ago extras 9 years ago languages 9 years ago lib 9 years ago license.txt 17 years ago readme.txt 9 years ago uninstall.php 9 years ago wp-smush.php 9 years ago
uninstall.php
132 lines
1 <?php
2 /**
3 * Remove plugin settings data
4 *
5 * @since 1.7
6 *
7 */
8
9 //if uninstall not called from WordPress exit
10 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
11 exit();
12 }
13 global $wpdb;
14
15 $smushit_keys = array(
16 'auto',
17 'original',
18 'lossy',
19 'backup',
20 'resize',
21 'png_to_jpg',
22 'resize-sizes',
23 'nextgen',
24 'keep_exif',
25 'resmush-list',
26 'resize_sizes',
27 'transparent_png',
28 'image_sizes',
29 'skip-redirect',
30 'nextgen-resmush-list',
31 'super_smushed',
32 'super_smushed_nextgen',
33 'settings_updated',
34 'skip-redirect',
35 'hide_smush_welcome',
36 'hide_upgrade_notice',
37 'hide_update_info',
38 'install-type',
39 'lossy-updated',
40 'version'
41 );
42
43 //Cache Keys
44 $cache_keys = array(
45 'smush_global_stats',
46 );
47
48 $cache_smush_group = array(
49 'exceeding_items',
50 'wp-smush-resize_savings',
51 'pngjpg_savings'
52 );
53 $cache_nextgen_group = array(
54 'wp_smush_images',
55 'wp_smush_images_smushed',
56 'wp_smush_images_unsmushed',
57 'wp_smush_stats_nextgen',
58
59 );
60
61 if ( ! is_multisite() ) {
62 //Delete Options
63 foreach ( $smushit_keys as $key ) {
64 $key = 'wp-smush-' . $key;
65 delete_option( $key );
66 delete_site_option( $key );
67 }
68 //Delete Cache data
69 foreach ( $cache_keys as $key ) {
70 wp_cache_delete( $key );
71 }
72
73 foreach ( $cache_smush_group as $s_key ) {
74 wp_cache_delete( $s_key, 'smush' );
75 }
76
77 foreach ( $cache_nextgen_group as $n_key ) {
78 wp_cache_delete( $n_key, 'nextgen' );
79 }
80
81 }
82
83 //Delete Post meta
84 $meta_type = 'post';
85 $meta_key = 'wp-smpro-smush-data';
86 $meta_value = '';
87 $delete_all = true;
88
89 if ( is_multisite() ) {
90 $offset = 0;
91 $limit = 100;
92 while ( $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} LIMIT $offset, $limit", ARRAY_A ) ) {
93 if ( $blogs ) {
94 foreach ( $blogs as $blog ) {
95 switch_to_blog( $blog['blog_id'] );
96 delete_metadata( $meta_type, null, $meta_key, $meta_value, $delete_all );
97 delete_metadata( $meta_type, null, 'wp-smush-lossy', '', $delete_all );
98 delete_metadata( $meta_type, null, 'wp-smush-resize_savings', '', $delete_all );
99 delete_metadata( $meta_type, null, 'wp-smush-original_file', '', $delete_all );
100 delete_metadata( $meta_type, null, 'wp-smush-pngjpg_savings', '', $delete_all );
101 foreach ( $smushit_keys as $key ) {
102 $key = 'wp-smush-' . $key;
103 delete_option( $key );
104 delete_site_option( $key );
105 }
106 //Delete Cache data
107 foreach ( $cache_keys as $key ) {
108 wp_cache_delete( $key );
109 }
110
111 foreach ( $cache_smush_group as $s_key ) {
112 wp_cache_delete( $s_key, 'smush' );
113 }
114
115 foreach ( $cache_nextgen_group as $n_key ) {
116 wp_cache_delete( $n_key, 'nextgen' );
117 }
118 }
119 restore_current_blog();
120 }
121 $offset += $limit;
122 }
123 } else {
124 delete_metadata( $meta_type, null, $meta_key, $meta_value, $delete_all );
125 delete_metadata( $meta_type, null, 'wp-smush-lossy', '', $delete_all );
126 delete_metadata( $meta_type, null, 'wp-smush-resize_savings', '', $delete_all );
127 delete_metadata( $meta_type, null, 'wp-smush-original_file', '', $delete_all );
128 delete_metadata( $meta_type, null, 'wp-smush-pngjpg_savings', '', $delete_all );
129 }
130 //@todo: Add procedure to delete backup files
131 //@todo: Update NextGen Metadata to remove Smush stats on plugin deletion
132 ?>