feat(tags): hide private tags in RSS feeds, settings, and reader data#189
Open
wil-gerken wants to merge 6 commits into
Open
feat(tags): hide private tags in RSS feeds, settings, and reader data#189wil-gerken wants to merge 6 commits into
wil-gerken wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7/4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up to the original Private Tags feature that closes the remaining surfaces where private tag names/IDs could leak (RSS <category> lists, partner-RSS editor labels, reader-activity client data), introduces a new feed_terms setting and a shared label-appender helper, and adds comprehensive PHPUnit coverage for the whole feature.
Changes:
- Add
filter_feed_terms(hooked onget_the_terms, gated by taxonomy +is_feed()+ newfeed_termssetting) andfilter_reader_activity(always-on under the feature flag) inPrivate_Tags; extract a sharedmaybe_append_private_labelhelper used by REST and the Partner RSS editor. - Wire the new helper into the RSS module's selected-tag chips and AJAX term search, and add the
feed_termskey to default settings, the TSAdvancedSettingstype, and the Private Tags toggles UI (with refreshed copy). - Add a
Private_Tags_Test_Helpertrait and four new test classes covering core behavior, RSS<category>stripping, reader-activity stripping, and Partner-RSS labeling.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
plugins/newspack-plugin/includes/tags/class-private-tags.php |
Adds maybe_append_private_label, filter_feed_terms, filter_reader_activity, the feed_terms default, and registers the new hooks. |
plugins/newspack-plugin/includes/optional-modules/class-rss.php |
Uses the shared helper to label selected tag chips and AJAX search results for post_tag; notes that feed-term filtering happens globally. |
plugins/newspack-plugin/src/wizards/newspack/views/settings/advanced-settings/private-tags.tsx |
Adds the "Remove private tags from RSS feeds" toggle and updates label copy. |
plugins/newspack-plugin/src/wizards/newspack/views/settings/theme-mods.d.ts |
Adds feed_terms: boolean to AdvancedSettings. |
plugins/newspack-plugin/tests/unit-tests/tags/traits/trait-private-tags-test-helper.php |
New shared trait for enabling the flag, resetting static state, and creating private/public tags. |
plugins/newspack-plugin/tests/unit-tests/tags/test-private-tags.php |
Core Private_Tags behavior matrix (flag, settings, label, cache, archives, classes, GAM, Yoast, REST, admin column, term_name). |
plugins/newspack-plugin/tests/unit-tests/tags/test-private-tags-rss.php |
Coverage for filter_feed_terms including guards, behavior gating, and an end-to-end the_category_rss integration check. |
plugins/newspack-plugin/tests/unit-tests/reader-activity/test-reader-data-private-tags.php |
Coverage for filter_reader_activity including always-on behavior and hook registration. |
plugins/newspack-plugin/tests/unit-tests/optional-modules/test-rss-private-tags.php |
Coverage for Partner-RSS AJAX search labeling and selected-chip rendering. |
Keeps each test file under Copilot's per-file review size limit. Co-Authored-By: Claude Opus 4.7/4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7/4.8 (1M context) <noreply@anthropic.com>
…note Co-Authored-By: Claude Opus 4.7/4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7/4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the original Private Tags feature (#4507), continuing NPPD-780. Private Tags let editors mark a tag as "private" so it's hidden from readers while still working normally behind the scenes. This PR closes the last few spots where private tags could still slip through, and adds the test coverage the feature originally shipped without.
What this does
Everything stays behind the existing
NEWSPACK_PRIVATE_TAGS_ENABLEDflag.How to test
define( 'NEWSPACK_PRIVATE_TAGS_ENABLED', true );/feed/or a partner feed) — the private tag isn't listed. Toggle "Remove private tags from RSS feeds" off → it reappears.n test-php --group private-tags→ green (79 tests).A couple of notes for reviewers
get_the_terms(which runs broadly), but exits immediately on anything that isn't a feed request for a post tag, so it stays off the normal page-load path.Tickets: NPPD-780 (parent), NPPD-1461–1465.
🤖 Generated with Claude Code