feat(audience): subscription products (Plans) wizard#464
Open
miguelpeixe wants to merge 12 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Audience → Plans wizard screen (gated by NEWSPACK_PLANS_UI and WooCommerce Subscriptions availability) that provides a DataViews-based UI for listing, creating, and editing WooCommerce subscription products (including variable and grouped “plan bundle” products, plus one-time donation products).
Changes:
- Registers a new Audience wizard route/component (
newspack-audience-subscription-products) and conditionally boots it viaNEWSPACK_PLANS_UI. - Implements the Plans UI in React (DataViews list + routed create/edit form) with minimal scoped styling.
- Adds a new PHP wizard + REST API layer to fetch the consolidated product model and create/update products.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/newspack-plugin/src/wizards/index.tsx | Registers the new wizard entrypoint for Plans. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/index.tsx | Adds the Plans wizard container and routes (list/new/edit). |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/list.tsx | Implements the DataViews list, scopes, filters, and row actions. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/product-edit.tsx | Adds the routed wrapper that loads context and renders the form. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/product-form.tsx | Implements the full-page create/edit form and save behavior. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/types.d.ts | Adds ambient TS types for the Plans page response/model. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/style.scss | Adds minimal scoped styles for chips/forms/badges layout. |
| plugins/newspack-plugin/src/wizards/audience/views/subscription-products/README.md | Documents the new Plans UI/data model (needs alignment with current PR). |
| plugins/newspack-plugin/includes/wizards/audience/class-audience-subscription-products.php | Adds the wizard + REST endpoints and product prep/create/update logic. |
| plugins/newspack-plugin/includes/class-wizards.php | Conditionally registers the new wizard behind feature flag + WCS availability. |
| plugins/newspack-plugin/includes/class-newspack.php | Includes the new wizard PHP class file. |
Member
Author
|
Addressed Copilot's review in
|
…t/audience-plans-ui
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:
Adds a new "Plans" management page under Audience — a DataViews UI for managing WooCommerce Subscriptions products: name, price + billing period, active-subscriber counts, category, status, variations, group/multi-seat subscriptions, and content unlocks. List, create, and edit subscription products without leaving the wizard.
The page is gated behind the
NEWSPACK_PLANS_UIfeature flag and only registers when WooCommerce Subscriptions is active. It shows the plain product price — the dynamic-pricing "effective price" overlay is intentionally a separate PR (the integration), so this PR has zero dependency on the dynamic-pricing engine.First of a three-way split of
feat/rsm-pricing-rules-dataviews: (1) Plans (this PR), (2) Pricing Rules wizard, (3) the engine-pricing integration onto Plans. PRs 1 and 2 are independent; PR 3 stacks on this one.How to test the changes in this Pull Request:
define( 'NEWSPACK_PLANS_UI', true );towp-config.phpon a site with WooCommerce Subscriptions active.Other information: