PluginProbe
SiteGuard WP Plugin / 1.8.4
SiteGuard WP Plugin v1.8.4
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 All 50 releases
siteguard / uninstall.php
uninstall.php
41 lines 841 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 $table_name = $wpdb->prefix . 'siteguard_login';
32 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" );
33
34 $table_name = $wpdb->prefix . 'siteguard_history';
35 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" );
36
37 remove_directory( WP_CONTENT_DIR . '/siteguard' );
38 }
39
40 delete_siteguard_plugin();
41