PluginProbe
Stream – Activity Log & Audit Trail / 3.4.2
Stream – Activity Log & Audit Trail v3.4.2
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
← All changes | classes/class-uninstall.php +10 -5 3.2.23.4.2 View file →
@@ -3,8 +3,9 @@
3 3
4 4 class Uninstall {
5 5 /**
6 6 * Hold Plugin class
7 + *
7 8 * @var Plugin
8 9 */
9 10 public $plugin;
10 11
@@ -21,9 +22,9 @@
21 22 * @var array
22 23 */
23 24 public $user_meta;
24 25
25 - function __construct( $plugin ) {
26 + public function __construct( $plugin ) {
26 27 $this->plugin = $plugin;
27 28
28 29 $this->user_meta = array(
29 30 'edit_stream_per_page',
@@ -36,10 +37,8 @@
36 37 /**
37 38 * Uninstall Stream by deleting its data
38 39 */
39 40 public function uninstall() {
40 - //check_ajax_referer( 'stream_nonce', 'wp_stream_nonce' );
41 -
42 41 $this->options = array(
43 42 $this->plugin->install->option_key,
44 43 $this->plugin->settings->option_key,
45 44 $this->plugin->settings->network_options_key,
@@ -51,8 +50,14 @@
51 50 esc_html__( "You don't have sufficient privileges to do this action.", 'stream' )
52 51 );
53 52 }
54 53
54 + if ( defined( 'DISALLOW_FILE_MODS' ) && true === DISALLOW_FILE_MODS ) {
55 + wp_die(
56 + esc_html__( "You don't have sufficient file permissions to do this action.", 'stream' )
57 + );
58 + }
59 +
55 60 // Prevent this action from firing
56 61 remove_action( 'deactivate_plugin', array( 'Connector_Installer', 'callback' ), null );
57 62
58 63 // Just in case
@@ -61,9 +66,9 @@
61 66 }
62 67
63 68 // Drop everything on single site installs or when network activated
64 69 // Otherwise only delete data relative to the current blog
65 - if ( ! is_multisite() || is_plugin_active_for_network( $this->plugin->locations['plugin'] ) ) {
70 + if ( ! is_multisite() || $this->plugin->is_network_activated() ) {
66 71 $this->delete_all_records();
67 72 $this->delete_all_options();
68 73 $this->delete_all_user_meta();
69 74 } else {
@@ -196,9 +201,9 @@
196 201
197 202 // Specific user meta
198 203 foreach ( $this->user_meta as $meta_key ) {
199 204 $wpdb->query(
200 - $wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '{$wpdb->prefix}%s';", $meta_key )
205 + $wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = {$wpdb->prefix}%s;", $meta_key )
201 206 );
202 207 }
203 208 }
204 209