-
Notifications
You must be signed in to change notification settings - Fork 800
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
WPCOMSH: Post transfer action to conditionally enable HPOS on WooCommerce sites #38119
Conversation
8e96c92
to
5648b70
Compare
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
8076320
to
cd5b714
Compare
} | ||
|
||
// Enable HPOS | ||
$result = WP_CLI::runcommand( |
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.
As above, can we make a more direct call for this? It may be worth going via WP_CLI for this one, as getting the general load status right for WooCommerce may be easier from the CLI command than from "raw" code.
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.
Can you elaborate a little? We're already using the WP_CLI in this case so I'm not sure what the change would be.
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.
I did some digging and the wc hpos enable
command has quite a bit going on behind this scenes (as does manually enabling HPOS from the settings).
My inclination is to leave this as a WP_CLI
command.
f734867
to
93c20c0
Compare
93c20c0
to
8d69d3a
Compare
@sixhours I think it's my fault. I changed the flag to The instructions are updated if you wouldn't mind trying again. |
8d69d3a
to
7cf045c
Compare
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.
That did it :) 👍
Related to 1468
Proposed changes:
Along with D153524-code, this adds a more general fix for the issue where some WooCommerce sites did not have HPOS enabled after the Atomic transfer.
This adds a new post-transfer action which checks to see if HPOS needs to be enabled for the site and enables it.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Note that we can't do a complete end-to-end test until this PR and the corresponding WPCOM diff (D153524) have been deployed. Once these both ship, the functionality will be gated to Serenity users and we can do a full test and remove the gate.
Setup
https://wordpress.com/hosting-config/yourtestsite.wpcomstaging.com
) and ensure that ssh is enabled.wp wc hpos status
). If it's enabled, disable it by runningwp wc hpos disable
.Testing
1468-update/hpos-wpcomsh-wpcli
) to the Jetpack project on your local machine.jetpack rsync wpcomsh yourtestsite.wordpress.com@sftp.wp.com:htdocs/wp-content/mu-plugins
(replace yourtestsite with the actual name of your test site) to copy the wpcomsh changes to your WoA site.wp shell
.do_action( 'wpcomsh_woa_post_transfer', array(), array( 'enable_woocommerce_hpos' => true ) );
.CTRL-D
to exit the wp shell (this ensures PHP shutdown runs and we send the appropriate messages to logstash.wp wc hops status
and verify that HPOS is now enabled.