Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat Checker – Adds perma-dismissible warning notices #85

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

ibndawood
Copy link
Contributor

@ibndawood ibndawood commented Oct 11, 2023

Changes proposed in this Pull Request:

Closes #84 .

In this PR:

  • We use WC_Admin_Notices to add dismissible warnings stored in the usermeta table.
  • If WC_Admin_Notices is unavailable due to WooCommerce being de-activated and the notice is not a warning, we display the non-dismissible error notice.
  • Fixes a couple of phpcs warnings.

Screenshots:

image

Detailed test instructions:

  1. Setup Compat Checker in a WooCommerce extension by following the Getting Started section.
  2. Set the WC Tested upto of the WooCommerce extension plugin header file to less than the current active WooCommerce version.
  3. Activate the extension and notice the warning as shown in the above screenshot.
  4. Click on the Dismiss button to dismiss the warning.
  5. Visiting the page again should not display this warning.

Additional details:

  • The PR uses add_custom_notice method of WC_Admin_Notices.
  • WC_Admin_Notices appear only in the plugins, dashboard and WooCommerce pages.

Changelog entry

Add - Perma-dismissible warning notices.

@ibndawood ibndawood self-assigned this Oct 11, 2023
Copy link
Contributor

@layoutd layoutd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 This looks OK!

  • The message was displayed only once (and the dismissal was stored in the usermeta.
  • From what I can tell, the accent color is just based on the store's main theme, right?
  • I had to manually copy the new files into the extension vendor/woocommerce/grow directory to test.

@ibndawood
Copy link
Contributor Author

Thank you, @layoutd, for your review. Yes, the color is not set by our code but the custom notices are set by WooCommerce itself.

@ibndawood ibndawood merged commit bb3d2f2 into trunk Oct 11, 2023
1 check passed
@ibndawood ibndawood deleted the add/perma-dismissable-warnings branch October 11, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compat Checker – Make warning notices perma-dismissible using WooCommerce Admin notices whenever available
2 participants