PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.9
Patchstack – WordPress & Plugins Security v2.2.9
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 +5 -2 2.2.82.2.9 View file →
@@ -20,9 +20,9 @@
20 20 public function __construct( $core ) {
21 21 parent::__construct( $core );
22 22
23 23 // In case the software has never been synchronized, force it.
24 - if ( ! get_option( 'patchstack_software_data_hash', false ) ) {
24 + if ( ! get_option( 'patchstack_software_data_hash', false ) && ! get_option( 'patchstack_software_upload_attempted', false )) {
25 25 $this->upload_software();
26 26 }
27 27
28 28 // Register the actions.
@@ -49,11 +49,14 @@
49 49 $data = $this->get_software_data();
50 50 $hash = sha1( json_encode( $data ) );
51 51
52 52 // Do not sync for no reason.
53 - if ( ! defined( 'DOING_CRON' ) && ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash && ! is_admin() ) {
53 + if ( ! defined( 'DOING_CRON' ) && ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash && ! is_admin() && ! defined( 'WP_CLI ' ) ) {
54 54 return;
55 55 }
56 +
57 + // Make sure to not keep calling this function.
58 + update_option( 'patchstack_software_upload_attempted', true );
56 59
57 60 // Synchronize the software list with the API.
58 61 $results = $this->plugin->api->upload_software( [ 'software' => json_encode( $data ) ] );
59 62 if ( isset( $results['success'] ) ) {