Skip to content

New. Settings. Getting apikey wizard.#822

Open
svfcode wants to merge 6 commits into
devfrom
wizard-init
Open

New. Settings. Getting apikey wizard.#822
svfcode wants to merge 6 commits into
devfrom
wizard-init

Conversation

@svfcode

@svfcode svfcode commented Jun 28, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 28, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread js/src/react/hooks/useSync.js
Comment thread js/src/react/components/SignupWizard/Screens/SignupInterface.js
Comment thread inc/cleantalk-settings.php
Comment thread inc/apbct-sync-react.php Outdated
Comment thread js/src/react/components/SignupWizard/Screens/SuccessInterface.js
Comment thread js/src/react/components/SignupWizard/Screens/ErrorInterface.js
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 28, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 38 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • js/src/react/components/SignupWizard/LogoSvgForWizard.js: Generated file

Comment thread js/src/react/hooks/useSync.js
Comment thread webpack.config.js Outdated
Comment thread inc/cleantalk-settings.php
Comment thread inc/cleantalk-admin.php
Comment thread js/src/react/components/SignupWizard/Screens/BeautifulDigits.js
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 188 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.52%. Comparing base (8f9a190) to head (0722b9c).
⚠️ Report is 5 commits behind head on dev.

Files with missing lines Patch % Lines
inc/cleantalk-settings.php 0.00% 93 Missing ⚠️
inc/apbct-sync-react.php 0.00% 66 Missing ⚠️
cleantalk.php 0.00% 10 Missing ⚠️
lib/Cleantalk/ApbctWP/Activator.php 0.00% 8 Missing ⚠️
inc/cleantalk-admin.php 0.00% 7 Missing ⚠️
lib/Cleantalk/ApbctWP/AdminNotices.php 0.00% 4 Missing ⚠️

❌ 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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 28, 2026 10:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 38 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • js/src/react/components/SignupWizard/LogoSvgForWizard.js: Generated file

Comment thread js/src/react/hooks/useSync.js
Comment thread inc/cleantalk-settings.php
Comment thread inc/cleantalk-admin.php
Comment thread package.json
Comment thread webpack.config.js Outdated
Comment thread js/src/react/components/SignupWizard/Screens/ConnectingInterface.js
Copilot AI review requested due to automatic review settings June 28, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 38 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • js/src/react/components/SignupWizard/LogoSvgForWizard.js: Generated file

Comment thread js/src/react/components/SignupWizard/Screens/ConnectingInterface.js
Comment thread inc/cleantalk-settings.php
Comment thread js/src/react/hooks/useSync.js
@alexandergull alexandergull removed their request for review July 4, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants