-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
76 lines (64 loc) · 1.63 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* @package WordPress Plugin
* @subpackage WP Missed Schedule
* @description Uninstall Module
* @status Stable
* @todolist Code in Becoming!
* @license GPLv2 or later
*
* @humans //humanstxt.org/Standard.html
* @indentation //www.gnu.org/prep/standards/standards.html
* @license //www.gnu.org/licenses/gpl-2.0.html
* @link //wordpress.org/plugins/wp-missed-schedule/
*
* @build 2015-09-26
* @author sLa NGjI's @ slangji.wordpress.com
*
* @since WordPress 2.7+
* @tested WordPress 4.4+
*/
defined ( 'ABSPATH' ) OR exit;
defined ( 'WPINC' ) OR exit;
defined ( 'WP_UNINSTALL_PLUGIN' ) OR exit;
$option_names = array(
'byrev_fixshedule_next_verify',
'missed_schedule',
'scheduled_post_guardian_next_run',
'simpul_missed_schedule',
'wpt_scheduled_check',
'wp_missed_schedule',
'wp_scheduled_missed',
'wp_scheduled_missed_options',
);
global $wp_version;
if ( $wp_version >= 3.0 )
{
if ( ! is_multisite() )
{
foreach ( $option_names as $option_name )
{
delete_option( $option_name );
}
}
if ( is_multisite() )
{
foreach ( $option_names as $option_name )
{
delete_option( $option_name );
}
global $wpdb;
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
$original_blog_id = get_current_blog_id();
foreach ( $blog_ids as $blog_id )
{
switch_to_blog( $blog_id );
foreach ( $option_names as $option_name )
{
delete_site_option( $option_name );
}
}
switch_to_blog( $original_blog_id );
}
}
?>