New. Settings. Getting apikey wizard.#822
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new React-based “signup wizard” flow on the plugin Settings page to help users obtain and save an access key, with an activation redirect into the wizard when the site has no valid key yet.
Changes:
- Add React signup wizard UI (multiple screens) and a Webpack build entry for bundling it into
js/public/apbct-react-bundle.js. - Update settings/activation flows to redirect/show the wizard when no valid access key exists, and adjust classic settings template/linking accordingly.
- Add new AJAX endpoints for wizard key saving and a React-driven post-key sync sequence.
Reviewed changes
Copilot reviewed 24 out of 38 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.js | Adds Webpack config to bundle the React wizard into a single admin JS bundle. |
| templates/settings/settings_key_wrapper.html | Replaces “get key” button with a link that opens the signup wizard URL; removes license agreement UI in classic template. |
| package.json | Adds Webpack/React/Babel/CSS/image loader dependencies and a build script. |
| lib/Cleantalk/ApbctWP/AdminNotices.php | Suppresses certain key-related admin notices when the wizard is active (signup_wizard=1). |
| lib/Cleantalk/ApbctWP/Activator.php | Stores a concrete redirect URL on activation and appends signup_wizard=1 when key is missing. |
| js/src/react/styles.css | Adds base styles for the React mount/wizard shell. |
| js/src/react/modules/Http/wizardApi.js | Adds wizard-specific AJAX wrappers for getting/saving access keys. |
| js/src/react/modules/Http/Ajax.js | Adds fetch-based AJAX helper using ctAdminCommon nonce/url. |
| js/src/react/index.js | Mounts React wizard conditionally based on URL param and server-provided data attributes. |
| js/src/react/hooks/useSync.js | Implements a multi-step sync sequence after connecting (access key check, SFW update, etc.). |
| js/src/react/components/SignupWizard/styles.css | Adds wizard UI styles for all screens. |
| js/src/react/components/SignupWizard/SignupWizard.js | Adds wizard screen state machine (signup/existing user/connecting/success/error). |
| js/src/react/components/SignupWizard/Screens/SuccessInterface.js | Adds success screen and links back to settings. |
| js/src/react/components/SignupWizard/Screens/SignupInterface.js | Adds signup screen and “connect to account” flow via apbct_get_key_auto. |
| js/src/react/components/SignupWizard/Screens/ErrorInterface.js | Adds error screen with support link and retry/back actions. |
| js/src/react/components/SignupWizard/Screens/ConnectingInterface.js | Adds connecting/progress UI and triggers sync steps. |
| js/src/react/components/SignupWizard/Screens/BeautifulDigits.js | Adds marketing/statistics copy for the signup screen. |
| js/src/react/components/SignupWizard/Screens/AccessKeyInterface.js | Adds “existing user” screen to paste an access key and save it. |
| js/src/react/components/SignupWizard/LogoSvgForWizard.js | Adds wizard logo SVG component. |
| js/src/cleantalk-admin-settings-page.js | Removes legacy “get key automatically” click handler and adjusts API key input behavior. |
| js/cleantalk-admin-settings-page.min.js.map | Updates sourcemap for the modified settings-page script. |
| js/cleantalk-admin-settings-page.min.js | Updates minified settings-page script for removed legacy flow and new conditions. |
| inc/cleantalk-settings.php | Adds wizard helpers (detect/URLs/data attrs), renders React mount, adjusts API key field template replacements, adds apbct_save_key, and adapts apbct_get_key_auto for wizard usage. |
| inc/cleantalk-admin.php | Enqueues the React bundle + wp-i18n on the settings page; registers wp_ajax_apbct_save_key. |
| inc/apbct-sync-react.php | Adds React-driven AJAX sync endpoints used by the wizard “connecting” step. |
| i18n/cleantalk-spam-protect.pot | Adds new wizard-related strings for translation. |
| cleantalk.php | Requires the new react sync AJAX file and updates activation redirect logic to respect stored redirect URL/wizard URL. |
Files not reviewed (1)
- js/src/react/components/SignupWizard/LogoSvgForWizard.js: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #822 +/- ##
============================================
- Coverage 26.63% 26.52% -0.12%
- Complexity 5678 5688 +10
============================================
Files 270 271 +1
Lines 24246 24402 +156
============================================
+ Hits 6459 6473 +14
- Misses 17787 17929 +142 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
task https://app.doboard.com/1/task/51207