Skip to content

Comments: add the subscription options to the form - #52439

Open
arcangelini wants to merge 27 commits into
trunkfrom
jetpack-comments-subscrip
Open

arcangelini wants to merge 27 commits into
trunkfrom
jetpack-comments-subscrip

Conversation

@arcangelini

@arcangelini arcangelini commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

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.

  • Everyone gets "Email me new posts" with the Instantly/Daily/Weekly control (a select under 400px) and "Email me new comments". Guests see them under the name and email fields; signed-in readers (site login, or a WordPress.com, Google or Facebook popup sign-in) see them in the tray behind the gear next to their avatar, saved as they change, showing what the reader already has.
  • WordPress.com accounts also get "Notify me of new posts": a Simple login, or a WordPress.com sign-in through the popup.
  • Guests' choices post with the comment, in the fields Simple and Jetpack Subscriptions already read, and the confirmation email follows as it always has.
  • Signed-in readers' choices go to the site's own wpcom/v2/comments/subscriptions route, 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 the jetpack_comments_subscriptions admin-ajax action.
  • WordPress.com's own rules apply. A Simple site runs the request as the reader, so a WordPress.com login's own address is activated on the spot. Any other address, a popup sign-in or a site login elsewhere, gets the confirmation email the subscribe checkbox always sent, and the tray shows the request as on until it is confirmed.
  • A fresh popup sign-in holds only a code until its first comment posts. The subscriptions route redeems the code and issues the passport on first use, so the comment that follows posts on the passport.
  • The avatar button opens the Gravatar quick editor, with an "Edit Gravatar" link while the tray is open.
  • What is offered follows the site: both email options on Simple, as Verbum had it; elsewhere the Subscriptions module's stb_enabled and stc_enabled settings 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 with subscriptions/ inside, footer/ for the avatar, gear and submit button, and identity/ for the popup sign-in and passport, which renders nothing. Each directory keeps its types in its own types.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's site_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-toggle as their source, a new value for the existing blog-subscribe-source stat on WordPress.com.

Testing instructions

Needs a site with add_filter( 'jetpack_comments_new_hotness', '__return_true' ) and the comment-new-hotness sticker, the Subscriptions module active, and the companion WordPress.com branch on your sandbox.

  • Open a post as a guest. Type in the box. The tray opens with the sign-in row. Choose the mail option: under the fields there are "Email me new posts" with the frequency control and "Email me new comments". Turn them on, comment, and confirm the confirmation email arrives and the frequency you picked is on the subscription.
  • Sign in through the WordPress.com popup. The footer shows your avatar and the gear. Type once and the tray opens on its own; after that, only the gear opens it. All three options are there. Flip each and reload: the tray shows the state you left. On Atomic or self-hosted the email toggles send a confirmation email and read as on while pending; "Notify me of new posts" applies at once.
  • Sign in with Google or Facebook. Same tray, email options only, confirmation email on the way.
  • Log in to the site itself. Same footer group and tray. On Simple all three options save at once. On Atomic or self-hosted, the two email toggles, confirmed by email.
  • Click the avatar: the Gravatar editor opens. Change the avatar and the footer image refreshes after a couple of seconds.
  • With stb_enabled and stc_enabled both off, the gear disappears and the tray stays open showing only the heading and Log out.
  • Narrow the window under 400px: the frequency control becomes a select.
  • Try each of the above on a Simple site, an Atomic site and a self-hosted site.

@arcangelini arcangelini added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress labels Sep 17, 2026
@arcangelini arcangelini self-assigned this Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the jetpack-comments-subscrip branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack jetpack-comments-subscrip
bin/jetpack-downloader test jetpack-mu-wpcom-plugin jetpack-comments-subscrip

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Comments [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Docs labels Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ 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 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php 95/511 (18.59%) -0.07% 2 ❤️‍🩹

Full summary · PHP report · JS report

@arcangelini
arcangelini force-pushed the jetpack-comments-subscrip branch from dff0cec to 0d5b964 Compare September 23, 2026 15:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Package] Comments [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant