Skip to content

Conversation

@dkoo
Copy link
Contributor

@dkoo dkoo commented Nov 18, 2025

All Submissions:

Changes proposed in this Pull Request:

Uses a fixed banner to display metering information, intended to be used as a simpler and more global alternative to #4176.

Screenshot 2025-11-18 at 5 03 01 PM

Repurposes existing admin and front-end assets from #4207 for efficiency.

Note that this includes a new ColorPaletteControls component—I originally created this with the intention of being able to customize banner colors, but ultimately opted to use the same "light"/"dark" toggle as the content gifting banner instead. I think the component might come in handy in the future, so I left it in, but it's unused for now. Nevermind, this component is only useful when used inside the block editor due to its dependency on the ColorPaletteControl component from the @wordpress/block-editor package. Importing this component outside of that context borks our Jest tests, so I'll bring it back but outside of the Components package if we need it in the future.

Closes NPPM-2204.

How to test the changes in this Pull Request:

  1. Check out this branch, publish a membership plan that restricts content by active subscription, and a content gate with metering enabled for both anonymous and registered readers.
  2. As an admin, visit Audience > Configuration > Content Gate and confirm you see a new Countdown Banner card here, disabled by default.
  3. Toggle on the Countdown Banner option and confirm it shows the default settings. Refresh and confirm that it's still enabled.
Screenshot 2025-11-18 at 5 05 58 PM
  1. As a anonymous reader, visit some content restricted by the plan and confirm that you see the banner with styles and content matching the preview in the admin page. Confirm that the "Sign in to an existing account" link opens the auth modal, and the "Subscribe now" button opens a modal checkout flow with the primary subscription product.
  2. Continue viewing restricted posts and confirm that the banner shows an accurate number of viewed and total allowed posts for anonymous readers until the regwall starts appearing, after which the banner should no longer appear.
  3. Register a user account. After the post reloads, confirm that the banner reappears, with a new count of viewed and total allowed posts for registered readers.
  4. Continue viewing restricted posts and confirm that the banner continues to show an shows an accurate number of viewed and total allowed posts for registered readers until the paywall starts appearing, after which the banner should no longer appear.
  5. Purchase the required subscription product and confirm that the banner no longer appears anywhere while logged in.
  6. As the admin, tweak the available settings and view the banner in a new reader session. Confirm that all settings and styles match between admin and front-end. Confirm that if a URL is entered for "Subscribe button URL", the button in the banner acts as a link to that URL instead of opening the modal checkout flow.
  7. Smoke test content gifting features to ensure no regressions in that featureset, as some files have been renamed and moved so they can be shared with countdown features.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo self-assigned this Nov 19, 2025
@dkoo dkoo added the [Status] Needs Review The issue or pull request needs to be reviewed label Nov 19, 2025
@dkoo dkoo changed the title Feat/content gate meter countdown feat: metered content countdown banner Nov 19, 2025
@dkoo dkoo marked this pull request as ready for review November 19, 2025 00:14
@dkoo dkoo requested a review from a team as a code owner November 19, 2025 00:14
@dkoo dkoo requested a review from a team November 19, 2025 00:22
@thomasguillot
Copy link
Contributor

@dkoo made some very small tweaks 43b9e0c

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

Labels

[Status] Design Approved [Status] Needs Review The issue or pull request needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants