Memberships: register WP Abilities API reads (plans, subscribers, earnings)#48768
Memberships: register WP Abilities API reads (plans, subscribers, earnings)#48768enejb wants to merge 1 commit into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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 🤖 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
Proposed changes
Automattic\Jetpack\Plugin\Abilities\Memberships_Abilities, aRegistrar-extending class atprojects/plugins/jetpack/modules/memberships/abilities/class-memberships-abilities.php.jetpack-memberships/*namespace:jetpack-memberships/list-plans— paid membership tiers withplan_idconsolidated-read.jetpack-memberships/list-subscribers— paid-membership subscribers with status / plan filters.jetpack-memberships/get-earnings-summary— zero-arg earnings summary for the current period.modules/memberships/class-jetpack-memberships.php— registration only happens when the Memberships module is active.jetpack_wp_abilities_enabledfilter (defaultfalse).edit_postsfor plans,manage_optionsfor subscriber + earnings reads).Testing instructions
cd projects/plugins/jetpack && composer install.composer phpunit -- --filter Memberships_Abilities_Test./wp-json/wp-abilities/v1/abilities | jq '.[] | select(.name | startswith("jetpack-memberships/")) | .name'and confirm three slugs.Plan reference
Abilities rollout plan — §3.3 Memberships module.