woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woo.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

Adding heartbeat actions cleanup. #1010

Closed message-dimke closed 2 months ago

message-dimke commented 2 months ago

Changes proposed in this Pull Request:

Closes #1008 .

Cancels all the Pinterest for WooCommerce Heartbeat jobs on plugin disconnect, deactivate and WooCommerce deactivate events.

The wrong behavior is that after disconnecting, you still have some Pinterest for WooCommerce actions running, which require Pinterest connection to function. The same is true for deactivating the plugin.

WooCommerce_status_‹_WordPress_Pinterest_—_WordPress-2

Detailed test instructions:

Scenario 1. Disconnect plugin.

  1. Connect to Pinterest.
  2. Go to WooCommerce - Status - Scheduled Actions - Pending.
  3. Observe four scheduled actions.
WooCommerce_status_‹_WordPress_Pinterest_—_WordPress
  1. Go to Marketing - Pinterest - Connection.
  2. Disconnect from Pinterest.
  3. Go to WooCommerce - Status - Scheduled Actions - Pending.
  4. Observe that there are no Pinterest for WooCommerce actions scheduled.
WooCommerce_status_‹_WordPress_Pinterest_—_WordPress-3

Scenario 2. Deactivate plugin.

  1. Connect to Pinterest.
  2. Go to WooCommerce - Status - Scheduled Actions - Pending.
  3. Observe four scheduled actions.
  4. Go to Plugins.
  5. Deactivate the Pinterest for WooCommerce plugin.
  6. Go to WooCommerce - Status - Scheduled Actions - Pending.
  7. Observe that there are no Pinterest for WooCommerce actions scheduled.

Changelog entry

Fix - Cancel hourly and daily plugin jobs on disconnect and deactivate.