Skip to content

Podcast: add product-access gate and grandfather sticker constant#48702

Open
robertbpugh wants to merge 6 commits into
trunkfrom
pods-141-add-gate-helper-and-grandfather-sticker-constant
Open

Podcast: add product-access gate and grandfather sticker constant#48702
robertbpugh wants to merge 6 commits into
trunkfrom
pods-141-add-gate-helper-and-grandfather-sticker-constant

Conversation

@robertbpugh
Copy link
Copy Markdown
Contributor

Fixes PODS-141

Proposed changes

  • New Podcast_Gate::has_product_access() returns true when the current blog either carries the podcasting-grandfathered sticker or the active plan supports podcasting.
  • The plan check goes through Current_Plan::supports, which short-circuits to wpcom_site_has_feature on Simple/Atomic and falls through to cached plan data on self-hosted Jetpack — one helper, correct on every host.
  • jetpack-plans added to require so Current_Plan is always autoloaded.
  • Tests cover sticker hit, plan-supports hit, and denied. The test bootstrap defines a wpcom_has_blog_sticker stub that reads from $GLOBALS['jetpack_podcast_test_stickers'].

Related product discussion/links

  • Linear: PODS-141

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

No.

Testing instructions

  • cd projects/packages/podcast && composer phpunit — 59 tests, 145 assertions pass.
  • No UI in this PR. Downstream untangle issues (PODS-145 dashboard tab, PODS-146 stats endpoint, PODS-147 episode block, PODS-148 AI shownotes) call this helper.

Open follow-ups (separate work)

  • Add const PODCASTING = 'podcasting' to WPCOM_Features in wpcom and wpcomsh so the wpcom-platform short-circuit activates.
  • Backfill the podcasting-grandfathered sticker on the existing audio-upload cohort.

Adds `Podcast_Gate::has_product_access()` as the single entry point downstream
gates (dashboard tab, stats endpoint, episode block, AI shownotes) will call.
Two ways to pass: the `podcasting-grandfathered` blog sticker, or
`Current_Plan::supports( 'podcasting' )` — which short-circuits to
`wpcom_site_has_feature` on Simple/Atomic and falls through to cached plan
data on self-hosted Jetpack, so the same helper is correct on every host.
@robertbpugh robertbpugh self-assigned this May 11, 2026
@robertbpugh robertbpugh requested a review from arcangelini May 11, 2026 17:55
@github-actions
Copy link
Copy Markdown
Contributor

Are you an Automattician? The PR will need to be tested on WordPress.com. This comment will be updated with testing instructions as soon the build is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

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: June 2, 2026
    • Code freeze: June 1, 2026

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


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

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


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

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

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 11, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 11, 2026

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

* Drop @phan-suppress-next-line PhanUndeclaredClassMethod on the two
  Atomic-only branches in class-tracks (Current_Plan::get,
  Tracking::tracks_record_event). Adding automattic/jetpack-plans to
  the package require pulls in the connection package transitively,
  so phan now resolves both classes and the suppressions are unused.
* Regenerate the three plugin composer.locks (jetpack, mu-wpcom-plugin,
  wpcomsh) that reference automattic/jetpack-podcast, picking up the
  new jetpack-plans dep.
Matches sibling changelog entries in projects/packages/podcast/changelog
(add-podcast-tracks, add-podcast-settings, add-podcast-package) which all
use `minor` for new added surface area.
Required by the pre-push changelog check now that the previous commit
touched jetpack/mu-wpcom-plugin/wpcomsh composer.lock files.
@github-actions github-actions Bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh labels May 11, 2026
@robertbpugh robertbpugh marked this pull request as ready for review May 11, 2026 19:04
Copilot AI review requested due to automatic review settings May 11, 2026 19:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a reusable product-access gate for the Jetpack Podcast package, allowing premium podcast features to be conditionally enabled based on either a “grandfathered” blog sticker or plan feature support via Current_Plan::supports(). It also wires in the jetpack-plans dependency needed for that plan check and updates relevant lockfiles and changelog entries.

Changes:

  • Add Podcast_Gate::has_product_access() with constants for the podcasting feature slug and the grandfathering sticker.
  • Add PHPUnit coverage for sticker-based allow, plan-feature allow, and deny cases (including a test stub for wpcom_has_blog_sticker).
  • Add automattic/jetpack-plans to jetpack-podcast dependencies and update plugin composer.lock files accordingly.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/plugins/wpcomsh/composer.lock Updates the jetpack-podcast path package metadata to include the new jetpack-plans dependency.
projects/plugins/wpcomsh/changelog/pods-141-add-gate Records the lockfile update for wpcomsh.
projects/plugins/mu-wpcom-plugin/composer.lock Updates the jetpack-podcast path package metadata to include the new jetpack-plans dependency.
projects/plugins/mu-wpcom-plugin/changelog/pods-141-add-gate Records the lockfile update for mu-wpcom-plugin.
projects/plugins/jetpack/composer.lock Updates the jetpack-podcast path package metadata to include the new jetpack-plans dependency.
projects/plugins/jetpack/changelog/pods-141-add-gate Adds a Jetpack plugin changelog entry related to the lockfile update.
projects/packages/podcast/composer.json Adds automattic/jetpack-plans so Current_Plan is consistently available.
projects/packages/podcast/src/class-podcast-gate.php Introduces the new Podcast_Gate access-check helper and related constants.
projects/packages/podcast/tests/php/Podcast_Gate_Test.php Adds tests validating sticker allow, plan-feature allow, and deny behavior.
projects/packages/podcast/tests/php/bootstrap.php Adds a lightweight wpcom_has_blog_sticker stub for the test environment.
projects/packages/podcast/src/class-tracks.php Removes no-longer-needed Phan suppression comments.
projects/packages/podcast/changelog/pods-141-add-gate Adds the package-level changelog entry for the new gate/helper.

Comment thread projects/plugins/jetpack/changelog/pods-141-add-gate Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Podcast [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants