=== CortexRouter – Malware Scanner & Firewall ===
Contributors: angelforce
Tags: security, malware, audit, compliance, gdpr
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.31.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Malware, vulnerability and file-integrity scanning with a GDPR, NIS2 and OWASP compliance summary, and free vulnerability data. Audit your own site.

== Description ==

**CortexRouter – Malware Scanner & Firewall** audits your WordPress site for malware, vulnerabilities and configuration weaknesses, and maps each finding to the EU frameworks GDPR, NIS2 and CRA. It is a defensive tool: it detects and reports, it does not attack. Use it only on sites you own or manage.

Made by CortexRouter, a free and open-source project that also runs the hosted services at [secaudit.eu](https://secaudit.eu/). All of them are free for now. The vulnerability database, malware signatures, virtual patches and the public verification page are free, with no account and no API key.

= What it does =

* **Malware scan** - webshell and obfuscation patterns, SHA-256 hash matching and optional ClamAV; hidden hacklinks and SEO/pharma spam.
* **File integrity** - baseline hashing finds added, changed or deleted files and explains each change (who, when, which lines); WordPress core and WordPress.org plugins are compared against the official files.
* **Vulnerabilities** - known CVEs matched on your own site from the free signed database (your plugin list is never sent), outdated or end-of-life plugins, themes, WordPress and PHP, plus taint analysis for SQLi, XSS, LFI/RFI and CSRF.
* **Firewall & virtual patching** - blocks attacks on a known vulnerability in one of your plugins or themes until you can update; off by default.
* **Hardening & access** - two-factor authentication (TOTP or e-mail), weak-password audit, login protection, security headers and configuration checks.
* **Compliance reporting** - an on-screen summary mapping findings to NIS2, OWASP Top 10 and GDPR. This is a technical view of your site, not a legal assessment.

Everything above runs on your site and is free. Optional paid secaudit.eu services (signed report documents, off-site scanning, AI explanations, downtime alerts, the agency panel) are described under External services; during early access they are free for every site.

See the full feature list at [secaudit.eu](https://secaudit.eu/).


== Installation ==

1. In WordPress, open Plugins → Add New, search for "CortexRouter" and press **Install Now** (or upload the ZIP there).
2. Activate the plugin through the Plugins menu in WordPress.
3. Open **CortexRouter** in the admin menu and click **Start the first full scan**.
4. Optional: click **Turn on vulnerability checks** on the dashboard, and open **CortexRouter → Settings** to turn on daily signature updates.

== Frequently Asked Questions ==

= How do I reach the secaudit.eu panel and the verification page? =
The optional hosted services of this plugin (signed reports, off-site scanning, AI assistance, downtime alerts, the agency panel and the public verification page) run on [secaudit.eu](https://secaudit.eu/), which the CortexRouter project, the maker of this plugin, runs. They are free for now. Everything that uses them is marked "secaudit.eu" in the plugin.

* **Panel:** sign in at [app.secaudit.eu](https://app.secaudit.eu/), create a link code there and enter it under **CortexRouter → Settings → Agency panel (secaudit.eu)**. The panel then shows all linked sites.
* **Verification page:** switch it on under **CortexRouter → Compliance & Reports → Public verification page (secaudit.eu)**. The page is at `https://secaudit.eu/verify/<your domain>`, and the trust badge on your site links to it.
* **Signed reports:** every PDF or CSV carries a report code; anyone can check it on secaudit.eu.

= I changed the login address and lost it. How do I log in? =
Add `define( 'WPSA_DISABLE_LOGIN_URL', true );` to wp-config.php; the login page is wp-login.php again. With WP-CLI: `wp secaudit login-url off`. The address was also emailed to the site administrator when you set it.

= A protection locked me out. How do I get back in? =
Add `define( 'WPSA_SAFE_MODE', true );` to wp-config.php. It pauses everything that can block a visitor or an administrator (firewall, virtual patches, country blocking, shared attacker list, robot check, custom login address, login lockouts, two-step login, the lock on plugin changes, security headers) until you remove the line; every admin page shows a warning while it is on. With WP-CLI you can turn off one protection instead: `wp secaudit disable firewall` (or `countries`, `shared-list`, `robot-check`, `login-url`, `plugin-lock`, `all`), and `wp secaudit twofa-off USER` after a lost phone.

= Does it work on a multisite network? =
Yes. Activate it for the whole network (Network Admin → Plugins → Network Activate, WordPress 6.1 or newer). The network is then managed from the main site: its settings and protections apply to every site, files are scanned once, and the database scans check every site (up to 200) and name the site in each finding. Only network administrators see the panel, because repairs and quarantine change files of the whole network. The custom login address works on every site of the network, after each site's own address. Network Admin → CortexRouter lists the sites. If you activate it on single sites instead, each site keeps its own settings, but the panel is still for network administrators only.

= Does this plugin attack other sites? =
No. It is a defensive tool: it checks the site it is installed on and never sends requests to attack or test other sites. Use it only on sites you own or manage.

= Does it stop DDoS attacks? =
No. No WordPress plugin can stop a real (volumetric) DDoS, because the traffic is handled before PHP runs. The abuse & rate-limiting features reduce application-layer abuse; for real DDoS protection use a CDN/edge firewall such as Cloudflare.

= Do I need an API key? =
No. Everything that runs on your site is free. Version/update checks use the free WordPress.org data. Known vulnerabilities come from the free secaudit.eu vulnerability database, which is built every night from the official CVE List (CVE Program). Malware signature updates come from the free, signed secaudit.eu feed.

= Does the vulnerability check send my plugin list anywhere? =

No. The database is split into 256 parts by a fingerprint (hash) of each plugin's name. Your site downloads only the signed parts that cover its own plugins and themes and compares versions on your server. Each part covers hundreds of plugins, so the download does not reveal which plugins you use. The check is off until you turn it on.

= Will it slow down my site? =
Scans run on demand or on a schedule and are split into time-budgeted batches so large sites do not time out. The badge and runtime protections are lightweight.

= Is the trust badge honest? =
Yes. It shows your real score and last scan date, drops its tier or hides entirely if the score falls or the scan is stale, and never claims "guaranteed secure." It uses no official EU emblem or CE mark.

= I lost the phone with my authenticator app. How do I log in? =
Use one of the backup codes you saved when you turned on two-factor authentication; each works once. If you have none left, another administrator can turn two-factor authentication off on your profile page (Users → your user). With WP-CLI: `wp user meta delete <user> wpsa_2fa_enabled`.

= What is removed when I delete the plugin? =
Deactivating keeps everything. Deleting the plugin removes all its data: settings, scan results, the security event log and users' two-factor keys. If you need the security log for your records, take a database backup before deleting.

== Screenshots ==

1. Security Dashboard: the security score, the next step to take, open findings by severity, blocked attacks, changed files and the trust seal.
2. Scans: every open finding in one to-do list, most serious first, each with its OWASP Top 10 category and its own actions.
3. File changes explained: who changed a file, when and which lines, shown line by line, with quarantine or "This change is mine" one press away.
4. Compliance & Reports: NIS2 Art. 21, OWASP Top 10:2025 and GDPR Art. 32 summaries with the record of the latest signed report.
5. Protection: failed logins and locked IP addresses in the last 24 hours, and the state of the login limit, two-factor authentication, REST API limit, virtual patches and firewall.
6. Trust badge and public verification page: badge style and placement with a live preview of the "Security & Compliance Check" plaque, and the opt-in verification page on secaudit.eu.
7. Hacked Site Cleanup: the recovery steps in order, here an unknown PHP file in uploads to move to quarantine and the administrator accounts to check.

== External services ==

The plugin works locally. It contacts the services below only for the feature named, and only after you start a scan, press a button or switch that feature on. Every secaudit.eu service is provided by CortexRouter, a free and open-source project: [terms](https://secaudit.eu/terms/), [privacy policy](https://secaudit.eu/privacy/). Requests carry a generic user agent without your site address; like any web server, the service sees the IP address of your server. Downloads from secaudit.eu are data, never code, and are checked against an Ed25519 public key built into the plugin before use. Where a service needs to know that a request really comes from your domain, secaudit.eu calls back a REST endpoint on your site once with a one-time token ("domain check" below).

= WordPress.org API and files (api.wordpress.org, downloads.wordpress.org) =
Used when you run a scan (or a scheduled scan you enabled), or the **Plugin files** check: update and security status and the official checksums of WordPress and of your installed plugins. Sent: the slugs and versions of your installed plugins and themes and your WordPress version. Provided by WordPress.org: [privacy policy](https://wordpress.org/about/privacy/).

= secaudit.eu vulnerability database (opt-in) =
Only if you turn on vulnerability checks. During scans (at most twice a day) the plugin downloads a signed index from `https://secaudit.eu/vulndb/` and only the parts that cover your own plugins and themes; versions are compared on your server. Virtual patching uses the same downloaded data. Sent: nothing; the names of your plugins and themes are never sent. Data: CVE List of the CVE Program (© The MITRE Corporation).

= secaudit.eu signature feed =
Downloads malware signatures from `https://secaudit.eu/feed/signatures.json` when you press **Update Signatures**, and once a day only if you turn on automatic updates. Sent: nothing. With a Pro license the plugin first asks `https://secaudit.eu/api/feed/signatures.json`, sending the license key and your site address (domain and WordPress path) to check the plan.

= secaudit.eu firewall rules (only while the firewall is on) =
The firewall is off by default. While it is on, the plugin downloads extra rules from `https://secaudit.eu/feed/firewall.json` once a day and when you press **Update rules now**. Sent: nothing. With a Pro license the plugin first asks `https://secaudit.eu/api/feed/firewall.json`, sending the license key and your site address to check the plan.

= secaudit.eu country table (opt-in) =
Only if you turn on country blocking. The plugin downloads a signed country table from `https://secaudit.eu/geo/` at most once a day and stores it in `wp-content/uploads/wpsa-geo/`. Visitor addresses are looked up on your site and never sent. Sent: nothing. Data: "IP to Country Lite" by DB-IP (https://db-ip.com), CC BY 4.0.

= secaudit.eu shared attacker list (opt-in) =
Only if you join the shared list (Protection → Shared attacker list). Joining sends your domain, WordPress path and plugin version to `https://secaudit.eu/api/shared/` (with a domain check). Once an hour the plugin then sends the IP addresses of attacks it blocked, with the kind of attack and the time, and downloads the signed list. No page addresses, request contents, user names or data of other visitors are sent. Reports are deleted after seven days; leaving deletes the site and its reports. WordPress shows suggested text for your own privacy policy under Settings → Privacy.

= Have I Been Pwned: Pwned Passwords (api.pwnedpasswords.com) (opt-in) =
Only if you turn on the breached password check (Identity & Access). When someone sets or resets a password, the plugin sends the first 5 characters of the password's SHA-1 fingerprint to `https://api.pwnedpasswords.com/range/` and compares the answer on your server. The password and its full fingerprint never leave your site. Provided by Have I Been Pwned: [terms of use](https://haveibeenpwned.com/TermsOfUse), [privacy policy](https://haveibeenpwned.com/Privacy).

= secaudit.eu public verification page (opt-in) =
Only if you switch on the public listing. Sent to `https://secaudit.eu/api/report` after each scan and once a day while the listing is on: your domain, the trust score, the scan date, pass/fail results for malware, core files and spam links, and the optional business details you enter (with a domain check). Detailed findings never leave your site. Turning the listing off removes the page.

= secaudit.eu report documents (only when an administrator asks for one) =
Only when an administrator presses **Download signed report (PDF)** or **(CSV)**, or runs `wp secaudit report`. The site sends the report's content to `https://secaudit.eu/api/reports/render` to be laid out and signed (with a domain check): the site address, the WordPress, PHP and plugin versions, the score, for each finding its title, severity and the affected plugin, theme, component or file path, and the status of each GDPR, NIS2 and OWASP measure. Not sent: passwords, file contents or visitor data; user names are shortened (ad***). secaudit.eu deletes the content after making the file and keeps, for 3 years, a record so the report code can be checked later: code, site address, type, date and a SHA-256 fingerprint of the file. Free for every site during early access, afterwards part of secaudit.eu Pro.

= secaudit.eu AI assistance (opt-in) =
Only if you turn on AI assistance (Settings → AI assistance), and then only when an administrator presses **Explain**, **Second opinion**, an incident-notification button or **Ask the AI for advice**, or runs `wp secaudit ai explain`. Turning it on sends your domain, WordPress path and plugin version to `https://secaudit.eu/api/ai/` (with a domain check). Each request sends, with the dashboard language: for **Explain**, the type, level, category, text and location of that one finding, with user names replaced by `[user]` and e-mail addresses by `[email]`; for **Second opinion**, in addition at most 8 KB of the reported file around the reported line, after passwords, keys, tokens and similar secrets are removed (you see this excerpt before each request; `wp-config.php`, `.env` files, database dumps, logs, backups and key files are never sent); for the incident notification, the number and types of findings and the clean-up steps marked as done; for server advice, the server health measurements of the last 7 days as numbers. secaudit.eu passes the request to an AI model (Claude by Anthropic, or OpenAI if Claude cannot be reached) and does not keep the file excerpt after delivering the answer: [Anthropic privacy policy](https://www.anthropic.com/legal/privacy), [OpenAI privacy policy](https://openai.com/policies/privacy-policy/). Answers are advice only and are kept on your site for 30 days. Turning it off deletes the site on secaudit.eu.

= Your chat service: Slack, Discord, Google Chat or a webhook you choose (opt-in) =
Only if you enter an incoming webhook address (Settings → Alerts in Slack, Discord or another chat). For important security events the plugin then sends a short message to that address: the site name and address, the kind of event, the event text (it can contain a user name, never an IP address) and a link to the event log; at most 30 messages an hour. Nothing goes to secaudit.eu. The terms and privacy policy of the service you chose apply: Slack ([terms](https://slack.com/terms-of-service), [privacy](https://slack.com/privacy-policy)), Discord ([terms](https://discord.com/terms), [privacy](https://discord.com/privacy)), Google Chat ([terms](https://policies.google.com/terms), [privacy](https://policies.google.com/privacy)).

= secaudit.eu downtime and certificate alerts (opt-in) =
Only if you turn on the alerts (Protection → Downtime and certificate alerts). Turning them on sends your domain, WordPress path, plugin version, the alert e-mail address and the dashboard language to `https://secaudit.eu/api/monitor/` (with a domain check); alerts start after you open the confirmation link sent to that address. secaudit.eu then opens your home page every 5 minutes, reads its certificate once a day and e-mails you when the site is down, back, or the certificate is about to expire. Turning the alerts off deletes the site and the address on secaudit.eu.

= secaudit.eu off-site scanning (opt-in) =
Only if you turn on off-site scanning (Scans → Off-site scanning), and then only during malware scans. Turning it on sends your domain, WordPress path and plugin version to `https://secaudit.eu/api/offsite/` (with a domain check). During a scan the plugin sends the SHA-256 fingerprints of the code files it cannot check on its own (in plugins, themes and uploads); only files secaudit.eu has not seen before are then sent, compressed, without file names or paths. Never sent: wp-config.php, must-use plugins and other files directly in wp-content, database dumps, logs, backups, key files, images without code and files larger than 1 MB. secaudit.eu scans the content in memory and keeps only fingerprint and result, not linked to your site. Files may contain personal data in rare cases. Turning it off deletes the site on secaudit.eu.

= secaudit.eu agency panel and affiliate programme (opt-in) =
Only if you link the site to an agency panel account (Settings → Agency panel) with the one-time code shown in that account. Linking sends your domain, WordPress path, plugin version and the code to `https://secaudit.eu/api/agency/` (with a domain check). After each scan and once a day the plugin sends a summary: the score, the number of findings per level, the time of the last scan, the number of waiting updates, the WordPress, PHP and plugin versions, whether the site uses HTTPS, the share of administrators with two-step login, and for each finding of the latest scan its level, kind, short title and the plugin, theme or component it concerns. No file paths, user names, content, passwords, keys or visitor data are sent. Unlinking deletes the site's data on secaudit.eu. For a linked site, opening the **Affiliate programme** card asks `https://secaudit.eu/api/agency/affiliate` for your referral link and figures (sent: the site key of the link, nothing else). If you place a banner from that card, its image is downloaded once from `https://secaudit.eu/assets/affiliate/` and stored in `wp-content/uploads/secaudit-banners/`; visitors load it from your site, and no visitor data is sent anywhere. Banners appear only where you place the shortcode, block or widget, link to your referral link with `rel="sponsored"` and carry an "Advertisement" label by default.

= secaudit.eu Pro license (only if you enter a key) =
Only if you enter a secaudit.eu Pro license key (Settings → secaudit.eu Pro). Activating sends the key, your domain, WordPress path and plugin version to `https://secaudit.eu/api/license/` (with a domain check); once a day the plugin sends the key, domain and path to learn whether the license is still active. Removing the license frees the seat. No site content, user data or visitor data is sent; payments are handled at the checkout on secaudit.eu, never by the plugin. If you also turn on **Urgent vulnerability alerts** on the license card, the plugin sends the slugs and versions of your installed plugins and themes and the WordPress and PHP versions with the daily check, and secaudit.eu e-mails the license owner when a serious vulnerability affects one of them; turning the option off deletes that list. Without this option the names of your plugins and themes are never sent.



= DNS lookups for the fake crawler block and the page probing lock (opt-in) =
Only if you turn on "Block fake search engine crawlers", the page probing lock or the request limit, and only for requests that claim to be a search engine crawler. The plugin asks your server's own DNS resolver for the name of the visitor's address and then for the addresses of that name, as the search engines describe for verifying their crawlers. No other service is contacted.

== Changelog ==

= 0.31.5 =
* First release in the WordPress.org plugin directory.

== Upgrade Notice ==

= 0.31.5 =
First release in the WordPress.org plugin directory.
