WIP - add newsletter free tier settings jp#49585
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
There was a problem hiding this comment.
Pull request overview
Adds support for configuring the Newsletter free subscription tier via the existing subscription_options site setting, including sanitization and API exposure across Jetpack’s settings endpoints.
Changes:
- Extend
subscription_optionsto acceptfree_tier_description(HTML stripped + length-capped) andhide_free_tier(boolean). - Update both the WP.com JSON API site settings endpoint and Jetpack Core REST module endpoints to persist these new keys.
- Add/extend PHPUnit coverage and add a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/plugins/jetpack/tests/php/json-api/WPCOM_JSON_API_Site_Settings_V1_4_Endpoint_Test.php | Adds POST tests for free tier description sanitization/length capping and hide flag handling. |
| projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php | Allows and sanitizes new subscription_options keys when updating settings via WP.com JSON API. |
| projects/plugins/jetpack/_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php | Mirrors subscription_options updates/sanitization for the Core REST module endpoints. |
| projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php | Updates schema/description/defaults and validation allowlist for subscription_options. |
| projects/plugins/jetpack/changelog/add-newsletter-free-tier-settings | Documents the new settings in the Jetpack changelog. |
Code Coverage SummaryCoverage changed in 4 files.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Fixes #
Proposed changes
Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions