facebook-for-woocommerce icon indicating copy to clipboard operation
facebook-for-woocommerce copied to clipboard

Adds compat checker for versioning and compatibility

Open ibndawood opened this issue 1 year ago • 1 comments

Changes proposed in this Pull Request:

Closes #2639.

This PR uses the compat-checker library from the WooCommerce Grow repo to run compatibility and versioning checks during the plugin initialisation.

Checks:

  • [x] Does your code follow the WordPress coding standards?
  • [ ] Have you written new tests for your changes, as applicable?
  • [ ] Have you successfully run tests with your changes locally?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Screenshots:

Screenshots are for reference. WooCommerce Brands will be replaced by Facebook for WooCommerce.

WooCommerce not installed

image

WooCommerce not activated

image

WooCommerce not compatible

image

WooCommerce not tested

image

Detailed test instructions:

Pre-requisites

The PR requires deleting transients. A plugin like Transients Manager is recommended to delete the transients between tests.

WooCommerce activation tests

With the above code snippets in place, run the following tests. The instructions are for Facebook for WooCommerce but can be used for other WooGrow Extensions.

  1. Install and activate Facebook for WooCommerce without installing WooCommerce.
  2. Deactivate WooCommerce.
  3. Verify the notice Facebook for WooCommerce requires WooCommerce to be installed and activated. Please install WooCommerce. is displayed.
  4. Install WooCommerce without activating.
  5. Verify the notice Facebook for WooCommerce requires WooCommerce to be activated. Please activate WooCommerce. is displayed.

WooCommerce versioning tests

⚠️ Important note: You will need to erase the transient _transient_wc_grow_compat_checker_[EXTENSION].php[VERSION after each change!!

  1. Install and activate WooCommerce.
  2. Install and activate Facebook for WooCommerce.
  3. Modify the WC requires at least header field and set it to a version higher than the active WooCommerce version. Let's say the WC requires at least is set to 8.2 and the active WooCommerce version is 8.0.2.
  4. Verify the notice Facebook for WooCommerce requires WooCommerce version 8.2 or higher. Please update WooCommerce to the latest version, or download the minimum required version is displayed.
  5. Modify the WC tested up to and set it to a lower version than the active WooCommerce version. Let's say the WC tested up to is set to 7.8, the active WooCommerce version is 8.0.2 and Facebook for WooCommerce version is 3.0.34.
  6. Verify the warning notice Facebook for WooCommerce - 3.0.34 is untested with WooCommerce 8.0.2 is displayed.

L2 support recommendation notice

  1. Download the latest minus three WooCommerce version and activate it. Let's say 7.6.
  2. Verify the warning notice Heads up! Facebook for WooCommerce will soon discontinue support for WooCommerce 7.6. Please update WooCommerce to take advantage of the latest updates and features.

WordPress versioning tests

⚠️ Important note: You will need to erase the transient _transient_wc_grow_compat_checker_[EXTENSION].php[VERSION after each change!!

  1. Modify the Tested up to and set it to a lower version than the current WordPress version. Let's say the Tested up to is set to 6.2, the active WordPress version is 6.3, and the Facebook for WooCommerce version is 3.0.34.
  2. Verify the warning notice Facebook for WooCommerce - 3.0.34 is untested with WordPress 6.3 is displayed.

Additional Details

To delete a transient using Transients Manager, navigate to Tools > Transients, search for wc_grow and delete the transient.

Changelog entry

Add - Versioning and compatibility checks to implement support policy.

ibndawood avatar Oct 06 '23 15:10 ibndawood

Thank you, @rawdreeg, for taking the time to review the PR. I've pushed a couple of commits addressing your comments. Please let me know your thoughts.

ibndawood avatar Oct 12 '23 06:10 ibndawood