Settings. React. #14#668
Open
alexandergull wants to merge 6 commits into
Open
Conversation
AntonV1211
reviewed
Jun 11, 2026
# Conflicts: # js/public/spbct-react-bundle.js
fd90b96 to
79b4a18
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the migration of the WordPress “Settings → General” UI from PHP-rendered fields to React-managed settings groups, expanding the React data payload to support Firewall and Malware Scanner settings (including visitor IP source selection and scanner exclusions stats).
Changes:
- Expand the React settings payload (IP, scan schedule text, timezone offset, whitelist company name, IP source labels, exclusions stats) and regroup/reorder settings into
firewallandscanner_settings. - Move Firewall + Malware Scanner settings rendering to React components and update quick navigation anchors accordingly.
- Remove legacy PHP helpers/locale strings that were only used by the old PHP field rendering.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/CleantalkSP/SpbctWP/Settings/SettingsGeneralReact.php | Adds new React data fields, introduces scanner_settings grouping, and implements ordering rules for multiple groups. |
| lib/CleantalkSP/SpbctWP/Scanner/OSCron/View/OSCronLocale.php | Removes locale properties no longer used by the PHP settings renderer. |
| lib/CleantalkSP/SpbctWP/HTTP/CDNHeadersChecker.php | Removes unused option-description helper (moved to React text). |
| lib/CleantalkSP/SpbctWP/FSWatcher/View/View.php | Removes unused description helpers (moved to React text). |
| js/src/react/components/TabContent/TabSettingsGeneral/TabSettingsGeneral.js | Passes additional backend-provided settings metadata into React settings rendering. |
| js/src/react/components/TabContent/TabSettingsGeneral/SettingsGroup.js | Wires new setting keys to new React setting components and supports scanner_settings group rendering. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/VisitorIPFromHeader.js | New React control for selecting IP source header + showing detected visitor IP. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/UploadCheckerModules.js | New checkbox UI for WordPress modules archive checks. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/UploadCheckerFiles.js | New checkbox UI for upload checker enablement + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/TrafficControlExcludeAuthorizedUsers.js | New checkbox UI for excluding logged-in users from traffic control. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/TrafficControlEnabled.js | New checkbox UI for traffic control enablement + dependency toggling of sub-fields. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/TrafficControlAutoblockTimeframe.js | New select UI for traffic control timeframe. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/TrafficControlAutoblockPeriod.js | New select UI for traffic control block period. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/TrafficControlAutoblockAmount.js | New text input UI for traffic control hit limit. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerSignatureAnalysis.js | New checkbox UI for signature analysis toggle. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerPathExclusionsView.js | New textarea UI for scanner path exclusions + exclusions stats rendering. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerOSCronAnalysis.js | New checkbox UI for OS cron analysis toggle. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerListUnknownOderThan.js | New select UI for “unknown files older than” (component naming typo present). |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerListUnknownFiles.js | New checkbox UI for “list unknown files” + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerListApprovedByCleantalk.js | New checkbox UI for “approved by cloud” display. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerImportantFilesListing.js | New checkbox UI for important files listing warning. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerHeuristicAnalysisAutoSend.js | New radio group UI for auto-sending suspicious files. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerHeuristicAnalysis.js | New checkbox UI for heuristic analysis + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerFSWSnapshotsPeriod.js | New select UI for filesystem watcher snapshots period. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerFSWatcherEnabled.js | New checkbox UI for filesystem watcher enablement + descriptive text. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerFrontendDomainExclusionsView.js | New textarea UI for allowed domains (frontend scan exclusions) + exclusions stats rendering. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerFrontendAnalysisCSRFEnabled.js | New checkbox UI for CSRF detection toggle in frontend scanner. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerFrontendAnalysis.js | New checkbox UI for frontend malware scan + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerDBTriggerAnalysis.js | New checkbox UI for DB trigger analysis toggle. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerCureMalware.js | New checkbox UI for auto-cure malware toggle. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerAutoStartPeriod.js | New select UI for scan schedule period + next scheduled scan text. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerAutoStartManualTZ.js | New hidden field UI for timezone offset storage. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerAutoStartManualTime.js | New time input UI for manual autostart time selection. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerAutoStartManual.js | New checkbox UI for enabling manual scan time + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/ScannerAutoStartEnabled.js | New checkbox UI for enabling autoscanning + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/OutboundLinksMirrors.js | New text input UI for outbound-links exclusions. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/OutboundLinksEnabled.js | New checkbox UI for outbound-links scanning + dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/CDNCheckerEnabled.js | New checkbox UI for enabling CDN headers self-check with description text. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings.js | Adds scanner_settings group rendering and passes through new props to group renderer. |
| js/src/react/components/TabContent/TabSettingsGeneral/QuickNavigation/QuickNavigation.js | Updates scanner section anchor/id to match new scanner_settings group id. |
| inc/spbc-tools.php | Removes legacy spbc_get_exclusions_stat() helper that built HTML descriptions (now done in React). |
| inc/spbc-settings.php | Removes PHP-rendered Firewall + Malware Scanner fields (now React-managed), adjusts IP source labels structure (val → value), and drops now-unused helper/description functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
191
to
+195
| 'login_page_rename__name', | ||
| 'login_page_rename__redirect', | ||
| 'login_page_rename__send_email_notification', | ||
| 'action_shuffle_salts', | ||
| ]; | ||
|
|
||
| ], |
| wlCompanyName={settings.strings?.wlCompanyName} | ||
| visitorIpSources={settings.objects?.visitorIpSources} | ||
| scannerExclusionsDir={settings.objects?.scannerExclusionsDir} | ||
| scannerExclusionsUrl={settings.objects?.scannerExclusionsUrl} |
| <p> | ||
| {__('Input relative directories (WordPress folder is ROOT). Something like this: wp-content/some-plugin-cache. Separate each directory path by a new line.', 'security-malware-firewall')} | ||
| <br/> | ||
| {__('If you want, you can add a file name to the list, where each line will be a path (directory or file) to exclude, file name must be ', 'security-malware-firewall')}`"`{uploadFileName}`"` |
Comment on lines
+23
to
+26
| handleSettingsDependencies( | ||
| 'auto_start__set_period,' + | ||
| 'scanner__auto_start_manual,', | ||
| )(e); |
| id={'spbc_setting_' + id} | ||
| name={name} | ||
| value={inputValue} | ||
| disabled={true} |
| ></i> | ||
| <div className="spbc_settings_description"> | ||
| <span> | ||
| {__('Will cure know malware.', 'security-malware-firewall')} |
| ></i> | ||
| <div className="spbc_settings_description"> | ||
| <span> | ||
| {__('This functional provides an overview of scheduled cron jobs on server that perform automated tasks.', 'security-malware-firewall')} |
| <span> | ||
| { | ||
| sprintf( | ||
| __('Enable this option to enable list of Approve by %s Cloud files', 'security-malware-firewall'), |
Comment on lines
+4
to
+20
| const {id, name, value, onSettingChange} = props; | ||
|
|
||
| return ( | ||
| <> | ||
| <input | ||
| type="time" | ||
| id={'spbc_setting_' + id} | ||
| name={name} | ||
| value={value} | ||
| required = "required" | ||
| disabled = "disabled" | ||
| className="spbc_setting_field spbc_sub_setting" | ||
| onChange={(e) => { | ||
| const next = e.target.checked ? 1 : 0; | ||
| onSettingChange?.(id, next); | ||
| }} | ||
| /> |
Comment on lines
+39
to
+42
| value={value} | ||
| options={options} | ||
| disabled={true} | ||
| className={'spbc_sub_setting'} |
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/50499