Skip to content

Conversation

@Konamiman
Copy link
Contributor

@Konamiman Konamiman commented Oct 19, 2022

Changes proposed in this Pull Request:

  1. Introduce a new filter, woocommerce_feature_description_tip, that allows customizing the message that appears under the description of each feature in the features settings page.

  2. Use the new filter to show a warning under the custom orders table feature if the feature is enabled and there are orders pending synchronization (since it's not really a good idea to disable the feature in this case).

  3. Change the styling of the "WooCommerce has detected that some of your active plugins are incompatible with currently enabled WooCommerce features" notice from warning to error.

  4. Display the above error in all the admin pages, except in the plugins page when we are already displaying the "You are viewing plugins that are incompatible with..." notice (since it's redundant in this case).

Related to (but doesn't close): #35097

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Enable the COT feature but disable sync, and modify one or more orders. Alternatively, change DataSynchronizer::handle_feature_description_tip so that $pending_sync_count gets a fixed value.

  2. Go to the features page and you should see a warning under the description of the feature:

image

Note that the message changes depending on which is the authoritative table and on whether the number of orders pending sync is one or more.

  1. Force enable a plugin that is incompatible with the COT feature (e.g. wp plugin activate woocommerce-bookings from CLI)

  2. Make sure that you see the "WooCommerce has detected that some of your active plugins are incompatible with currently enabled WooCommerce features" warning from any admin page, and styled as an error:

image

  1. Click "Review the details" in the error and verify that in the plugins page you are redirected to you see the "You are viewing plugins that are incompatible with currently enabled WooCommerce features" notice but not the previous error. However if you go to the "All" view you will see the error again.

image

  1. Add &feature_id=custom_order_tables to the url and reload, the notice should mention the COT feature this time, but the error should still not be here.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm changelog add --filter=<project>?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

Also fix some code styling stuff.
...and use it to display a warning for the COT feature
if there are orders pending sync.
...except in the plugins list when we are already showing the
"You are viewing plugins with incompatibilities" page.

Also change the styling from warning to error.
@Konamiman Konamiman self-assigned this Oct 19, 2022
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Oct 19, 2022
@Konamiman Konamiman requested review from a team and vedanshujain and removed request for a team October 19, 2022 14:34
@github-actions
Copy link
Contributor

New hook, template, or database changes in this PR

New hooks:

  • file: /plugins/woocommerce/src/Internal/Features/FeaturesController.php
    • NOTICE - 'woocommerce_feature_description_tip' introduced in 7.1.0: Filter to customize the description tip that appears under the description of each feature in the features settings page.

@github-actions github-actions bot added the release: highlight Issues that have a high user impact and need to be discussed/paid attention to. label Oct 19, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 19, 2022

Test Results Summary

Commit SHA: c0f469e

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests19600201980m 47s
E2E Tests186003018915m 5s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

Copy link
Contributor

@vedanshujain vedanshujain left a comment

Choose a reason for hiding this comment

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

LGTM! Will merge after CI passes.

@vedanshujain vedanshujain merged commit cc0c4ef into trunk Oct 20, 2022
@vedanshujain vedanshujain deleted the improve-plugin-feature-compatibility-warnings branch October 20, 2022 10:04
@github-actions github-actions bot added this to the 7.2.0 milestone Oct 20, 2022
@github-actions
Copy link
Contributor

Hi @vedanshujain, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

@jonathansadowski jonathansadowski modified the milestones: 7.2.0, 7.1.0 Oct 20, 2022
github-actions bot pushed a commit that referenced this pull request Oct 20, 2022
…res (#35198)

* Use AccessiblePrivateMethods in DataSynchronizer.

Also fix some code styling stuff.

* Introduce the woocommerce_feature_description_tip filter.

...and use it to display a warning for the COT feature
if there are orders pending sync.

* Display the plugin-feature incompatibility warning in all admin pages.

...except in the plugins list when we are already showing the
"You are viewing plugins with incompatibilities" page.

Also change the styling from warning to error.

* Add changelog file

* Revert accidental change.

Co-authored-by: Vedanshu Jain <[email protected]>
jonathansadowski pushed a commit that referenced this pull request Oct 20, 2022
* Improve the warnings about incompatibilites between plugins and features (#35198)

* Use AccessiblePrivateMethods in DataSynchronizer.

Also fix some code styling stuff.

* Introduce the woocommerce_feature_description_tip filter.

...and use it to display a warning for the COT feature
if there are orders pending sync.

* Display the plugin-feature incompatibility warning in all admin pages.

...except in the plugins list when we are already showing the
"You are viewing plugins with incompatibilities" page.

Also change the styling from warning to error.

* Add changelog file

* Revert accidental change.

Co-authored-by: Vedanshu Jain <[email protected]>

* Prep for cherry pick 35198

Co-authored-by: Néstor Soriano <[email protected]>
Co-authored-by: Vedanshu Jain <[email protected]>
Co-authored-by: WooCommerce Bot <[email protected]>
mcliwanow pushed a commit that referenced this pull request Oct 25, 2022
…res (#35198)

* Use AccessiblePrivateMethods in DataSynchronizer.

Also fix some code styling stuff.

* Introduce the woocommerce_feature_description_tip filter.

...and use it to display a warning for the COT feature
if there are orders pending sync.

* Display the plugin-feature incompatibility warning in all admin pages.

...except in the plugins list when we are already showing the
"You are viewing plugins with incompatibilities" page.

Also change the styling from warning to error.

* Add changelog file

* Revert accidental change.

Co-authored-by: Vedanshu Jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin. release: highlight Issues that have a high user impact and need to be discussed/paid attention to.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants