PluginProbe
Patchstack – WordPress & Plugins Security / 2.1.21
Patchstack – WordPress & Plugins Security v2.1.21
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/upload.php +11 -2 2.1.182.1.21 View file →
@@ -32,8 +32,9 @@
32 32
33 33 // In case a plugin or upgrade has been performed, re-synchronize with the app.
34 34 add_action( 'activated_plugin', array( $this, 'upload_software' ) );
35 35 add_action( 'deactivated_plugin', array( $this, 'upload_software' ) );
36 + add_action( 'deleted_plugin', array( $this, 'upload_software' ) );
36 37 add_action( 'upgrader_process_complete', array( $this, 'upload_software' ) );
37 38 add_action( '_core_updated_successfully', array( &$this, 'upload_software' ) );
38 39 }
39 40
@@ -46,9 +47,9 @@
46 47 public function upload_software() {
47 48 // Get the software data and hash.
48 49 $data = $this->get_software_data();
49 50 $hash = sha1( json_encode( $data ) );
50 - if ( ! defined( 'DOING_CRON' ) && ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash ) {
51 + if ( ! defined( 'DOING_CRON' ) && ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash && ! is_admin() ) {
51 52 return;
52 53 }
53 54
54 55 // Synchronize the software list with the API.
@@ -199,8 +200,16 @@
199 200 $plugin_name = empty( $plugin_data['Name'] ) ? '' : $plugin_data['Name'];
200 201 $plugin_version = empty( $plugin_data['Version'] ) ? '' : $plugin_data['Version'];
201 202
202 203 if ( ! empty( $plugin_name ) && ! empty( $plugin_version ) ) {
204 +
205 + // Determine the active state.
206 + if ( isset( $_GET['action'], $_GET['plugin'] ) && $_GET['action'] == 'deactivate' && $_GET['plugin'] == $plugin) {
207 + $active = 0;
208 + } else {
209 + $active = (int) is_plugin_active( $plugin );
210 + }
211 +
203 212 $software_list[] = array(
204 213 'sw_type' => 'plugin',
205 214 'sw_name' => $plugin_name,
206 215 'sw_cur_ver' => $plugin_version,
@@ -205,9 +214,9 @@
205 214 'sw_name' => $plugin_name,
206 215 'sw_cur_ver' => $plugin_version,
207 216 'sw_new_ver' => $new_version,
208 217 'sw_key' => $plugin,
209 - 'sw_active' => is_plugin_active( $plugin ),
218 + 'sw_active' => $active
210 219 );
211 220 }
212 221 }
213 222