Active Defense: Priority-0 Early-Boot WAF, 429 Bot Rate Limiter & Admin Capability Guard
Block SQLi, XSS, LFI, and bad bots at priority 0 with the Pro Early-Boot Web Application Firewall, throttle scraper floods with the 429 Sliding-Window Rate Limiter, and lock an Approved Administrator Whitelist.
📋 On This Page (Jump to Section)
While the free plugin provides forensic visibility, hardening, and direct-database remediation, FBS Secure Optimize Pro adds real-time, automated active defense that intercepts exploit payloads and privilege-escalation attempts before they reach vulnerable plugin code.
1. Priority-0 Early-Boot Web Application Firewall (WAF) #
The Pro WAF (class-fbs-secure-optimize-pro-waf.php) hooks into plugins_loaded at priority 0—inspecting incoming URI paths, query strings, POST bodies, cookies, and User-Agent headers before standard plugins execute:
- SQL Injection (SQLi) Defense: Blocks unauthorized SQL union queries, boolean/time-based blind injection probes, and database schema extraction payloads.
- Cross-Site Scripting (XSS) Defense: Intercepts injected script payloads, dangerous URI schemes, and inline DOM event handlers.
- Local File Inclusion (LFI) & Directory Traversal: Stops relative directory traversal sequences, configuration file probes, and unauthorized PHP stream wrappers.
- Null-Byte & Malicious Scanner User-Agent Blocking: Drops null-byte truncation exploits and aggressive automated vulnerability scanner user-agents.
- Custom IP & User-Agent Blacklists: Block specific attacking IP addresses or custom bot signatures directly from the WAF panel.
- Safe Learning Mode vs. Active Blocking Mode: Test the WAF in Learning Mode (logs matching requests without blocking visitors) before switching to Active Blocking (HTTP 403).
- 100-Entry Live Security Log: Inspect the latest 100 blocked or logged attack events with Timestamp, Attacking IP, Rule Triggered, Request URI, and User-Agent.
Developer Filter: Customizing Pro WAF Rules #
add_filter( 'fbs_secure_optimize_pro_waf_rules', function( $rules ) {
// Customize or append custom regex WAF signatures
return $rules;
} );
2. 429 Anti-Bot Flood Rate Limiter #
Aggressive AI scrapers, credential-stuffing bots, and vulnerability scanners often fire 100+ uncached requests per second—saturating PHP-FPM workers and causing 502 Bad Gateway or 504 Gateway Timeout crashes on WooCommerce stores.
- Sliding-Window Per-IP Request Throttling: Tracks request velocity per visitor IP across a configurable time window (e.g., max requests per 60 seconds).
- Clean HTTP 429 Response: When a bot exceeds your threshold, Pro immediately halts execution and returns a lightweight
HTTP 429 Too Many Requestsresponse with a standardRetry-Afterheader before expensive database queries run. - Admin & Trusted IP Bypass: Automatically exempts logged-in administrators and IPs listed in your Trusted IP Allowlist.
3. Real-Time Admin Capability Whitelist Guard #
Zero-day vulnerabilities in third-party plugins often bypass standard user creation hooks by writing administrator capability rows directly into wp_usermeta. The Real-Time Admin Capability Whitelist Guard stops privilege escalation cold:
- When enabled in FBS Optimize → Pro Active Defense, Pro snapshots and locks your Approved Administrator User ID Whitelist (
fbsseop_pro_approved_admins). - You can explicitly approve or remove legitimate team administrator accounts inside the whitelist panel at any time.
- Automatic Real-Time Disarming: On every request, if any user ID not on your Approved Whitelist gains
administratorcapabilities inwp_usermeta, Pro immediately strips their administrator role back tosubscriber, destroys all of their active session tokens (destroy_all()), and logs aCRITICALprivilege-escalation alert in your Pro Security Log!