PluginProbe ʕ •ᴥ•ʔ
SiteGuard WP Plugin / 1.8.9
SiteGuard WP Plugin v1.8.9
1.8.9 1.8.8 1.8.7 1.8.6 1.8.6-beta1 1.8.6-beta2 1.8.4 1.8.5 1.8.3 1.8.2 1.8.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.4.3 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.11 1.7.12 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.0-beta1 1.8.0-beta2 1.8.0-beta3 1.8.0-beta4
siteguard / uninstall.php
siteguard Last commit date
admin 1 week ago classes 1 week ago css 2 months ago images 2 months ago languages 1 week ago really-simple-captcha 1 week ago changelog.txt 2 months ago license.txt 11 years ago readme.txt 1 week ago siteguard.php 1 week ago uninstall.php 1 week ago
uninstall.php
48 lines
1 <?php
2
3 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4 exit();
5 }
6
7 function remove_directory( $dir ) {
8 if ( ! is_dir( $dir ) ) {
9 return true;
10 }
11 $entries = @scandir( $dir );
12 if ( ! is_array( $entries ) ) {
13 return false;
14 }
15 $files = array_diff( $entries, array( '.', '..' ) );
16 foreach ( $files as $file ) {
17 if ( is_dir( "$dir/$file" ) ) {
18 remove_directory( "$dir/$file" );
19 } else {
20 @unlink( "$dir/$file" );
21 }
22 }
23 return @rmdir( $dir );
24 }
25
26 function delete_siteguard_plugin() {
27 global $wpdb;
28
29 delete_option( 'siteguard_config' );
30
31 // Deleting the plugin deactivates it first, which already clears this event,
32 // but an uninstall that reaches this point with the event still scheduled
33 // would leave it in the cron table with no handler and no settings behind it.
34 // The name is duplicated from SiteGuard_UpdatesNotify::CRON_NAME because the
35 // plugin classes are not loaded during uninstall.
36 wp_clear_scheduled_hook( 'siteguard_update_check' );
37
38 $table_name = $wpdb->prefix . 'siteguard_login';
39 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" );
40
41 $table_name = $wpdb->prefix . 'siteguard_history';
42 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" );
43
44 remove_directory( WP_CONTENT_DIR . '/siteguard' );
45 }
46
47 delete_siteguard_plugin();
48