Mod. Settings. Moving settings to React - #692
Open
AntonV1211 wants to merge 17 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the migration of the plugin’s General Settings UI from PHP-rendered sections to the React settings screen, adding new React components for several settings groups (vulnerability checks, admin bar, misc, trusted/affiliate) and expanding the E2E test coverage accordingly.
Changes:
- Move additional General Settings sections (Vulnerability Check, Admin Bar, Misc, Trusted & Affiliate) into React components and React grouping/ordering.
- Expose additional settings-related values to React via PHP (links, WL info, descriptions/paths).
- Update Puppeteer/Jest E2E tests and related test utilities to support the new UI structure.
Reviewed changes
Copilot reviewed 42 out of 44 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/utils.js | Normalize JEST app root env var (trim trailing slashes). |
| spec/form.spec.js | Update Puppeteer launch args/options and executable path handling. |
| spec/tests/settings_tab.test.js | Add extensive settings UI assertions/toggles for the newly React-managed settings. |
| spec/tests/login.test.js | Make login typing more robust by clearing fields before input. |
| lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php | Remove PHP-generated vulnerability feature description (moved to React). |
| lib/CleantalkSP/SpbctWP/Views/Settings.php | Add additional page-data fields for React (links, WL flags, descriptions, paths). |
| lib/CleantalkSP/SpbctWP/Settings/SettingsGeneralReact.php | Group/order more settings into React sections (vulnerability/admin bar/misc/trusted+affiliate). |
| lib/CleantalkSP/SpbctWP/AdjustToEnvironmentModule/AdjustToEnvironmentSettings.php | Add psalm suppression for unused class. |
| js/src/react/components/TabContent/TabSettingsGeneral/styles.css | Add General tab-specific styles (sub-setting indentation + affiliate shortcode width). |
| js/src/react/components/TabContent/TabSettingsGeneral/SettingsGroup.js | Wire new groups and map additional setting keys to new React components. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/WPUseBuiltinHttpApi.js | New React setting component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/WPUploadDirPreventPhpExecution.js | New React setting component (uses description from context). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/WpDisableXmlrpc.js | New React setting component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/WpDisableRestApi.js | New React setting component (radio modes). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/WPDashboardWidgetShow.js | New React setting component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VulnerabilityCheckWarnOnModulesPages.js | New React setting component (sub-setting). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VulnerabilityCheckTestBeforeInstall.js | New React setting component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VulnerabilityCheckShowReports.js | New React setting component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VulnerabilityCheckEnableCron.js | New React setting component with dependency handling. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VulnerabilityCheckDesc.js | React replacement for the removed PHP vulnerability description. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/SPBCTrustedAndAffiliateShortcodeTag.js | New React UI for readonly shortcode tag (depends on parent). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/SPBCTrustedAndAffiliateShortcode.js | New React checkbox setting with dependency handling. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/SPBCTrustedAndAffiliateFooter.js | New React checkbox setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/SPBCTrustedAndAffiliateAddId.js | New React checkbox setting with link from context. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MonitoringUsers.js | New React hidden field for monitoring users flag. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscShowLinkInLoginForm.js | New React checkbox setting with interpolated WL/brand text. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscPreventLoginsCollectingOnPasswordReset.js | New React checkbox setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscPreventLoginsCollecting.js | New React checkbox setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscForbidToShowInIframes.js | New React checkbox setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscDisableFileEditor.js | New React radio setting with multisite/network-admin messaging. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscCompleteDeactivation.js | New React checkbox setting with backup directory text. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/MiscBackendLogsEnable.js | New React setting for backend logs (with links/upsell description). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/DataSetCookies.js | New React radio setting for cookie mechanism. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/DataAdditionalHeaders.js | New React checkbox setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/AdminBarShow.js | New React parent setting with dependency toggling. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/AdminBarFirewallCounter.js | New React sub-setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/AdminBarBruteForceCounter.js | New React sub-setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/AdminBarAdminsOnlineCounter.js | New React sub-setting. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings.js | Add new section definitions and WL gating for Trusted & Affiliate. |
| js/src/react/components/TabContent/styles.css | Remove temporary “bottom gluing” styles now that more groups are React-managed. |
| inc/spbc-settings.php | Remove PHP-rendered sections/fields for the migrated settings and simplify header rendering. |
| css/src/spbc-settings.css | Remove General-tab-specific sub-setting/affiliate styles from global stylesheet source. |
| css/spbc-settings.min.css | Update minified CSS accordingly (removing those global styles). |
Files not reviewed (1)
- css/spbc-settings.min.css: Generated file
Suppressed comments (4)
spec/tests/settings_tab.test.js:407
- React settings render help icons with
data-setting, notsetting. This selector will never match and the test will fail.
spec/tests/settings_tab.test.js:466 - React settings render help icons with
data-setting, notsetting. This selector will never match and the test will fail.
spec/tests/settings_tab.test.js:488 - React settings render help icons with
data-setting, notsetting. This selector will never match and the test will fail.
spec/tests/settings_tab.test.js:602 - React settings render help icons with
data-setting, notsetting. This selector will never match and the test will fail.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
https://app.doboard.com/1/task/52218