-
Notifications
You must be signed in to change notification settings - Fork 799
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
Add/module products #22596
Add/module products #22596
Conversation
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 (other than "Required review") appearing at the bottom of this PR are passing or skipped. |
285c040
to
cfc0627
Compare
} | ||
|
||
if ( ! class_exists( 'Jetpack' ) ) { | ||
return new WP_Error( 'plugin_activation_failed', __( 'Error activating Jetpack plugin', 'jetpack-my-jetpack' ) ); |
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 think in general we should add an array( 'status' => XXX )
as the third parameter of the error instance. It will help to deal with the errors on the client-side.
For instance, when I try to activate the scan
product I gen an error which is expected (comment here). However, the error status code is 500
from the request, and it doesn't contain any status in its response (data null).
I wonder if we can use one of the standard codes when it fails.
In this case, may we use 401?
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.
Sure! This should be handled by the REST API endpoint. Let's address this in another PR
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.
ok, it can get trickier from there since we'll have to check the type of error before populating the error.
Generally, it just checks if is_wp_error()
. If so, it just sends the error to the client.
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.
Left a comment about response error, we can polish it in follow-up PRs, though.
It works as expcted. I could activate/deactivate the VideoPress module from My Jetpack properly.
LGTM.
Adds the backend for Module Products
Changes proposed in this Pull Request:
Jetpack product discussion
p9dueE-4g1-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions: