Skip to content

Settings. React. #14#668

Open
alexandergull wants to merge 6 commits into
devfrom
react-14.ag
Open

Settings. React. #14#668
alexandergull wants to merge 6 commits into
devfrom
react-14.ag

Conversation

@alexandergull

@alexandergull alexandergull commented Jun 10, 2026

Copy link
Copy Markdown
Member

@AntonV1211 AntonV1211 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.

Don't forget to look at the css and js that can be migrated to React, if they can be migrated.
Auto tests are also needed.
I also added a link to the task in the PR description.

@Glomberg Glomberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@alexandergull alexandergull changed the title react-14.ag Settings. React. #14 Jul 6, 2026
@alexandergull alexandergull requested a review from Copilot July 7, 2026 06:20

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 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 firewall and scanner_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 (valvalue), 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')}`&quot;`{uploadFileName}`&quot;`
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'}
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.

4 participants