PluginProbe
Patchstack – WordPress & Plugins Security / 2.1.8
Patchstack – WordPress & Plugins Security v2.1.8
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | includes/activation.php +19 -14 2.1.22.1.8 View file →
@@ -91,22 +91,8 @@
91 91 $this->activation_errors[] = 'Please upgrade your WordPress site to at least 4.3.0.';
92 92 return false;
93 93 }
94 94
95 - // Check if the webarx/webarx.php plugin is present, if so, remove it.
96 - if ( is_dir( WP_PLUGIN_DIR . '/webarx' ) ) {
97 -
98 - // Migrate all current options to the new prefix.
99 - global $wpdb;
100 - $wpdb->query( 'INSERT IGNORE INTO ' . $wpdb->prefix . "options (option_name, option_value, autoload) SELECT REPLACE(option_name, 'webarx_', 'patchstack_') as option_name, option_value, autoload FROM " . $wpdb->prefix . "options WHERE option_name like 'webarx_%'" );
101 - $wpdb->query( 'UPDATE ' . $wpdb->prefix . 'options AS a SET option_value = (SELECT option_value FROM ' . $wpdb->prefix . "options WHERE option_name = REPLACE(a.option_name, 'patchstack_', 'webarx_')) WHERE option_name LIKE 'patchstack_%'" );
102 -
103 - // Deactivate the plugin.
104 - include_once ABSPATH . 'wp-admin/includes/plugin.php';
105 - deactivate_plugins( array( 'webarx/webarx.php' ) );
106 - update_option( 'patchstack_license_free', '0' );
107 - }
108 -
109 95 return true;
110 96 }
111 97
112 98 /**
@@ -136,8 +122,27 @@
136 122 // Bail early if requirements are not met.
137 123 if ( ! $this->check_requirements() ) {
138 124 $this->requirements_not_met_notice();
139 125 exit;
126 + }
127 +
128 + // Check if the webarx/webarx.php plugin is present, if so, remove it.
129 + if ( is_dir( WP_PLUGIN_DIR . '/webarx' ) ) {
130 +
131 + // Migrate all current options to the new prefix.
132 + global $wpdb;
133 + $exists = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "options WHERE option_name = 'webarx_api_token'" );
134 +
135 + // Move over the options.
136 + if ( !is_null( $exists ) && $exists >= 1 ) {
137 + $wpdb->query( 'INSERT IGNORE INTO ' . $wpdb->prefix . "options (option_name, option_value, autoload) SELECT REPLACE(option_name, 'webarx_', 'patchstack_') as option_name, option_value, autoload FROM " . $wpdb->prefix . "options WHERE option_name like 'webarx_%'" );
138 + $wpdb->query( 'UPDATE ' . $wpdb->prefix . 'options AS a SET option_value = (SELECT option_value FROM ' . $wpdb->prefix . "options WHERE option_name = REPLACE(a.option_name, 'patchstack_', 'webarx_')) WHERE option_name LIKE 'patchstack_%'" );
139 + }
140 +
141 + // Deactivate the plugin.
142 + include_once ABSPATH . 'wp-admin/includes/plugin.php';
143 + deactivate_plugins( array( 'webarx/webarx.php' ) );
144 + update_option( 'patchstack_license_free', '0' );
140 145 }
141 146
142 147 // Make sure any rewrite functionality has been loaded.
143 148 $this->migrate();