feat(reader-activation): replace RAS auto-enable with manual toggle#4754
Closed
miguelpeixe wants to merge 29 commits into
Closed
feat(reader-activation): replace RAS auto-enable with manual toggle#4754miguelpeixe wants to merge 29 commits into
miguelpeixe wants to merge 29 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes the Audience → Setup flow for Reader Activation (RAS) so enablement is no longer automatically inferred from prerequisites; instead, admins explicitly enable/disable Audience Management via a manual toggle, while prerequisites become informational and “skip” functionality is removed.
Changes:
- Adds an explicit “Enable Audience Management” toggle in the Setup UI and removes skip/auto-enable wiring.
- Simplifies prerequisites checklist behavior (no skip states; always renders checklist items) and adjusts campaign publish flow copy/actions.
- Removes skip REST endpoint and related PHP helpers/options; makes menu behavior less dependent on WooCommerce.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit-tests/reader-activation.php | Adds unit coverage ensuring skip-related keys/methods are removed. |
| src/wizards/audience/views/setup/setup.js | Introduces manual enable toggle and updates prerequisite rendering / newsletter gating. |
| src/wizards/audience/views/setup/index.js | Removes skip action plumbing from the wizard container. |
| src/wizards/audience/views/setup/complete.js | Updates campaign completion step UI and removes skip-activation behavior. |
| src/wizards/audience/views/setup/campaign.js | Removes “Skip” button/navigation dependencies from campaign step. |
| src/wizards/audience/types/index.d.ts | Updates TS types to drop skip-related prerequisite props/fields. |
| src/wizards/audience/components/prerequisite.tsx | Removes skip UI and simplifies prerequisite validity/status handling. |
| includes/wizards/audience/class-audience-wizard.php | Removes skip endpoint/localized data; adjusts activation endpoint behavior. |
| includes/wizards/audience/class-audience-donations.php | Hides Donations submenu when neither WooCommerce nor NRH platform is available. |
| includes/reader-activation/class-reader-activation.php | Removes skip/auto-enable helpers and cleans prerequisite status payload; loosens nav menu WC dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
Member
Author
|
Migrated to the newspack-workspace monorepo: Automattic/newspack-workspace#196 (identical diff, now under |
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.
All Submissions:
Changes proposed in this Pull Request:
Closes NPPD-1066.
Reworks Audience Management (RAS) setup so it can be enabled with far fewer prerequisites, and reorganizes the wizard around an explicit reader‑revenue platform selection. RAS no longer auto‑enables based on a fully‑configured plugin stack; an administrator picks a platform and Audience Management is enabled as part of that choice, regardless of which optional plugins are installed.
Platform selection (first‑run step)
Enable / disable
Tabs
Configuration page cleanup
Plugin independence
Reader_Activation::skip()/is_skipped()/is_ras_ready_to_configure(), the/audience-management/skipREST route, theSKIP_CAMPAIGN_SETUP_OPTIONconstant, and theis_skipped_campaign_setuplocalized field.Reader_Activation::is_reader_revenue_ready()helper (only consumed by the removed Reader Revenue prerequisite) and other dead code (an unuseddonation_settingsread inDonations::remove_donations_from_cart(), the never‑setis_unavailableprerequisite branch) are removed.Reader_Activation::setup_nav_menu()no longer requires WooCommerce for the anonymous Sign In link.Fixes
wc) platform before WooCommerce is installed no longer fatals: the WooCommerce donation‑product write is skipped when WooCommerce isn't active (Donations::get_donation_settings()returns aWP_Error).wp newspack ras setupCLI command now explicitly enables Audience Management (it previously relied on the removed auto‑enable path, so it published prompts but left RAS disabled).Audience_Donations::fetch_all_data()no longer serializes aWP_Errorintodonation_datawhen the WooCommerce suite is incomplete (returns an empty array instead; missing plugins are still surfaced viaplugin_status), andapi_update_payment_settingsguards against a missingplatformparam.Migration
enabled = true. The legacynewspack_reader_activation_*_skippedoptions are left in the database, intentionally unread.How to test the changes in this Pull Request:
Other information: