@@ -8,24 +8,24 @@ discard block |
||
8 | 8 | */ |
9 | 9 | // uninstall page for Email Log Plugin to clean up db. |
10 | 10 | if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) ) |
11 | - exit(); |
|
11 | + exit(); |
|
12 | 12 | |
13 | 13 | if ( is_multisite() ) { |
14 | - global $wpdb; |
|
14 | + global $wpdb; |
|
15 | 15 | |
16 | - $original_blog_id = get_current_blog_id(); |
|
16 | + $original_blog_id = get_current_blog_id(); |
|
17 | 17 | |
18 | - $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
18 | + $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
19 | 19 | |
20 | - foreach ( $blog_ids as $blog_id ) { |
|
21 | - switch_to_blog( $blog_id ); |
|
22 | - email_log_delete_table(); |
|
23 | - } |
|
20 | + foreach ( $blog_ids as $blog_id ) { |
|
21 | + switch_to_blog( $blog_id ); |
|
22 | + email_log_delete_table(); |
|
23 | + } |
|
24 | 24 | |
25 | - switch_to_blog( $original_blog_id ); |
|
25 | + switch_to_blog( $original_blog_id ); |
|
26 | 26 | |
27 | 27 | } else { |
28 | - email_log_delete_table(); |
|
28 | + email_log_delete_table(); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | * @global object $wpdb |
37 | 37 | */ |
38 | 38 | function email_log_delete_table() { |
39 | - global $wpdb; |
|
40 | - $table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose |
|
39 | + global $wpdb; |
|
40 | + $table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose |
|
41 | 41 | |
42 | - if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) { |
|
43 | - // If table is present, drop it |
|
44 | - $wpdb->query( "DROP TABLE $table_name" ); |
|
45 | - } |
|
42 | + if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) { |
|
43 | + // If table is present, drop it |
|
44 | + $wpdb->query( "DROP TABLE $table_name" ); |
|
45 | + } |
|
46 | 46 | |
47 | - // Delete the option |
|
48 | - delete_option('email-log-db'); |
|
47 | + // Delete the option |
|
48 | + delete_option('email-log-db'); |
|
49 | 49 | } |
50 | 50 | ?> |