woocommerce / grow

7 stars 7 forks source link

Compat Checker – Admin notices are not triggered when WooCommerce is not installed #82

Closed ibndawood closed 1 year ago

ibndawood commented 1 year ago

Describe the bug:

When WooCommerce is not installed, the admin notices from the compat checker compatibility checks are not triggered.

Steps to reproduce:

  1. Setup the compat checker code in any of the plugins by following the Getting Started instructions here: https://github.com/woocommerce/grow/tree/trunk/packages/php/compat-checker#getting-started
  2. On a fresh WordPress installation without WooCommerce installed, activate the plugin.
  3. No admin notice is shown.

Expected behavior:

An admin notice saying that WooCommerce should be installed and activated should be displayed.

Actual behavior:

No admin notice is shown.

Additional details:

The issue is that the manage_woocommerce capability did not exist before WooCommerce was installed and per this code no admin notice is displayed: https://github.com/woocommerce/grow/blob/trunk/packages/php/compat-checker/src/Checks/CompatCheck.php#L68