PluginProbe ʕ •ᴥ•ʔ
Check & Log Email – Easy Email Testing & Mail logging / 1.0.3
Check & Log Email – Easy Email Testing & Mail logging v1.0.3
1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.13.2 2.0.14 2.0.2 2.0.3 2.0.4 2.0.5 2.0.5.1 2.0.6 2.0.7 2.0.8 2.0.9 trunk 0.5.7 0.6.0 0.6.1 0.6.2 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.12.1 1.0.13 1.0.13.1 1.0.2 1.0.3
check-email / uninstall.php
check-email Last commit date
assets 4 years ago include 4 years ago changelog.txt 4 years ago check-email.php 4 years ago readme.txt 4 years ago uninstall.php 4 years ago
uninstall.php
53 lines
1 <?php
2
3 // exit if WordPress is not uninstalling the plugin.
4 if ( ! defined( 'ABSPATH' ) && ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
5 exit();
6 }
7
8 if ( is_multisite() ) {
9 $sites = get_sites();
10
11 foreach ( $sites as $site ) {
12 switch_to_blog( $site->blog_id );
13 check_email_delete_db_data();
14 restore_current_blog();
15 }
16 } else {
17 check_email_delete_db_data();
18 }
19
20 function check_email_delete_db_data() {
21 global $wpdb;
22
23 $remove_data_on_uninstall = false;
24
25 $option = get_option( 'check-email-log-core' );
26 if ( is_array( $option ) && array_key_exists( 'remove_on_uninstall', $option ) &&
27 'true' === strtolower( $option['remove_on_uninstall'] ) ) {
28
29 $remove_data_on_uninstall = true;
30 }
31
32 // This is hardcoded on purpose, since the entire plugin is not loaded during uninstall.
33 $table_name = $wpdb->prefix . 'check_email_log';
34
35 if ( $remove_data_on_uninstall ) {
36 if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
37 $wpdb->query( "DROP TABLE $table_name" );
38 }
39
40 delete_option( 'check-email-log-db' );
41 delete_option( 'check-email-log-core' );
42
43 $roles = get_editable_roles();
44 foreach ( $roles as $role_name => $role_obj ) {
45 $role = get_role( $role_name );
46
47 if ( ! is_null( $role ) ) {
48 $role->remove_cap( 'manage_check_email' );
49 }
50 }
51 }
52 }
53