Skip to content

Notifications: gate v3 panel behind hosting-dashboard-opt-in preference#49560

Open
arthur791004 wants to merge 1 commit into
trunkfrom
update/notifications-v3-hosting-dashboard-gate
Open

Notifications: gate v3 panel behind hosting-dashboard-opt-in preference#49560
arthur791004 wants to merge 1 commit into
trunkfrom
update/notifications-v3-hosting-dashboard-gate

Conversation

@arthur791004

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

  • Replaces the notifications=v3 query-parameter gate (added in Notifications: gate v3 panel behind a notifications=v3 query parameter #49514) with a check on the current user's calypso_preferences['hosting-dashboard-opt-in'] value. When that value is 'opt-in', the notifications admin-bar item renders #wpnt-notes-panel3 (v3 panel/iframe); otherwise it renders #wpnt-notes-panel2.
  • Mirrors the gate used by the wpcom admin-bar "All Sites" logo, so a user who opted into the hosting dashboard gets the v3 notifications experience automatically — no URL flag required.
  • Guards get_user_attribute() with function_exists() so self-hosted Jetpack sites (where the function and the preference don't exist) safely fall back to the v2 panel.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No. It reads an existing user preference (calypso_preferences) to decide which notifications panel markup to render.

Testing instructions

  • On a WoA/Atomic site (where get_user_attribute() and calypso_preferences are available):
    • As a user without the hosting dashboard opt-in, load any admin page and inspect the notifications admin-bar item — the panel div should be #wpnt-notes-panel2.
    • Set the user's calypso_preferences['hosting-dashboard-opt-in']['value'] to opt-in, reload, and confirm the panel div is now #wpnt-notes-panel3 and clicking the bell opens the v3 panel (iframe https://widgets.wp.com/notifications/app/) in a browser that allows third-party cookies.
  • On a self-hosted Jetpack site, confirm the notifications bell still renders #wpnt-notes-panel2 and is unaffected.

Replace the `notifications=v3` query parameter gate with the user's
`calypso_preferences['hosting-dashboard-opt-in']` value, mirroring the
wpcom admin-bar "All Sites" logo gate. Falls back to v2 when
get_user_attribute() is unavailable (self-hosted Jetpack).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arthur791004 arthur791004 added the [Status] Needs Review This PR is ready for review. label Jun 11, 2026
@arthur791004 arthur791004 self-assigned this Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 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), and enable the update/notifications-v3-hosting-dashboard-gate branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/notifications-v3-hosting-dashboard-gate

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 the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 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: July 7, 2026
    • Code freeze: July 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 Jun 11, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/modules/notes.php 0/102 (0.00%) 0.00% 3 ❤️‍🩹

Full summary · PHP report · JS report

@arthur791004 arthur791004 requested a review from a team June 11, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant