-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
[CYS] Patterns Migration: Performance - ensure the initial request to fetch patterns from the PTK is async #47551
Conversation
…d tracking option updates
…n and on allowing tracking
Hi @gigitux, @nefeline, @kmanijak, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, @albarin !
I just noticed some mixups in the testing instructions:
When the woocommerce_allow_tracking option changes to enabled, PTK patterns are fetched
Go to wp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com and make sure Allow usage of WooCommerce to be tracked is unchecked.
In this case you meant "checked", right?
When the WooCommerce plugin is updated, PTK patterns are fetched
Install WooCommerce from this ZIP file.
The link to zip file is missing :)
Apart from that, everything else is testing great and working as expected!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Great job on adding unit tests 🚀
I'm pre-approving the PR, but I left a minor comment! Let me know what you think about it!
Install WooCommerce from this ZIP file.
Regarding this step, I tested it installing the same zip generated by this PR twice. In any case, as @nefeline noted, it makes sense uploaded a zip file!
@nefeline I think it's correct because the test is to confirm that patterns are fetched when it changes from unchecked to checked. So in step 1, we uncheck it, and then in step 2, we check it. Does it make sense? @nefeline @gigitux Thanks for your reviews 🙏 I'll update the zip! 🤦 |
🤔 Edit: nevermind, I missed step 2, all good 🙌 |
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR ensures requests to the PTK API are done async when:
woocommerce_allow_tracking
option changes to enabled.woocommerce_allow_tracking
is enabled).Also ensures that the PTK patterns cache is flushed when:
woocommerce_allow_tracking
option is disabled.Closes #47403
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Pre-requisites
wp-admin/tools.php?page=woocommerce-admin-test-helper
, go toFeatures
, and enable thepattern-toolkit-full-composability
.Transients Manager
plugin (this is just for convenience since it provides an easy way of removing transients from the database).When the
woocommerce_allow_tracking
option changes to enabled, PTK patterns are fetchedwp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
and make sureAllow usage of WooCommerce to be tracked
is unchecked.Save
.wp-admin/tools.php?page=action-scheduler
, search for thefetch_patterns
action, and make sure it was scheduled.Run
under the action name if it is still pending and wait until is completed.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and make sure theptk_patterns
transient is set.Intro: Left-aligned header and button
pattern.When the WooCommerce plugin is activated (if
woocommerce_allow_tracking
is enabled), PTK patterns are fetchedwp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
and make sureAllow usage of WooCommerce to be tracked
is checked.WooCommerce
plugin.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and delete theptk_patterns
transient if present.wp-admin/tools.php?page=action-scheduler
, search for thefetch_patterns
action, and make sure it was scheduled.Run
under the action name if it is still pending and wait until is completed.Intro: Left-aligned header and button
pattern.When the WooCommerce plugin is updated, PTK patterns are fetched
wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and delete theptk_patterns
transient.Plugins
and click onupdate
to update theWooCommerce
plugin.wp-admin/tools.php?page=action-scheduler
, search for thefetch_patterns
action, and make sure it was scheduled (don't worry if it fails, it should at this point).When the WooCommerce plugin is deactivated, PTK patterns are flushed
wp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
and make sureAllow usage of WooCommerce to be tracked
is checked.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and make sure theptk_patterns
transient is set.Plugins
and disableWooCommerce
.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and make sure theptk_patterns
transient is not present.Intro: Left-aligned header and button
pattern.When the
woocommerce_allow_tracking
option is disabled, PTK patterns are flushedwp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
and make sureAllow usage of WooCommerce to be tracked
is checked.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and make sure theptk_patterns
transient is set.wp-admin/admin.php?page=wc-settings&tab=advanced§ion=woocommerce_com
, uncheckAllow usage of WooCommerce to be tracked
, and save.wp-admin/tools.php?s=ptk_patterns&page=transients-manager
and make sure theptk_patterns
transient is not present.Intro: Left-aligned header and button
pattern.Changelog entry
Significance
Type
Message
[CYS] Ensure fetch PTK patterns requests are always done async to improve performance.
Comment