=== NexaGuard – Malware Scanner & Web Security ===
Contributors: asbel27
Donate link: https://www.nexaguards.com/
Tags: security, malware scanner, malware cleaner, anti malware, firewall
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Deep forensic malware scanner, core integrity monitor, webshell quarantine, and hardened perimeter security defense for WordPress sites.

== Description ==

**NexaGuard – Malware Scanner & Web Security** is an advanced, lightweight cybersecurity solution engineered to protect WordPress websites against sophisticated intrusions, code injections, and emerging web threats.

NexaGuard uses an optimized heuristic engine and cryptographic checksums to audit source code, core files, and database options with high efficiency and minimal resource usage.

### 🛡️ Key Features

* **Deep Forensic Scanner:** Audits the root directory, themes, plugins, mu-plugins, uploads, and wp_options for malicious code and spam injections (such as Japanese keyword hack and gambling SEO spam).
* **Detect ClearFake, EtherHiding & ClickFix:** Flags injected base64 scripts, malicious blockchain RPC calls, and fake captcha popups.
* **Core Integrity Monitor (Sentinel):** Compares core WordPress files directly against official WordPress.org cryptographic hashes to flag unauthorized modifications instantly.
* **Malware Quarantine & Isolation:** Safely isolates suspicious or infected files into a protected quarantine directory with execution disabled, preserving forensic evidence.
* **Perimeter Hardening & WAF:** Disables PHP execution in `/uploads/`, blocks directory browsing (Options -Indexes), disables file editing in the admin panel, prevents user enumeration, and inspects incoming requests.

== Installation ==

1. Upload the `nexaguard-malware-scanner` folder to your `/wp-content/plugins/` directory, or upload the `.zip` file via **Plugins > Add New > Upload Plugin**.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **NexaGuard** in the WordPress administration sidebar.
4. Click **Start Forensic Scan** to audit and secure your site.

== Frequently Asked Questions ==

= Will NexaGuard slow down my site? =
No. NexaGuard is built with performance in mind. The forensic scanner processes files in controlled batches with dynamic pauses to keep CPU and memory usage minimal.

= What happens if NexaGuard detects an infected file? =
You can safely isolate the infected file into a protected quarantine directory (with execution strictly blocked via .htaccess) or neutralize unauthorized configuration files. A forensic backup is stored securely in your uploads directory for reference.

= Does this plugin require an external service to work? =
No. The core functionality—local forensic scanner, WordPress core integrity verification, quarantine, and perimeter hardening rules—is 100% free, runs locally on your server under GPLv2, and does not require any license key. Optionally, you may enable Cloud Threat Intelligence in settings to receive updated malware signatures from NexaGuard Cloud.

== External Services ==

This plugin can connect to the following external services:

1. **WordPress.org Core Checksum API**
* **Service:** Official WordPress Core Cryptographic Checksum API
* **URL:** https://api.wordpress.org/core/checksums/1.0/
* **Purpose:** Allows Sentinel to verify the integrity of your WordPress installation by comparing local core files with official hashes.
* **Data transmitted:** WordPress core version and locale (e.g., `version=6.7&locale=en_US`). No personal or site data is transmitted.
* **Privacy Policy:** https://wordpress.org/about/privacy/

2. **NexaGuard Threat Intelligence Cloud (Optional / Opt-in)**
* **Service:** NexaGuard Threat Intelligence Feed
* **URL:** https://www.nexaguards.com/api/threat-intel
* **Purpose:** Downloads updated malware heuristic signatures. This service is completely optional and disabled by default; it only connects if the administrator explicitly enables "Cloud Threat Intelligence" in NexaGuard Settings.
* **Data transmitted:** Site domain name and client user-agent.
* **Terms of Service:** https://www.nexaguards.com/terminos
* **Privacy Policy:** https://www.nexaguards.com/privacidad

3. **NexaGuard License Verification API (Optional)**
* **Service:** NexaGuard Licensing & Account Service
* **URL:** https://www.nexaguards.com/api/license/
* **Purpose:** Validates optional PRO licenses or free community license tokens when the user clicks the license activation buttons.
* **Data transmitted:** Site domain name and license key. No administrative credentials or personal site content is transmitted.
* **Terms of Service:** https://www.nexaguards.com/terminos
* **Privacy Policy:** https://www.nexaguards.com/privacidad

== Screenshots ==

1. NexaGuard Dashboard: threat summary, scan controls, and perimeter defense status.
2. Deep Forensic Scanner identifying backdoors, webshells, and SEO spam injections.
3. Core Sentinel verifying file integrity against official WordPress.org checksums.
4. Perimeter security hardening settings and directory protections.

== Changelog ==

= 1.5.9 =
* Strict path boundary validation: added comprehensive checks against sibling-prefix bypasses and directory escapes across all quarantine, backup, and neutralization functions.
* 100% unlocked WAF and defense modules: made all perimeter rules, brute force defense, and WAF inspection fully accessible and configurable locally under GPLv2 without any license gating.
* Aligned documentation with security best practices: updated quarantine descriptions to accurately describe forensic isolation and guidance to reinstall clean plugins/themes from WordPress.org.

= 1.5.8 =
* Standardized directory and path resolution using official WordPress functions (`plugin_dir_path()`, `plugin_dir_url()`, `get_home_path()`, `wp_upload_dir()`).
* Replaced all internal constants (`WP_PLUGIN_DIR`, `WP_CONTENT_DIR`, `WPINC`, `ABSPATH`) with WordPress core API path handlers.
* Added official plugin constants `NEXAMASC_PLUGIN_FILE`, `NEXAMASC_PLUGIN_DIR`, and `NEXAMASC_PLUGIN_URL` matching WordPress.org requirements.
* Strict write boundary enforcement: removed all arbitrary file write and copy operations targeting plugin and theme directories.
* Quarantine storage relocated to dedicated `/wp-content/uploads/nexaguard-malware-scanner/quarantine/` with access denial `.htaccess`.
* Hardened database remediation: option cleanup and deletion are strictly constrained to threats recorded during verified forensic scans.
* Replaced in-place file editing of infected plugin/theme files with native guidance to reinstall clean copies from WordPress.org repository.
* Automated neutralization of rogue configuration files located inside `wp-content` using `wp_delete_file()`.

= 1.5.7 =
* Updated plugin display name to "NexaGuard – Malware Scanner & Web Security" and slug to "nexaguard-malware-scanner".
* 100% GPL compliance update: unlocked all local perimeter hardening rules and scanner capabilities.
* Documented external services (WordPress.org Checksums API and NexaGuard Threat Intel).
* Threat Intelligence Feed is now strictly opt-in via settings.
* Relocated all quarantine and backup storage exclusively to protected uploads directory.
* Sanitized file paths and hardened database option cleanup against arbitrary operations.
* Sentinel now masks wp-config.php hashes to protect authentication keys and salts.
* Enqueued login styles using wp_add_inline_style() and eliminated raw inline styles.
* Fixed transient prefixes to standard nexaguard_ namespace.

= 1.5.6 =
* Compatibility update for WordPress 7.1 and PHP 8.2+.
* Intuitive tab reorganization: Core Sentinel and 24H Vigilance positioned alongside Forensic Scanner.
* Enhanced heuristic detection for ClearFake, ClickFix, and Web3 smart contract injectors.
* Optimized quarantine backup and forensic evidence management.

= 1.5.0 =
* Initial release of the unified NexaGuard Security Suite.
