Upd. Settings. Add BFP option.#694
Open
svfcode wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a user-facing enable/disable switch for the Brute Force Protection (BFP) module and wires it through the React settings UI and runtime checks, while keeping the legacy SPBC_BFP_DISABLE constant as an override for backward compatibility.
Changes:
- Introduces
bfp__enableddefault setting and renders it in the React General Settings “Authentication and Logging In” group. - Gates BFP execution in firewall and authentication flows based on
bfp__enabledandSPBC_BFP_DISABLE. - Updates the General Settings “traffic light” overview to reflect BFP status (but currently misses the constant override—see comments).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| security-malware-firewall.php | Updates documentation around the legacy SPBC_BFP_DISABLE constant and points to the new setting. |
| lib/CleantalkSP/SpbctWP/State.php | Adds default value for new bfp__enabled setting. |
| lib/CleantalkSP/SpbctWP/Settings/SettingsGeneralReact.php | Groups/orders bfp__enabled with other auth/logging settings for React UI. |
| js/src/react/components/TabContent/TabSettingsGeneral/SettingsGroup.js | Maps new setting key to a new React component. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/BfpEnabled.js | Adds new checkbox UI for enabling/disabling BFP and managing dependencies. |
| js/src/react/components/TabContent/TabSettingsGeneral/Settings/BfpAllowedWrongAuths.js | Removes heading/description now handled by the new enable setting. |
| inc/spbc-settings.php | Updates the “traffic light” feature status for BFP to use bfp__enabled. |
| inc/spbc-firewall.php | Loads the BFP firewall module only when enabled (and not disabled by constant). |
| inc/spbc-auth.php | Runs brute-force auth check only when enabled (and not disabled by constant). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
task https://app.doboard.com/1/task/46734