PluginProbe
WP-EMail / 2.69.2
WP-EMail v2.69.2
3.0.0 trunk 1.00 2.00b 2.01 2.02 2.03 2.04 2.04a 2.05 2.06 2.07 2.10 2.11 2.20 2.30 2.31 2.40 2.50 2.51 2.52 2.61 2.62 2.63 2.64 All 42 releases
wp-email / uninstall.php

uninstall.php in WP-EMail 2.69.2, at uninstall.php

65 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Uninstall plugin
4 */
5 if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
6 exit ();
7
8 $option_names = array(
9 'email_smtp'
10 , 'email_contenttype'
11 , 'email_mailer'
12 , 'email_template_subject'
13 , 'email_template_body'
14 , 'email_template_bodyalt'
15 , 'email_template_sentsuccess'
16 , 'email_template_sentfailed'
17 , 'email_template_error'
18 , 'email_interval'
19 , 'email_snippet'
20 , 'email_multiple'
21 , 'email_imageverify'
22 , 'email_options'
23 , 'email_fields'
24 , 'email_template_title'
25 , 'email_template_subtitle'
26 , 'widget_email_most_emailed'
27 );
28
29 if ( is_multisite() ) {
30 $ms_sites = wp_get_sites();
31
32 if( 0 < sizeof( $ms_sites ) ) {
33 foreach ( $ms_sites as $ms_site ) {
34 switch_to_blog( $ms_site['blog_id'] );
35 if( sizeof( $option_names ) > 0 ) {
36 foreach( $option_names as $option_name ) {
37 delete_option( $option_name );
38 plugin_uninstalled();
39 }
40 }
41 }
42 }
43
44 restore_current_blog();
45 } else {
46 if( sizeof( $option_names ) > 0 ) {
47 foreach( $option_names as $option_name ) {
48 delete_option( $option_name );
49 plugin_uninstalled();
50 }
51 }
52 }
53
54 /**
55 * Delete plugin table when uninstalled
56 *
57 * @access public
58 * @return void
59 */
60 function plugin_uninstalled() {
61 global $wpdb;
62
63 $email_table = $wpdb->prefix . 'email';
64 $wpdb->query( "DROP TABLE IF EXISTS $email_table" );
65 }