Comments: add the subscription options to the form - #52439
arcangelini wants to merge 27 commits 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 🤖 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. |
Code Coverage SummaryCoverage changed in 1 file.
|
dff0cec to
0d5b964
Compare
Fixes #
Proposed changes
Brings Verbum's subscription tray to the new comment form, working the same on Simple, Atomic and self-hosted with no iframe. It is all email.
wpcom/v2/comments/subscriptionsroute, which relays the reader's email to a new blog-token endpoint,wpcom/v2/sites/{id}/comments/subscriptions, and hands back whatever WordPress.com answered, status and all, the way the podcast package's relays do. Simple serves no REST API on the site host and the route needs the passport cookie, so there the same route is dispatched in process from thejetpack_comments_subscriptionsadmin-ajax action.stb_enabledandstc_enabledsettings while the module is active.Not in this PR: the "Discover more from" modal after posting. That's a follow-up.
The source is laid out as the form reads:
form/for the card and text box,tray/for what opens under it withsubscriptions/inside,footer/for the avatar, gear and submit button, andidentity/for the popup sign-in and passport, which renders nothing. Each directory keeps its types in its owntypes.ts.Companion WordPress.com change, wpcom PR 242912, on branch
add/jetpack-comments-subscriptions: the endpoint. It takes the email, the post, the four options, and the passport'ssite_commenter_id, which it verifies through the Consulate before honoring "Notify me of new posts", plus the reader's IP and user agent for bkismet. It lands first. Until it does, the tray reads as "no subscription" and toggles snap back.Related product discussion/links
Does this pull request change what data or activity we track or use?
No new tracking. Subscriptions from the form carry
jetpack-comments-toggleas their source, a new value for the existingblog-subscribe-sourcestat on WordPress.com.Testing instructions
Needs a site with
add_filter( 'jetpack_comments_new_hotness', '__return_true' )and thecomment-new-hotnesssticker, the Subscriptions module active, and the companion WordPress.com branch on your sandbox.stb_enabledandstc_enabledboth off, the gear disappears and the tray stays open showing only the heading and Log out.