feat(popup-maker): add Popup Maker action integration - #207
Open
RishadAlam wants to merge 4 commits into
Open
Conversation
Popup Maker existed as a trigger only. Add the free side of its action integration: a controller exposing the popup and theme dropdowns, a RecordApiHelper routing ten write actions to their pro hooks, and the wizard, layout, field map and utilities components. Actions cover popups (create, update, delete, change status, show, reset counts, track event) and subscribers (create, update, delete). Read actions are deliberately absent — fetched data belongs in a dropdown, not a flow step. Each action's target identifier stays in the field map so it can be mapped from trigger data, while fixed option sets and fetchable config choices are selects.
Review cleanups on the free side of the integration. The popup and theme dropdowns primed the post meta and term caches for a list that renders ids and titles only, pulling every popup's serialized settings along the way. Switching actions also refetched lists already held in state, even though the refresh buttons cover that. PopupMakerActions received formFields and setSnackbar it never destructured, opened its modal through a state write whose only effect was an empty utilities object, and restated the action lists that staticData already exports.
The Show Popup action queued a popup in user meta and opened it on the user's next front-end page view, which needed a logged-in WordPress user and only ever fired client side. Remove it along with its field set and the explanatory note in the layout.
mainAction no longer falls back to create_popup, so a flow that lost its action reports "Invalid action" instead of publishing a popup. Also drop the comments that only restated the code they sat above.
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
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.
Description
Adds the Popup Maker action integration to the free plugin: the AJAX routes, the record helper that dispatches each action to the Pro plugin over a filter, and the full React step wizard. Nine actions are exposed — create, update, delete, change status and reset counts for popups, track an analytics event, and create, update and delete subscribers.
Motivation & Context
Popup Maker already existed as a trigger, so a flow could start from a subscription form but could not act back on Popup Maker. This adds the action side, letting a flow create or update popups, manage subscribers and record analytics events from any trigger.
Related Links: (if applicable)
Type of Change
Key Changes
Backend
PopupMakerControllerwith theexecute()entry point the Flow engine calls, plusrefreshPopups/refreshThemesendpoints that feed the dropdowns. Both queries skip the meta and term caches, since only ids and titles are rendered.RecordApiHelper, which resolves${field}tokens from trigger data and dispatches each action through abit_integrations_popup_maker_*filter, so the free plugin holds no Popup Maker logic of its own.Routes.phpregistering the two refresh endpoints.mainActionno longer falling back tocreate_popup. A flow that lost its action now reportsInvalid actioninstead of silently publishing a popup.Frontend
PopupMakerstep wizard — authorization byPOPMAKE_VERSIONconstant check, an action picker, per-action field maps, and a Utilities panel for popup status, size, animation, force delete and subscriber consent.NewInteg,EditInteg,IntegInfoandSelectAction.Checklist
Changelog
New Actions
Popup Maker: 9 new events added (Pro).
New Feature
Popup Maker (Action): Popups can be created, updated, deleted, have their status changed and their analytics counters reset from any trigger.
Popup Maker (Action): Subscribers can be created, updated and deleted, with optional popup attribution and consent.
Notes for reviewers
RecordApiHelperreturns the "Bit Integrations Pro is not installed or activated" response, and the UI disables each option throughcheckIsPro.tutorialLinks.jshas nopopupMakerentry yet, so the authorization step shows no doc or tutorial link. It needs a real URL before release.