Plans: register WP Abilities API (current plan, plan catalog, purchase URL)#48765
Plans: register WP Abilities API (current plan, plan catalog, purchase URL)#48765enejb wants to merge 1 commit into
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 🤖 🔴 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! |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage Summary1 file is newly checked for coverage.
|
Proposed changes
Automattic\Jetpack\Plans\Abilities\Plans_Abilities, aRegistrar-extending class underprojects/packages/plans/src/abilities/class-plans-abilities.php.jetpack-plans/*namespace:jetpack-plans/get-current-plan— zero-arg read of the site's active Jetpack plan (slug, name, expiry, features, product_id, billing period, supports map).jetpack-plans/list-plans— Jetpack plan catalog with optionalcategoryfilter (security|all;performancedocumented as a synonym forallsince no separate performance grouping exists in the catalog today).jetpack-plans/get-purchase-url— mint a checkout URL for a given plan slug. URL-mint only, no state change.projects/packages/plans/actions.php(added tocomposer.jsonautoload.files) using the canonical guarded pattern. The plans package is depended on by Jetpack + every standalone plugin (boost, social, search, protect, backup, …), so the abilities surface in every consumer.automattic/jetpack-wp-abilitiesas a runtime dependency.jetpack_wp_abilities_enabledfilter (defaultfalse).Testing instructions
composer installfromprojects/packages/plans/.composer phpunit -- --filter Plans_Abilities_Test./wp-json/wp-abilities/v1/abilities | jq '.[] | select(.name | startswith("jetpack-plans/")) | .name'and confirm the three slugs.Plan reference
Abilities rollout plan — §4.2 Plans package.