Skip to content

Conversation

@miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Nov 19, 2025

All Submissions:

Changes proposed in this Pull Request:

NPPD-1014 NPPD-1015 NPPD-1016 NPPD-1017

A few tweaks to content gifting:

  1. Ensure the URL query arg takes precedent over the cookie
  2. Render a warning notice in the wizard in case one of the published gates (not all) has metering on
  3. Render an error notice in the wizard in case all published gates have metering on (no article will be giftable)
  4. Hide the Jetpack sharing service button from the Jetpack admin area if gifting is not available (all gates have metering)
  5. Prevent the member from selecting the mock URL input from the gifting modal if they've reached their limit
image image

How to test the changes in this Pull Request:

  1. As a member, generate 2 gift article links
  2. As an anonymous reader, access the first link, then the second
  3. Confirm that accessing the second link unlocks the article (the backend is not reading from the previous link cookie)
  4. Create another membership plan
  5. Edit our content gate and create a gate for the new membership plan
  6. Enable metering for that gate and save
  7. Back in the Content Gifting configuration, confirm you get a warning notice
  8. Edit your main gate and enable metering for it as well
  9. Back in the Content Gifting configuration, confirm you get an error notice
  10. Go to the Jetpack sharing module settings
  11. Confirm the "Gift an article" sharing service is not available
  12. Edit your main gate and disable metering
  13. Confirm the "Gift an article" sharing service is available again

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?

@miguelpeixe miguelpeixe self-assigned this Nov 19, 2025
@miguelpeixe miguelpeixe marked this pull request as ready for review November 19, 2025 19:01
@miguelpeixe miguelpeixe requested a review from a team as a code owner November 19, 2025 19:01
@miguelpeixe miguelpeixe added the [Status] Needs Review The issue or pull request needs to be reviewed label Nov 19, 2025
@rbcorrales rbcorrales requested a review from Copilot November 19, 2025 19:14
Copy link

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 implements UX tweaks and fixes for the content gifting feature, focusing on proper handling of URL query parameters, metering configuration warnings, and UI improvements when users reach their gifting limit.

  • Prioritize URL query arg over cookie for gift link authentication
  • Add warning/error notices in the wizard when gates have metering enabled
  • Hide Jetpack sharing service when gifting is unavailable due to metering
  • Disable URL input selection when member has reached gifting limit

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/wizards/audience/views/setup/content-gating.js Adds error and warning notices for metering configuration issues
src/content-gate/content-gifting.js Prevents URL input interaction when gifting limit is reached
includes/wizards/audience/class-audience-wizard.php Passes content gifting validation data to JavaScript
includes/content-gate/content-gifting/class-content-gifting.php Implements gifting availability checks, metering notices, query arg prioritization, and Jetpack integration control
includes/content-gate/class-content-gate.php Adds post status to gate data structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

copyButton.disabled = true;
} else {
urlInput.disabled = false;
delete urlInput.style.pointerEvents;
Copy link
Member

Choose a reason for hiding this comment

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

nit: urlInput.style.pointerEvents = '' or urlInput.style.removeProperty('pointer-events') would be more conventional for style props (though delete works in practice).

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Nov 19, 2025
@miguelpeixe miguelpeixe merged commit 952dd83 into trunk Nov 19, 2025
12 checks passed
@miguelpeixe miguelpeixe deleted the fix/content-gifting-tweaks branch November 19, 2025 20:06
@github-actions
Copy link

Hey @miguelpeixe, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Nov 19, 2025
# [6.25.0-alpha.7](v6.25.0-alpha.6...v6.25.0-alpha.7) (2025-11-19)

### Bug Fixes

* **content-gifting:** ux tweaks and other fixes ([#4318](#4318)) ([ae2de8f](ae2de8f))
matticbot pushed a commit that referenced this pull request Nov 24, 2025
# [6.25.0](v6.24.3...v6.25.0) (2025-11-24)

### Bug Fixes

* **content-gifting:** ux tweaks and other fixes ([#4318](#4318)) ([ae2de8f](ae2de8f))
* **contrib-meter:** ensure percentage follows bar progress when using linear style ([#4320](#4320)) ([3b9208b](3b9208b))
* display an error when a Collection title already exists ([#4268](#4268)) ([8055c83](8055c83))
* **newspack-ui:** remove margin-top for helper text when inside input-card ([#4285](#4285)) ([007d2c1](007d2c1))
* prevent spawning of Accessibility Statement pages ([#4237](#4237)) ([e1d12b4](e1d12b4))
* repeat button block styles in collections for WP 6.9 ([#4319](#4319)) ([e1386c9](e1386c9))
* **stripe-gateway:** disable Link by default on new installs ([#4288](#4288)) ([213a252](213a252))

### Features

* content gifting ([#4207](#4207)) ([f0c4d8f](f0c4d8f))
* content gifting ([#4207](#4207)) ([3880833](3880833))
* **content-gifting:** custom article link expiration ([#4313](#4313)) ([566ad6d](566ad6d))
* **contrib-meter:** add contribution meter block ([#4305](#4305)) ([5634314](5634314))
* **contrib-meter:** add contribution meter block ([#4305](#4305)) ([dc894bd](dc894bd))
* **contrib-meter:** create block patterns ([#4311](#4311)) ([e318c01](e318c01))
* **contrib-meter:** update cache invalidation logic and end date ([#4314](#4314)) ([d7b54aa](d7b54aa))
* **cover-fees:** support non-donation purchases ([#4298](#4298)) ([87e126f](87e126f))
* fix user login problem ([f834b3a](f834b3a))
* merge remote-tracking branch 'origin/trunk' into alpha ([748702f](748702f))
* **my-account:** update mobile navigation to use hamburger menu and display current page title ([#4303](#4303)) ([764a7d3](764a7d3))
* **my-account:** use newspack-ui in the sidebar ([#4302](#4302)) ([87cf937](87cf937))
* **newspack-icons:** add key ([#4278](#4278)) ([f275328](f275328))
* **newspack-ui-icons:** align icons with WordPress/Newspack set and use shared class ([#4281](#4281)) ([52a0eac](52a0eac))
* **ras:** implement OAuth redirect handling for RAS login ([#4290](#4290)) ([b84aae1](b84aae1))
* **ras:** implement OAuth redirect handling for RAS login ([#4290](#4290)) ([22586e1](22586e1))
* **rss:** allow RSS feed customization with new extra tags filters ([#4231](#4231)) ([34c235e](34c235e))
* **rss:** change rss media hook and use CDATA on media desc ([#4280](#4280)) ([8292c7a](8292c7a))
* **subscriptions:** change frequency intervals strategy ([#4301](#4301)) ([b652dba](b652dba))
* trigger alpha release ([617fa29](617fa29))
* **ui:** spinner tweaks ([#4300](#4300)) ([31f3e5e](31f3e5e))
* **variation-modal:** display variation description ([#4286](#4286)) ([0f5e017](0f5e017))
* **web-preview:** update components with new dropdown menu and title ([#4292](#4292)) ([6015eae](6015eae))
matticbot pushed a commit that referenced this pull request Nov 27, 2025
# [6.26.0-alpha.1](v6.25.1...v6.26.0-alpha.1) (2025-11-27)

### Bug Fixes

* **content-gifting:** ux tweaks and other fixes ([#4318](#4318)) ([952dd83](952dd83))
* **contrib-meter:** ensure percentage follows bar progress when using linear style ([#4320](#4320)) ([cbe8665](cbe8665))
* hide Content Gate CPT from WP Admin menu ([#4321](#4321)) ([70bbe7e](70bbe7e))
* make some Collections spacing more specific to archive pages ([#4293](#4293)) ([21daeaf](21daeaf))
* **media:** move default image UI to Advanced Settings ([#4296](#4296)) ([a22f06d](a22f06d))
* **modal-checkout:** prevent session reload after new customer account ([#4310](#4310)) ([89208fc](89208fc))
* **my-account:** add payment method query var ([#4325](#4325)) ([a7f2cb1](a7f2cb1))
* **my-account:** select font size ([#4324](#4324)) ([31a48c0](31a48c0))
* repeat button block styles in collections for WP 6.9 ([#4319](#4319)) ([6e3c5f8](6e3c5f8))
* **subscription-modal:** limited subscriptions ([#4309](#4309)) ([715f3c9](715f3c9))

### Features

* add autocomplete + token + multiselect component ([#4289](#4289)) ([84a8eda](84a8eda))
* **content-gifting:** custom article link expiration ([#4313](#4313)) ([c00f054](c00f054))
* listen to gforms events for newsletters ([#4312](#4312)) ([2f0e0e3](2f0e0e3))
* **my-account:** add "Product" column to the Subscriptions page ([#4323](#4323)) ([ba91e4c](ba91e4c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.26.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Dec 2, 2025
# [6.27.0-alpha.1](v6.26.0...v6.27.0-alpha.1) (2025-12-02)

### Bug Fixes

* **content-gifting:** ux tweaks and other fixes ([#4318](#4318)) ([952dd83](952dd83))
* **contrib-meter:** ensure percentage follows bar progress when using linear style ([#4320](#4320)) ([cbe8665](cbe8665))
* hide Content Gate CPT from WP Admin menu ([#4321](#4321)) ([70bbe7e](70bbe7e))
* make some Collections spacing more specific to archive pages ([#4293](#4293)) ([21daeaf](21daeaf))
* **media:** move default image UI to Advanced Settings ([#4296](#4296)) ([a22f06d](a22f06d))
* **modal-checkout:** prevent session reload after new customer account ([#4310](#4310)) ([89208fc](89208fc))
* **my-account:** add payment method query var ([#4325](#4325)) ([a7f2cb1](a7f2cb1))
* **my-account:** select font size ([#4324](#4324)) ([31a48c0](31a48c0))
* repeat button block styles in collections for WP 6.9 ([#4319](#4319)) ([6e3c5f8](6e3c5f8))
* **subscription-modal:** limited subscriptions ([#4309](#4309)) ([715f3c9](715f3c9))

### Features

* add autocomplete + token + multiselect component ([#4289](#4289)) ([84a8eda](84a8eda))
* **content-gifting:** custom article link expiration ([#4313](#4313)) ([c00f054](c00f054))
* listen to gforms events for newsletters ([#4312](#4312)) ([2f0e0e3](2f0e0e3))
* **my-account:** add "Product" column to the Subscriptions page ([#4323](#4323)) ([ba91e4c](ba91e4c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.27.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Dec 8, 2025
# [6.27.0](v6.26.4...v6.27.0) (2025-12-08)

### Bug Fixes

* **content-gifting:** ux tweaks and other fixes ([#4318](#4318)) ([952dd83](952dd83))
* **contrib-meter:** ensure percentage follows bar progress when using linear style ([#4320](#4320)) ([cbe8665](cbe8665))
* hide Content Gate CPT from WP Admin menu ([#4321](#4321)) ([70bbe7e](70bbe7e))
* make some Collections spacing more specific to archive pages ([#4293](#4293)) ([21daeaf](21daeaf))
* **media:** move default image UI to Advanced Settings ([#4296](#4296)) ([a22f06d](a22f06d))
* **modal-checkout:** prevent session reload after new customer account ([#4310](#4310)) ([89208fc](89208fc))
* **my-account:** add payment method query var ([#4325](#4325)) ([a7f2cb1](a7f2cb1))
* **my-account:** select font size ([#4324](#4324)) ([31a48c0](31a48c0))
* repeat button block styles in collections for WP 6.9 ([#4319](#4319)) ([6e3c5f8](6e3c5f8))
* **subscription-modal:** limited subscriptions ([#4309](#4309)) ([715f3c9](715f3c9))

### Features

* add autocomplete + token + multiselect component ([#4289](#4289)) ([84a8eda](84a8eda))
* **content-gifting:** custom article link expiration ([#4313](#4313)) ([c00f054](c00f054))
* listen to gforms events for newsletters ([#4312](#4312)) ([2f0e0e3](2f0e0e3))
* **my-account:** add "Product" column to the Subscriptions page ([#4323](#4323)) ([ba91e4c](ba91e4c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.27.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants