﻿# Changelog - Advanced IP Blocker

== Changelog ==

= 8.14.0 =
* **NEW FEATURE (AIB Cloud Portal & 1-Click Connect):** Introduced `ADVAIPBL_Cloud_Client` (`includes/class-advaipbl-cloud-client.php`) supporting verified per-site SHA-256 API tokens (`aib_live_*`) managed through the official AIB Cloud Portal (`https://app.advaipbl.com`). Link up to 5 WordPress websites for free via a secure 1-Click HTTPS Connect flow (with per-user cryptographic state validation) or manual token entry, unlocking higher daily quotas for Deep CVE Scanning (10/day), Server IP Reputation (30/day), Community Blocklist syncs (10/hour), and Attack Reports (120/hour).
* **RESILIENCE & PERFORMANCE (Entitlement Caching & Unified Auth Headers):** Added local 6-hour transient caching for cloud plan entitlements with a 72-hour fail-open fallback so local firewall modules and synced rules continue operating uninterrupted even during central maintenance. Unified all central API requests (Community Blocklist, Attack Reports, Site Scanner, and Token Verification) through `ADVAIPBL_Main::get_api_auth_headers()` with normalized `X-AIB-Site-Hash` and version headers.
* **UI & UX (AIB Account Connection & Setup Wizard):** Upgraded **Settings -> General Settings -> AIB Threat Network** to display live AIB Cloud Portal tier badges, active daily scanner quotas, **Verify Connection** plan feedback, and direct **Manage in AIB Cloud Portal** / **Quotas & Guide** links. Added an optional, zero-friction **AIB Cloud Portal (Free Account)** card to Step 5 of the Onboarding Setup Wizard.
* **COMPATIBILITY (100% Legacy V3 Backwards Compatibility & WordPress 7.2):** Existing installations using anonymous Legacy V3 keys (`AIB_*`) continue operating seamlessly without interruption, with an optional 1-click **Link Free AIB Cloud Account** upgrade button. Tested and verified compatible with **WordPress 7.2**.
* **DOCUMENTATION & I18N:** Added contextual links to the new [AIB Cloud Portal & Quotas Guide](https://advaipbl.com/aib-cloud-portal-api-keys-quotas/) and updated `languages/advanced-ip-blocker.pot` with all new strings.

= 8.13.29 =
* **NEW FEATURE (Critical Admin & Privilege Escalation Alerts):** Added immediate security notifications (Email, Push Webhooks, or Both, with an optional dedicated agency security email) under **Settings -> Internal Security & Forensics**. Triggers instantly when a new Administrator is created, a user is promoted to Administrator, public registration (`users_can_register`) is enabled, `default_role` is set to Administrator, or an Administrator logs in from a new country.
* **NEW FEATURE & SECURITY (Native Telegram Bot API & Webhook Hardening):** Added built-in support for official Telegram Bot API URLs (`api.telegram.org/bot.../sendMessage?chat_id=...`, including optional `message_thread_id` for forum topics) in Push Notifications with native HTML formatting (`parse_mode: HTML`) alongside Slack, Discord, and Microsoft Teams. Hardened outbound webhook delivery against SSRF by enforcing strict `https://` URLs, switching to `wp_safe_remote_post()` with `redirection => 0`, `sslverify => true`, and `timeout => 5`, and masking secret webhook tokens before logging errors.
* **NEW FEATURE (Advanced Rules Dry-Run / Simulation Mode):** Added a `Log Only (Simulate / Dry-Run)` action to the Advanced Rules Engine so administrators can test complex rules in productionâ€”recording matches in Security Logs and rule hit countersâ€”without blocking or challenging legitimate traffic.
* **NEW FEATURE (Firewall & Proxy Diagnostics + Support Report):** Expanded Local Site Scan with three instant diagnostic checks (Proxy & Whitelist health, active security/WAF plugin conflict detection, and internal DB/FIM/OPcache verification) plus a one-click **Copy Anonymized Support Report** button that excludes domains, IPs, emails, and tokens.
* **PERFORMANCE & API OPTIMIZATION (WP-Cron Frequencies):** Rescheduled queued Community Threat Reports (`advaipbl_community_report_event_v2`) from 6 hours to **hourly** (with randomized jitter) for faster global threat intelligence updates, while reducing passive version-check polling for Zero-Day WAF rules to **every 2 hours** (`advaipbl_2_hours`) and FIM signatures to **every 6 hours** (`advaipbl_6_hours`).
* **COMPATIBILITY & RESILIENCE (Legacy Database & Cooldown):** Changed `advaipbl_activity_log.timestamp` to `TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP` for full compatibility with older MySQL 5.5 / MariaDB servers, and added a 15-minute transient cooldown (`advaipbl_db_check_cooldown`) to `check_database_update()` to prevent repeated `dbDelta()` retries on every admin request.
* **ENHANCEMENT (Documentation & Cleanup):** Added direct contextual help links to the new Push Notifications and FIM documentation guides on `advaipbl.com`, and extended `uninstall.php` to clean up all `advaipbl_%` user meta keys on plugin removal.

= 8.13.28 =
* **RESILIENCE & COMPATIBILITY (FIM Graceful Degradation):** Moved `includes/class-advaipbl-fim-engine.php` from mandatory core initialization to conditional loading. If a server-side antivirus or malware scanner (such as Imunify360, cPGuard, BitNinja, or ClamAV) quarantines that file as a false positive, Advanced IP Blocker now continues operating normally (WAF, Rate Limiting, Geo-blocking, Login Protection, 2FA, and basic file checksum verification remain active) instead of halting with a initialization failure.
* **UI & UX (Plugin-Scoped Notice & Persistent Dismiss):** Added a clear warning notice shown exclusively inside Advanced IP Blocker admin pages when `class-advaipbl-fim-engine.php` is missingâ€”respecting third-party notice suppression while including a nonce-protected **Dismiss permanently** option stored per user. Also added dedicated inline status notices in the File Integrity Monitor dashboard and under **Settings -> Internal Security & Forensics**.
* **PERFORMANCE (Cron & Sync Guard):** Automatically pauses and unschedules background malware signature synchronization (`advaipbl_fim_signatures_sync_event` and `advaipbl_fim_signatures_version_check_event`) whenever `ADVAIPBL_FIM_Engine` is unavailable.

= 8.13.27 =
* **BUGFIX & SECURITY (Active User Sessions / Proxy IP Resolution):** Added `sync_real_ip_on_auth_cookie()` hooked to `set_auth_cookie` to update newly created WordPress session tokens with the resolved real client IP (`get_client_ip()` via Trusted Proxies) using `WP_Session_Tokens` public APIs, preventing Cloudflare or reverse-proxy IPs from appearing in Active User Sessions even on servers without Nginx `real_ip` configured.
* **NEW FEATURE (Active User Sessions Control):** Added individual session termination (**Close Session**) alongside **Close All** for multi-device users, plus a **Current** badge to clearly identify the administrator's active session and prevent accidental self-logout.
* **ENHANCEMENT (Device Detection):** Upgraded `parse_user_agent()` to accurately identify modern Chromium browsers (`Edge`, `Opera`, `Samsung Internet`), iOS browsers (`CriOS`, `FxiOS`), and `ChromeOS`, and added a tooltip displaying the full `User-Agent` string on hover.
* **ENHANCEMENT (Trusted Proxies & CDN Manager):** Switched default Trusted Proxies and the Cloudflare Quick Add preset from ASNs to official Cloudflare IPv4/IPv6 CIDRs (shared via `ADVAIPBL_CDN_Manager::get_cloudflare_cidrs()`), removed the discontinued StackPath preset, added line-by-line deduplication in Quick Add, and implemented `fetch_provider_ips()` for Cloudflare, Fastly, and QUIC.cloud.
* **ENHANCEMENT (Audit Log & 2FA):** Successful 2FA step-2 logins in `handle_login_action()` now record `user_login` events in the Activity Audit Log cleanly without triggering duplicate third-party `wp_login` side effects.

= 8.13.26 =
* **NEW FEATURE (Developer Filter / White-Label):** Introduced the `advaipbl_show_branding` WordPress filter (`true` by default) and centralized branding rendering via `ADVAIPBL_Main::get_branding_html()`. Administrators and agencies can now cleanly disable the footer attribution (`Performance & security by Advanced IP Blocker`) globally or selectively by context (`block_page`, `login_whitelist`, `login_geo`, `js_challenge`, `captcha`) without modifying core plugin files.
* **PERFORMANCE & OPTIMIZATION (Database Size):** Reduced the default `Log Retention (days)` value from **30 days to 15 days** across core defaults, settings UI, audit log cleanup, and challenge metrics retention to prevent excessive database growth on shared hosting environments while keeping existing user-configured retention values intact.

= 8.13.25 =
* **SECURITY (REST API User Protection):** Migrated user endpoint protection to `rest_pre_dispatch` with strict 403 Forbidden responses for anonymous requests to `/wp/v2/users`, integrated with Threat Score scoring when Strict Author Scan Block is active, and enforced aggressive anti-cache HTTP headers (`Cache-Control: private, no-cache, no-store, must-revalidate`, `X-Accel-Expires: 0`) to prevent intermediate proxies (Varnish, Fastly, Cloudflare, Nginx) from caching and exposing unauthenticated user lists.
* **SECURITY (Data Leak Prevention):** Implemented automated sanitization on all public REST API post types (`rest_prepare_{post_type}`) to strip embedded author links and objects (`_embedded.author`) from post queries, neutralizing username discovery through `?_embed`.
* **SECURITY (Author Scan Protection):** Enhanced author enumeration detection to intercept both numeric ID queries (`?author=X`) and author slug queries (`?author_name=X`), accompanied by anti-cache headers.
* **SECURITY (Whitelist & Proxy Isolation):** Hardened the IP whitelist to reject loopback addresses (`127.0.0.1`, `::1`) from being manually added as general whitelisted IPs, preventing reverse-proxy header spoofing and unintended authorization bypasses in multi-tier server architectures (Cloudflare, Varnish, Nginx). Includes automatic migration (`auto_migrate_8_13_25`) to clean legacy loopback entries from the whitelist while keeping them safely in Trusted Proxies.
* **PERFORMANCE & RESILIENCE (Community Sync & Diagnostics):** Implemented client-side concurrency mutex locks and a 2-hour minimum cooldown between automatic scheduled synchronizations to prevent broken or aggressive visitor-triggered WP-Cron loops from overwhelming the central API. Added `If-None-Match` / ETag support to accept `304 Not Modified` responses without re-downloading identical feeds, and gracefully handled HTTP 429 rate-limiting responses with clear diagnostic warnings in the General Log and automatic cooldown backoff.
* **ENHANCEMENT (Telemetry & Diagnostic Logging):** Enriched Central API HTTP 429 rate-limiting events in General Log across Community Blocklist and WAF/FIM version check endpoints. Log entries now capture the exact request endpoint path, server error response body, and `Retry-After` header interval for streamlined auditing and support troubleshooting, fully backed by internationalization (`.pot`).
* **ENHANCEMENT (Remote Notices UI):** Redesigned the remote security advisories layout with an automatic 2-column container, official local dashboard icon (`assets/img/icon-256x256.png`), and backward-compatible support for dual aligned action buttons (primary and secondary).
* **SECURITY (Cloud WAF Signatures):** Deployed 4 new cloud-synced Zero-Day WAF rules and signatures to defend against critical RCE and arbitrary file upload vulnerabilities in The Grid (CVE-2026-94169) and YOOtheme Pro (CVE-2026-102785).

= 8.13.24 =
* **SECURITY (WAF & Advanced Rules Engine):** Hardened request URI and query string normalization, path exclusion parsing, and challenge session evaluation to ensure consistent enforcement of blocking, scoring, and rate-limiting rules across all request contexts.
* **SECURITY (Access Control):** Strengthened capability verification (`advaipbl_manage_settings`) across WordPress Settings API groups, admin actions, File Integrity Monitor operations, and background task runners for strict role-based isolation.
* **SECURITY (Network & Proxy Handling):** Improved multi-hop proxy header parsing (`X-Forwarded-For`) and enforced strict TLS certificate verification on outbound remote advisory connections.
* **PERFORMANCE & STABILITY:** Capped raw HTTP body inspection (`php://input`) to 128 KB in the WAF and Advanced Rules engines to prevent excessive memory consumption during oversized POST requests, improved regex pattern preservation when saving custom rules in the admin UI, and implemented safe PCRE2 batch compilation in the File Integrity Monitor (FIM) regex scanner.
* **SECURITY (Whitelist & Anti-Lockout):** Added multi-layer whitelist and active administrator session verification before dispatching IP blocks to Cloudflare Edge or queueing reports for the AIB Community Network, and ensured automatic Cloudflare rule removal when an IP is whitelisted.

= 8.13.23 =
* **SECURITY (.htaccess & Anti-Lockout):** Enforced strict whitelist filtering in Apache `.htaccess` rule generation, guaranteeing that whitelisted IPs (administrator sessions, search engine bots, loopback) are never written into server-level deny directives. Fixed uninstallation and deactivation routines to cleanly and unconditionally remove `# BEGIN Advanced IP Blocker` directives, and hardened unblock routines to purge stale records even if an IP was already listed in the whitelist.
* **SECURITY (Import / Export):** Hardened Settings Import/Export against accidental lockouts. Excluded whitelisted and active administrator IPs from exported blocked IP tables, rejected whitelisted IPs during table restoration, enforced automatic admin unblocking and whitelist validation post-import, sanitized API keys (Turnstile/hCaptcha) from templates, isolated site-specific secrets, enforced strict upload validation (`is_uploaded_file()`) with a 10MB limit, and added UTF-8 BOM tolerance.
* **ENHANCEMENT (Cloud Edge Defense):** Hardened Cloudflare edge rule uninstallation in `uninstall.php`. Added PHP execution time extension (`set_time_limit(300)`), streamlined request timeouts, and implemented rate-limiting delays (`usleep(30000)`) to ensure clean, uninterrupted edge firewall rule deletion without timing out during complete plugin removal.
* **SECURITY (Advisories):** Expanded the Remote Notices system (`ADVAIPBL_Remote_Notices`) with WordPress Core version rule matching (`target_wp_rule`) to dynamically alert administrators about critical core vulnerabilities affecting specific release branches (e.g., WP 7.1.3 RCE upgrade vulnerability), and added automatic BOM stripping to ensure reliable JSON parsing.
* **BUGFIX (Uninstaller):** Ensured 100% clean data deletion in `uninstall.php` when "Delete Data on Uninstall" is enabled. Added missing File Integrity Monitor baseline version (`advaipbl_fim_baseline_version`) and live feed token to the purge routine, and added a wildcard database sweep (`advaipbl_%` and `advanced-ip-blocker_%`) to guarantee no orphaned options remain in `wp_options`.
* **BUGFIX (UI/UX):** Resolved duplicate admin notices on fresh installations and settings pages by removing redundant template invocations, eliminating duplicate hook registrations, and adding static execution guards to ensure every admin notice and telemetry banner renders strictly once per request.
* **NEW FEATURE (WP-CLI):** Added dedicated `wp advaipbl panic <status|on|off|mode>` subcommand, allowing system administrators to inspect, manually engage (emergency DDoS JS challenge), or cancel Distributed Attack Protection (Auto-Panic) directly from the terminal.
* **NEW FEATURE (WP-CLI):** Added dedicated `wp advaipbl hardening <status|enable|disable> [feature]` subcommand to audit and toggle WordPress Core Hardening protections (PHP in Uploads, File Editor, Application Passwords, WP Version, ImageMagick) via CLI.
* **NEW FEATURE (WP-CLI):** Added dedicated `wp advaipbl cache <purge|flush|status>` subcommand to safely inspect and purge temporary block transients, rate-limiting counters, and security metrics buffers without affecting permanent rule lists.
* **ENHANCEMENT (WP-CLI):** Redesigned `wp advaipbl status` into a comprehensive categorized report covering all modules (Emergency Defense, Firewall & WAF, Threat Feeds & Geo, Access & Auth, Hardening, and Forensics) with real-time attack alerts.
* **ENHANCEMENT (WP-CLI):** Enhanced `wp advaipbl config get` to seamlessly merge database options with core plugin default settings, ensuring accurate runtime configuration inspection even on fresh installations, and added `--search` and format support.
* **ENHANCEMENT (WP-CLI):** Improved `wp advaipbl config set` with natural boolean toggle recognition (`on`/`off`/`true`/`false`) and robust array parsing for geoblocking and role restrictions.
* **UI/UX:** Updated the "WP-CLI Interface" documentation modal in the Credits / About tab with the complete and categorized command reference.

= 8.13.22 =
* **NEW FEATURE:** Added dedicated WP-CLI administrator management subcommand (`wp advaipbl admin <list|allow|remove|reset>`) allowing administrators to view, authorize, remove, or reset access to the plugin dashboard directly via terminal.
* **ENHANCEMENT:** Added automatic fail-safe recovery and `deleted_user` hook cleanup for Authorized Administrators (`allowed_admin_users`). If all authorized administrator accounts are deleted from WordPress, the plugin automatically restores access to active administrators with `manage_options`, preventing permanent orphaned lockouts while strictly maintaining access restrictions when authorized admins exist.
* **ENHANCEMENT:** Improved WP-CLI `config set` parsing for array-based options (`allowed_admin_users`, `tfa_force_roles`), adding support for comma-separated values, JSON arrays, and clearing restrictions using `none` or `empty` without triggering PHP array-to-string notices.
* **SECURITY:** Updated Site Health & Security Scanner PHP version classification to match official PHP lifecycle policies (<8.2 flagged as Critical/EOL with no security support, 8.2 as Warning, 8.3/8.4/8.5+ as Good/Active).
* **ENHANCEMENT:** Fixed child theme handling in Vulnerability Audit. When child themes are installed, the scanner now inspects the parent theme's actual version rather than sending the child theme's local version, preventing false positive vulnerability alerts and clearly displaying child-to-parent relationships in the UI.
* **UI/UX:** Enhanced Dashboard "Challenges Overview" chart breakdown. Out of total challenges served, the chart now accurately depicts the challenge outcomes: Verified Humans (Passed), Failed Attempts, and Unsolved/Dropped Bots (automated threats stopped before executing JavaScript), eliminating redundant slices.
* **ENHANCEMENT:** Improved "Advanced Rules Hits" widget with real-time metrics buffer aggregation and graceful empty-state messaging when no rules have been triggered.

= 8.13.21 =
* **NEW FEATURE:** Enhanced Remote Security Advisories (`ADVAIPBL_Remote_Notices`) with intelligent local environment filtering, allowing security alerts to target specific vulnerable PHP branches (including EOL branches) or specific installed/active plugins and themes by slug and version threshold.
* **ENHANCEMENT:** Linked File Integrity Monitor (FIM) critical file modification email alerts to the master "Enable Email Notifications" toggle (`enable_email_notifications`) for consistent centralized email notification control.
* **UI/UX:** Clarified the "Enable Email Notifications" setting description to indicate that it governs both IP block notifications and system/security event alerts (such as AbuseIPDB quota warnings and FIM alerts).

= 8.13.20 =
* **SECURITY:** Hardened Two-Factor Authentication (2FA) by enforcing on-demand initialization of `ADVAIPBL_2FA_Manager` across all authentication contexts (including frontend login forms like WooCommerce `/my-account/` and custom login URLs), adding server-side expiration (`advaipbl_2fa_step1_expires`) to Step-1 interim tokens, and automatically revoking Step-1 tokens upon reaching the brute-force lockout threshold.
* **SECURITY:** Upgraded the native JavaScript Challenge engine (Automatic & Managed modes) from static arithmetic to a cryptographic FNV-1a 32-bit Proof-of-Work (PoW) challenge with split-seed reconstruction, headless browser detection (`navigator.webdriver`), trusted DOM event verification (`event.isTrusted`), IP/mode HMAC binding, minimum execution time enforcement, and anti-replay protection.
* **BUGFIX:** Fixed IPv6 geolocation failures when using the MaxMind GeoLite2 Local Database by adding fallback resolution to `registeredCountry`, `representedCountry`, and `GeoLite2-Country.mmdb`, as well as triggering external API fallback when local records only contain ASN data without a country code.
* **BUGFIX:** Resolved a File Integrity Monitor (FIM) false-positive alert on subdirectory WordPress installations (where `siteurl` and `home` differ) caused by `.htaccess` path resolution mismatches between the `.htaccess` Firewall Manager (root `/.htaccess`) and the FIM scanner (`ABSPATH . '.htaccess'`).
* **ENHANCEMENT:** Hardened root `.htaccess` path resolution in `ADVAIPBL_Htaccess_Manager` to deterministically compute the home directory from `ABSPATH` across frontend, WP-Cron, and CLI execution contexts.
* **BUGFIX:** Removed a duplicate warning log entry when a JS Challenge verification fails.

= 8.13.19 =
* **ENHANCEMENT:** File Integrity Monitor (FIM) now captures cryptographic hash and file size deltas (e.g., `old_size` -> `new_size`, `old_hash` -> `new_hash`) in alert emails and the Audit Log, helping administrators instantly distinguish between byte-level line-ending changes and file modifications.
* **ENHANCEMENT:** Added file size tracking to the baseline snapshots (`advaipbl_fim_baseline_hashes`) with full backward compatibility for existing installations.
* **BUGFIX:** Fixed an issue in the FIM baseline updater where newly discovered or added files were not being committed to the stored baseline.

= 8.13.18 =
* **BUGFIX:** Resolved File Integrity Monitor (FIM) false-positive alert loop where updated baseline hashes were not committed after sending modification alerts for critical files (wp-config.php and .htaccess).
* **NEW FEATURE:** Added a one-click "Reset Baseline Hashes" button in Internal Security settings allowing administrators to immediately re-synchronize FIM snapshots after making legitimate server modifications.
* **ENHANCEMENT:** Added support for `wp-config.php` located in the parent directory above the WordPress root (standard WordPress hardening architecture).
* **ENHANCEMENT:** Enhanced path normalization and matching in the File Verifier engine across Apache, Nginx, and Windows server environments.

= 8.13.17 =
* **PERFORMANCE:** Optimized Security Dashboard map loading during large DDoS and botnet attacks. The live attack map now pre-sorts and limits attack events to the 200 most recent entries before performing geolocation lookups, completely eliminating 30-second PHP execution timeouts and AJAX errors when thousands of IPs are blocked.
* **UI/UX:** Updated the Security Dashboard map widget title to "Live Attack Map (Latest 200 Attacks)" to clearly differentiate the rendered map markers from the total blocked IPs counter badge.

= 8.13.16 =
* **Security (Critical):** Fixed an Authentication Bypass vulnerability where users with Two-Factor Authentication (2FA) enabled could bypass 2FA checks via XML-RPC using their standard password.
* **Security:** Hardened the 2FA authentication flow by migrating the interim Step-1 token from URL parameters to a secure, HttpOnly cookie, preventing token leakage in server access logs and browser history.
* **Enhancement:** Integrated the 'Login Whitelist Block' restriction into the core Threat Score engine. Repeated unauthorized login attempts now accumulate points and trigger network-level bans (Cloudflare/.htaccess).
* **Feature:** Added 'Login Whitelist Block' to the Threat Score configuration UI so administrators can customize the penalty points.
* **Fix:** Corrected a visual bug in the Security Audit Log where access rejections (such as Login Whitelist, Geo-blocking) were erroneously displayed as "Blocked: Permanent". They are now accurately labeled as "Request Rejected".
* **Fix:** Fixed an issue where the attacker's IP was displayed as "N/A" in the Security Log for Login Whitelist block events.

= 8.13.15 =
* **Security:** Enhanced 2FA brute-force protection. Administrators can now configure the "Max 2FA Failures" and "Lockout Duration" directly from the Login Security settings.
* **Security:** Differentiated generic login failures from 2FA failures. The Audit Log now flags failed 2FA attempts as "Critical - Password Compromised" instead of generic invalid credentials.

= 8.13.14 =
* **Security (Critical):** Fixed an Authentication Bypass vulnerability in the Two-Factor Authentication (2FA) login flow.
* **Security:** Implemented strict anti-brute-force rate limiting for 2FA TOTP verification (accounts are temporarily locked for 15 minutes after 5 failed attempts).
* **Security:** Failed 2FA attempts now correctly trigger the native WordPress wp_login_failed hook, ensuring compatibility with server-level IP banning tools like Fail2Ban.
* **I18n:** Added missing translation strings for the new 2FA security prompts to the .pot file.

= 8.13.13 =
* **COMPATIBILITY:** Full Nginx Environment Support. The plugin now intelligently detects Nginx servers and automatically adapts its UI to disable unsupported `.htaccess` features in the Setup Wizard and Settings pages.
* **ENHANCEMENT:** Added a built-in Nginx Vhost snippet generator. Nginx users are now provided with exact copy-paste configuration rules to protect sensitive plugin directories and block malicious PHP execution in the uploads folder.
* **ENHANCEMENT:** The HTTP Security Headers module now explicitly notifies Nginx users of its dynamic PHP fallback mechanism and provides guidance for static file protection.
* **ENHANCEMENT:** The System Status dashboard now accurately reports `.htaccess` core file permission checks as 'Not Applicable' on Nginx servers instead of showing misleading errors.
* **BUGFIX:** Resolved a critical MySQL syntax error triggered during the "Unblock All IPs" and expired IP cleanup routines, caused by a misplaced code validation comment inside the database query.

= 8.13.12 =
* **NEW FEATURE:** Zero-Day Advanced Telemetry. The dashboard now tracks exact analytics (`first_seen`, `unique_ips`, `unique_sites`) for each blocked Zero-Day attack to provide deeper threat intelligence.
* **NEW FEATURE:** Manual Sync for the Community Defense Network. Added a "Sync Now" button with AJAX feedback to manually force the latest community threat feed update.
* **ENHANCEMENT:** Advanced Rules Engine can now seamlessly parse and flatten `multipart/form-data` payloads (including `$_FILES`), drastically improving the interception of Arbitrary File Upload zero-day exploits.
* **ENHANCEMENT:** Increased the responsiveness of the Remote Security Notices synchronization by updating the local cron interval from 24 hours to 6 hours.
* **BUGFIX:** Implemented an API transient lock for the Wordfence Vulnerability Importer to protect the free tier API quota from being suspended by repetitive WP-Cron executions.
* **ENHANCEMENT:** Integrated the "Whitelist Login Countries" feature with the Threat Scoring Engine. Failed login attempts from unauthorized countries now accumulate threat score points (default: 25) instead of just showing a soft block, leading to an automatic hard block for persistent bots.
* **OPTIMIZATION:** Drastically improved WordPress Admin performance by implementing a Smart Transient Cache system for database pagination `COUNT()` queries. This allows viewing the full history of millions of records (e.g. 100,000+ pages) without crashing the server or triggering MySQL 'Slow Queries'.
* **BUGFIX/OPTIMIZATION:** Resolved 'API Required' map errors on the IP Inspector tab by replacing the CARTO map tiles with an embedded OpenStreetMap iframe. This change also eliminates unnecessary map-related Javascript (Leaflet) from loading on this tab, improving dashboard performance.
* **BUGFIX:** Fixed an issue where critical plugin notifications (AIB Alerts, Force 2FA, Setup Wizard, and Threat Feed Status) were being incorrectly suppressed within the plugin's own dashboard pages.

= 8.13.11 =
* **SECURITY:** Implemented a new internal authentication header (`X-AIB-Auth`) across all API endpoints to improve communication security and bypass restrictive firewall/CGI configurations that strip standard authorization headers.
* **ENHANCEMENT:** Added version tracking parameters to all API requests to ensure better backward compatibility and diagnostic capabilities with the central server.
* **BUGFIX:** Resolved a critical MySQL `max_allowed_packet` error that caused the File Integrity Monitor (FIM) malware signatures synchronization to fail on local environments (like XAMPP) and restrictive shared hosting. Signatures are now smartly chunked into smaller payloads before being saved to the database.

= 8.13.10 =
* **ENHANCEMENT:** Upgraded the Advanced WAF Rules Engine to use `apache_request_headers()` as a fallback, ensuring sensitive headers (like `Authorization`) can be evaluated even on restrictive Apache/LiteSpeed environments that hide them from `$_SERVER`.
* **BUGFIX:** Added the fallback header to the V4 Community Blocklist fetch routine to ensure API tokens are reliably transmitted and bypass strict CGI server configurations.

= 8.13.9 =
* **NEW FEATURE:** Introduced a Remote Admin Notifications system. You will now receive important security alerts, zero-day warnings, and feature updates directly in your WordPress dashboard without needing a plugin update.
* **ENHANCEMENT:** True 'Hybrid' Dual-Logging for Telemetry. Telemetry events are now reliably tracked in the database without altering or duplicating the native `debug.log` formats.
* **BUGFIX:** Fixed a UI layout issue in the Security Logs where massive Captured Request Payloads (like reCAPTCHA tokens) stretched the container horizontally. Added proper CSS word-wrapping.
* **BUGFIX:** Resolved a PHP Fatal Error caused by a missing variable (`$stripe_webhook_ips`) during array merging for immune IPs.
* **TWEAK:** Added Redsys and Paddle to the global immune IPs list to prevent accidental blocks on legitimate payment webhooks.


= 8.13.8 =
* **SECURITY:** Added Zero-Day WAF protection against the Bookly AI IDOR vulnerability (CVE-2026-89063) via Advanced Rate Limiting.
* **BUGFIX:** Resolved a PHP Fatal Error (500 Internal Server Error) triggered by the Advanced Rules engine when a rate limit (`429`) action was executed.
* **BUGFIX:** Fixed an issue where Advanced Rule rate limit blocks were not being displayed in the Security Logs dashboard.

= 8.13.7 =
* **SECURITY:** Patched a critical Arbitrary File Move (Path Traversal) vulnerability in the File Integrity Monitor quarantine endpoint.
* **SECURITY:** Added strict IP-based transient rate limiting to legacy V1 and V2 telemetry endpoints to prevent database poisoning and bot spam.
* **SECURITY:** Security Audit completed. Verified 100% CSRF (Nonce) and Privilege Escalation protection across all 40+ AJAX and Admin Post endpoints.
* **BUGFIX:** Fixed WAF payload parsing for `multipart/form-data` to accurately block zero-day exploits hidden in file uploads.

= 8.13.6 =
* **NEW FEATURE:** Rate Limiting in Advanced Rules. You can now apply granular rate limits (reqs/secs) to specific URIs or payloads.
* **NEW FEATURE:** Dynamic Rate Limit Fallbacks. Define custom penalty actions (e.g., Turnstile Challenge, 403 Block, or 429 Slow Down) when a rate limit is exceeded.
* **ENHANCEMENT:** Hardened Zero-Day WAF Generic rules for XSS and SQLi to drastically reduce false positives on valid payloads.
* **BUGFIX:** Fixed a pagination bug in the Advanced Rules UI that prevented editing rules on pages 2 and beyond.
* **BUGFIX:** Fixed a CSS layout issue where very long Regex payloads caused the action buttons to break out of their container.
* **BUGFIX:** Patched the rules evaluation engine loop that caused premature termination on non-blocking actions.

= 8.13.5 =
* **PERFORMANCE:** Massive 200x speed optimization in the File Integrity Monitor (FIM). Over 10,000 RegEx malware signatures are now compiled dynamically into a single unified pattern to prevent Deep Scan timeouts.
* **NEW FEATURE:** FIM now automatically quarantines highly confident threats (MD5 & SHA256 matches) immediately upon detection, accompanied by an automatic email/push notification alert.
* **NEW FEATURE:** Added a configurable "Deep Scan Chunk Size" setting under Internal Security. Users on shared hosting can now lower the batch size to completely prevent server execution timeouts during deep scans.
* **SECURITY:** Built a new anti-breakage safeguard into the FIM Engine. The scanner strictly protects WordPress core files (e.g., wp-config.php, index.php), active themes, and plugins from being auto-quarantined to prevent site downtime.
* **BUGFIX:** Resolved a false-positive issue in FIM caused by structural changes in the upstream signatures payload format.
* **TWEAK:** Expanded default FIM exclusions to include safe cache/backup directories (advaipbl-backups, redux, wpforms) to prevent empty index.php false positives.
* **SECURITY:** Added Zero-Day WAF rules.

= 8.13.4 =
*   **ENHANCEMENT:** Added a new "User-Agent URI Exclusions" text box in Settings. Site administrators can now specify particular URIs (like `/wp-json/`) that will completely bypass User-Agent blocking and scoring, providing granular control for APIs and webhooks.
*   **BUGFIX:** Unified the default User-Agent blocked list structure. The UI now dynamically syncs with the core configuration to guarantee both lists always reflect the same active protections, preventing legacy tools from being erroneously restored.
*   **BUGFIX:** Fixed an issue where the "Whitelist Login Access" engine failed to generate a Security Log event when blocking a request. Added a dedicated "Login Whitelist" filter to the Security Logs UI.
*   **ENHANCEMENT:** Standardized the plugin's branding signature ("Performance & security by Advanced IP Blocker") across all blocking screens, Captchas, and JS Challenges to improve brand visibility and consistency.
*   **TWEAK:** Optimized the early-init login restrictions (Whitelist and Geo-blocking) to bypass the threat scoring system and 403-challenge interceptions, instantly blocking attackers and saving server resources.

= 8.13.3 =
*   **SECURITY:** Added Zero-Day WAF rules for recent critical vulnerabilities including All-in-One WP Migration SQLi (CVE-2026-19949) and Gravity Forms Arbitrary File Upload (CVE-2026-19513).
*   **ENHANCEMENT:** Advanced Rules Import/Export now intelligently filters out dynamically synced Cloud Zero-Day Rules (`ar_zd_`) to prevent rule duplication and false positives across different sites, automatically triggering a background cloud sync after import.
*   **NEW FEATURE:** Fully self-documented WP-CLI Interface. The plugin's command-line interface now includes comprehensive help screens (`## SYNOPSIS`, `## OPTIONS`, and `## EXAMPLES`) for all commands, automatically parsed by WP-CLI.
*   **ENHANCEMENT:** Updated the "Key Features Overview" panel in the Credits tab to include our newest security modules: File Integrity Monitoring (FIM), Manual Integrity Scanner, Advanced Rules Cloud Sync, and Comprehensive Audit Logging.
*   **ENHANCEMENT:** The "WP-CLI Interface" section in the plugin's dashboard now displays a complete, logically grouped list of all available CLI commands to help system administrators automate their workflows.
*   **ENHANCEMENT:** Rebuilt and synchronized the official plugin translation template (`.pot` file) to include all the new user interface strings.
*   **BUGFIX:** Removed legitimate Android OS signatures (`okhttp`, `Dalvik/`) and developer tools (`Go-http-client`, `PostmanRuntime`) from the default blocked User-Agent list to prevent false positive bans on mobile users and APIs.
*   **BUGFIX:** Resolved WPCS warnings related to the `DONOTCACHEPAGE` constant across multiple challenge and verification classes.

= 8.13.2 =
*   **HOTFIX:** Refactored the File Integrity Monitor engine to fetch malware signatures dynamically from the Central API and store them in the database. This prevents the plugin's internal malware dictionary from triggering false positives in server-side antiviruses (e.g., CPGuard, Imunify360).
*   **NEW FEATURE:** Added a "Manage Whitelist" UI to the FIM Dashboard for manually excluding files from scans.
*   **ENHANCEMENT:** The FIM scanner now automatically ignores the plugin's own directory to prevent false positives caused by security-related localization strings.

= 8.13.1 =
*   **HOTFIX:** Refactored the File Integrity Monitor engine to store malware signatures as ASCII integer arrays. This eliminates false positives caused by server-side antiviruses (like CPGuard or Imunify360) incorrectly flagging the plugin's internal malware dictionary during static scans.

= 8.13.0 =
*   **NEW FEATURE:** File Integrity Monitor (Phase 2): Uploads Malware Scanner. The FIM now extends beyond core files to recursively scan the `wp-content/uploads/` directory for suspicious executable files (e.g., hidden `.php` shells), alerting administrators immediately without causing false positives on legitimate index files.
*   **NEW FEATURE:** Quarantine Vault. A secure backend interface to safely encrypt and isolate malicious or suspicious files detected by the File Integrity Monitor, preventing them from being executed by attackers while preserving them for forensic analysis.
*   **NEW FEATURE:** Advanced Payload Logging. The WAF and Block engines now capture, sanitize, and log the raw HTTP payload (POST data) of malicious requests, providing invaluable context for administrators investigating complex attacks like SQL injections or XSS.
*   **ENHANCEMENT:** The FIM alert notification system now dynamically checks your security configuration and will append a highly visible recommendation to enable "Block PHP in Uploads" if an anomaly is detected and the feature is currently disabled.
*   **ENHANCEMENT:** FIM alert emails now feature color-coded event types for improved scannability (e.g., orange for suspicious files, red for deleted core files).
*   **ENHANCEMENT:** Modernized Admin UI. Redesigned all configuration inputs across the plugin to feature dynamic floating labels, sleek borderless designs, and premium dark background filters for a better user experience.
*   **ENHANCEMENT:** Optimized Local WAF Rules. Refined the default and suggested regular expressions (e.g. Path Traversal) to be highly precise, eliminating false positives caused by overly aggressive legacy patterns (like `/?author=` or trailing hyphens).
*   **BUGFIX:** Resolved a persistent PHPCS linting error (`OutputNotEscaped`) in the WAF status tag renderer.

