Simple Payments: Only fire init hooks if enabled
There exists a jetpack_disable_simple_payments filter, but it does not prevent the init hooks from firing, thus the CPT and shortcode are still registered.
Changes proposed in this Pull Request:
- Check if Simple Payments are enabled before use.
This is likely incomplete. It looks like right now we still want the shortcode enabled so we can display an warning to an admin when it is disabled. May want to juggle things around a bit.
Jetpack product discussion
None at this time.
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
- Add
add_filter( 'jetpack_disable_simple_payments', '__return_true' );to a connected Jetpack site with a higher plan. - Check the list of CPTs on the site to see if
jp_pay_orderis included or not.
Caution: This PR has changes that must be merged to WordPress.com Hello kraftbj! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D76250-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you! This revision will be updated with each commit to this PR
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
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 :robot:
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. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Jetpack plugin:
- Next scheduled release: October 4, 2022.
- Scheduled code freeze: September 27, 2022.
@kraftbj Just noticing this in the 10.8 milestone, is this PR ready for review or is it still in progress?
@kraftbj it looks like this is still in progress?
@coder-karen Ah, I totally forgot about this one. I moved it out of the milestone, but will put it back if I'm solid with it before I leave today. Otherwise, we'll leave it for 11.0.
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack disable/simple-payments-with-filter to get started. More details: p9dueE-5Nn-p2
Closing this for now because of the lack of activity on this. We can always reopen in the future if needed.