Repository navigation
fix: address WordPress.org plugin review feedback - #359
Open
leogermani wants to merge 7 commits into
Open
leogermani wants to merge 7 commits into
leogermani wants to merge 7 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unconditional legacy-option deletion can lose templates when migration writes fail, and cached HTML can keep reader tracking active without current opt-in.
2 open issues
What changed in this PR
This PR prepares Rolling Coverage for WordPress.org resubmission by addressing reader analytics consent, external-service disclosures, and plugin-directory requirements.
Changes:
- Adds an off-by-default Reader Analytics setting with REST support and documentation.
- Moves Slack Monitor logs into the database and migrates stored template options to a prefixed name.
- Updates script enqueueing, translation handling, permission checks, and regression tests.
| File | Description |
|---|---|
tests/test-social-sharing.php |
Tests the enqueued redirect script. |
tests/test-slack-monitor.php |
Covers database logging and legacy-file cleanup. |
tests/test-reader-analytics.php |
Tests analytics opt-in and permissions. |
tests/test-layout.php |
Tests legacy template-option migration. |
tests/test-layout-templates.php |
Checks translation coverage for layout strings. |
tests/test-entry-restore.php |
Extends recovery permission tests to authors. |
src/blocks/rolling-coverage/DEVELOPMENT.md |
Documents the template option prefix. |
src/admin/utils/slack-api.ts |
Updates comments describing monitor offsets. |
src/admin/utils/reader-analytics-api.ts |
Adds analytics settings API helpers. |
src/admin/types/index.ts |
Adds analytics settings types and endpoint configuration. |
src/admin/DEVELOPMENT.md |
Documents the fifth General settings section. |
src/admin/components/general-settings.tsx |
Adds the Reader Analytics toggle and save flow. |
site/content/docs/guides/settings.mdx |
Explains reader analytics for publishers. |
site/content/docs/developers/rest-api.mdx |
Lists the analytics settings endpoint. |
site/content/docs/developers/data.mdx |
Updates analytics, template, and monitor storage references. |
readme.txt |
Discloses external services and updates the contributor. |
newspack-rolling-coverage.php |
Removes explicit text-domain loading. |
includes/slack/class-slack-monitor.php |
Replaces file logging with bounded database storage. |
includes/patterns/every-live-story.php |
Prefixes the pattern loop variable. |
includes/class-summary.php |
Adds lint exceptions for existing core hooks. |
includes/class-social-sharing.php |
Enqueues the inline share redirect script. |
includes/class-reader-analytics.php |
Implements the analytics option and REST handlers. |
includes/class-post-type.php |
Uses the taxonomy capability for recovery creation. |
includes/class-initializer.php |
Initializes reader analytics support. |
includes/class-admin.php |
Exposes the analytics endpoint to the admin interface. |
includes/blocks/class-rolling-coverage-block.php |
Gates analytics and migrates template option keys. |
includes/blocks/class-layout-templates.php |
Makes layout strings discoverable by translation tools. |
includes/blocks/class-entry-bindings.php |
Uses a numeric default excerpt length. |
includes/blocks/class-breakout-card.php |
Uses a numeric default teaser length. |
.github/CONTRIBUTING.md |
Updates feature, endpoint, and storage references. |
Review effort: Balanced
| // never for the site's own staff. | ||
| $can_edit_posts = current_user_can( 'edit_posts' ); | ||
| $should_track_reader_events = ! $can_edit_posts; | ||
| $should_track_reader_events = ! $can_edit_posts && Reader_Analytics::is_enabled(); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leogermani
marked this pull request as ready for review
December 1, 2026 17:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.

The WordPress.org plugin review sent back a list of issues that block Rolling Coverage from the plugin directory. This PR addresses each one so the plugin can be resubmitted.
What changes
The biggest change for publishers: reader analytics events are now off until a site opts in. The directory doesn't allow tracking without opt-in consent, so sites that used Site Kit's GA4 tag to measure which entries readers see will stop reporting those events after the update until an editor turns the new setting on.
With this change:
How to test
window.newspackRollingCoverageFrontend.readerAnalyticsEnabledis"".readerAnalyticsEnabledis"1", and scrolling entries into view pushescoverage_entry_seentodataLayer.readerAnalyticsEnabledis"".wp-content/uploads/newspack-rolling-coverage/. No.phplog file is created.npm run release:archive, setStable tagto the version, and run Plugin Check. It reports no errors or warnings.Technical details
Review items and fixes
Social_Sharing::enqueue_redirect_script()runs onwp_enqueue_scriptsand registers a src-less handle withwp_add_inline_script(), printed in the head.TEMPLATE_OPTION_PREFIXis nownewspack_rolling_coverage_tpl_.load_block_config()falls back to therc_tpl_key and moves it, because pages in the page cache keep polling with their old key. Pruning and coverage deletion clear both prefixes.Reader_Analyticsclass, optionnewspack_rolling_coverage_reader_analytics(absent means off), route/settings/reader-analyticswith the same capability as the other General settings.localize_frontend_config()setsreaderAnalyticsEnabledonly when the option is on, and that flag gates both thedataLayerpush and the GA4 call. The flag is renamed fromreaderTrackingEnabled, so pages cached before the update, which still carry the old flag, send nothing. Turning the setting off reaches cached pages when the page cache refreshes, like every other setting.== External services ==section in readme.txt.Slack_Monitorstores up to 500 entries, each with a sequence number, in the non-autoloaded optionnewspack_rolling_coverage_slack_monitor_log. The poll'soffsetis now the last sequence number seen rather than a byte offset; the client already treats it as opaque. Two webhooks logging at the same moment can overwrite each other's entry. That's accepted for a live troubleshooting view and noted in the class doc. The keep-alive works as before. The first poll after the update deletes the legacy random-named.phpfile and itsrolling_coverage_slack_monitor_filenameoption.manage_categories. The check now reads the taxonomy'sedit_termscap, and a test covers an author restoring their own published entry (403, no term created).Layout_Templates::strings()lists each layout word as a literal__()call.test_every_layout_word_is_translatablefails when a layout uses a word missing from it._x( '55', 'excerpt_length' )is now55.leogermani, the plugin's directory owner. The review flaggedautomatticas unrelated to this plugin.Two Plugin Check warnings from code added after 0.3.0 are fixed as well: an unprefixed loop variable in the Every live story pattern, and core hook names in
Summary::update_term_count().Verification: PHPUnit 1636 passed, Jest 246 passed, and PHPCS, ESLint and typecheck are clean. Each new test was confirmed red with its fix reverted. Plugin Check 2.2.0 on the built zip reports only
trunk_stable_tag, which goes away when the release zip's Stable tag is set by hand.Not included: the docs site screenshot
guides/settings-1.webppredates the Reader Analytics section. The new section sits below the fold, so the image may not need a retake.Self-review: not run.
🤖 Generated with Claude Code