|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Class to un/install the module. |
|
5
|
|
|
* |
|
6
|
|
|
* @package WordPointsOrg |
|
7
|
|
|
* @since 1.0.0 |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Un/install the module. |
|
12
|
|
|
* |
|
13
|
|
|
* @since 1.0.0 |
|
14
|
|
|
*/ |
|
15
|
|
|
class WordPointsOrg_Un_Installer extends WordPoints_Un_Installer_Base { |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @since 1.1.3 |
|
19
|
|
|
*/ |
|
20
|
|
|
protected $type = 'module'; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @since 1.1.3 |
|
24
|
|
|
*/ |
|
25
|
|
|
protected $custom_caps_getter = 'wordpointsorg_get_custom_caps'; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @since 1.1.3 |
|
29
|
|
|
*/ |
|
30
|
|
|
protected $uninstall = array( |
|
31
|
|
|
'global' => array( |
|
32
|
|
|
'options' => array( |
|
33
|
|
|
'wordpoints_edd_sl_module_licenses', |
|
34
|
|
|
'wordpoints_edd_sl_module_info', |
|
35
|
|
|
), |
|
36
|
|
|
), |
|
37
|
|
|
); |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @since 1.1.3 |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $updates = array( |
|
43
|
|
|
'1.1.3' => array( 'network' => true ), |
|
44
|
|
|
); |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @since 1.0.0 |
|
48
|
|
|
*/ |
|
49
|
|
|
protected function load_dependencies() { |
|
50
|
|
|
|
|
51
|
|
|
require_once( dirname( __FILE__ ) . '/constants.php' ); |
|
52
|
|
|
require_once( WORDPOINTSORG_DIR . '/includes/functions.php' ); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @since 1.0.0 |
|
57
|
|
|
*/ |
|
58
|
|
|
protected function uninstall_network() { |
|
59
|
|
|
|
|
60
|
|
|
parent::uninstall_network(); |
|
61
|
|
|
|
|
62
|
|
|
delete_site_transient( 'wordpoints_module_updates' ); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @since 1.0.0 |
|
67
|
|
|
*/ |
|
68
|
|
|
protected function uninstall_single() { |
|
69
|
|
|
|
|
70
|
|
|
parent::uninstall_single(); |
|
71
|
|
|
|
|
72
|
|
|
delete_transient( 'wordpoints_module_updates' ); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @since 1.1.3 |
|
77
|
|
|
*/ |
|
78
|
|
|
protected function before_update() { |
|
79
|
|
|
|
|
80
|
|
|
parent::before_update(); |
|
81
|
|
|
|
|
82
|
|
|
if ( 1 === version_compare( '1.1.3', $this->updating_from ) ) { |
|
83
|
|
|
$this->option_prefix = 'wordpointsorg_'; |
|
84
|
|
|
} |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* Update the network to 1.1.3. |
|
89
|
|
|
* |
|
90
|
|
|
* @since 1.1.3 |
|
91
|
|
|
*/ |
|
92
|
|
|
protected function update_network_to_1_1_3() { |
|
93
|
|
|
|
|
94
|
|
|
update_site_option( |
|
95
|
|
|
'wordpoints_module_wordpointsorg_installed_sites' |
|
96
|
|
|
, wordpoints_get_array_option( 'wordpointsorg_installed_sites', 'site' ) |
|
97
|
|
|
); |
|
98
|
|
|
|
|
99
|
|
|
delete_site_option( 'wordpointsorg_installed_sites' ); |
|
100
|
|
|
|
|
101
|
|
|
if ( get_site_option( 'wordpointsorg_network_installed' ) ) { |
|
102
|
|
|
unset( $this->option_prefix ); |
|
103
|
|
|
$this->set_network_installed(); |
|
104
|
|
|
delete_site_option( 'wordpointsorg_network_installed' ); |
|
105
|
|
|
} |
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
return 'WordPointsOrg_Un_Installer'; |
|
110
|
|
|
|
|
111
|
|
|
// EOF |
|
112
|
|
|
|