=== HostShield Security ===
Contributors: hostshield
Tags: security, malware, firewall, scanner, wordpress
Requires at least: 5.5
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.6.4
License: GPLv2 or later

حماية ووردبريس: فحص النواة بالبصمات الرسمية، كشف المالوير، حماية الرفع.
النسخة المجانية: فحص فقط. Pro: فحص دوري + حجز + استبدال بالمصدر الرسمي.

== Description ==

HostShield Security — Arabic-first WordPress protection.

**Free (scan-only)**
* Core integrity vs wordpress.org checksums
* Malware heuristics on PHP files
* Report only — never cleans, quarantines, or deletes

**Pro**
* Scheduled scans (twice daily)
* Quarantine = MOVE to vault (never delete)
* **Restore original** from wordpress.org instead of scrubbing code
* Scans every uploaded file; quarantines hits
* Admin email alerts

== Safety ==

* Free edition never mutates files
* Pro quarantine moves — it does not delete the only copy
* Restore replaces with hash-verified official bytes
* Vault delete removes the vault copy only

== Installation ==

1. Upload `hostshield/` to `/wp-content/plugins/`
2. Activate
3. Open HostShield in the admin menu
4. Run a scan. For Pro, set licence key in Settings.

== Changelog ==

= 1.6.4 =
* Signatures v5: fewer false positives (array_filter on request data, shell names inside encoded data), measured on 100,000 files from the most popular plugins, themes and libraries.

= 1.6.3 =
* Signatures v4: 739 known public web shells recognised by their exact SHA-256.

= 1.6.2 =
* Package cleanup: removed a server-side Python file that WordPress never runs.

= 1.6.1 =
* Malware scan now covers every PHP extension a server can execute (.pht, .php3-8, .phar, .phps), not only .php/.phtml/.inc.

= 1.5.0 =
* Known vulnerabilities: every plugin, theme and WordPress core version is checked daily (and after each update) against the Wordfence Intelligence database through HostShield; severity, the fixing version and WordPress's own "Update now" button are shown, with a wp-admin warning for high/critical issues. Only names and versions are sent. Free and Pro.
* Temporary protection (opt-in, per plugin) for a plugin with a known vulnerability until it is updated: visitors cannot reach its AJAX actions, REST routes or PHP files; logged-in non-admins are allowed but attack payloads are refused; administrators are never affected; lifts itself after the update.
* Theme integrity: wordpress.org themes are verified against their official package (default themes against the WordPress release). A planted PHP file is reported as high risk; a changed file only as critical when it contains malicious code, otherwise as a low-severity "differs from the original".
* Known-malware hashes: files confirmed malicious by HostShield are recognised by their exact hash — conclusive, no false positives.

= 1.4.0 =
Safety release — nothing HostShield does may break a working site.
* Firewall: shop carts, checkouts, contact forms and payment callbacks (WooCommerce wc-ajax / wc-api) are no longer rate-limited or blocked; the limit now covers login, XML-RPC and comments only (many visitors share one mobile-carrier IP).
* Firewall: SEO crawlers (Ahrefs, Semrush…) are allowed unless the owner opts in to blocking them.
* Uploads: only executable/server-config types are refused; iPhone photos (.heic), .tif, .m4a, .epub and other types WordPress accepts are no longer blocked.
* .htaccess hardening: removed a directive Apache forbids in .htaccess (it caused HTTP 500); the change is now tested and rolled back automatically if the site stops answering.
* Core integrity: bundled default themes/plugins under wp-content are no longer "restored" (that overwrote theme edits and re-added deleted themes); files commonly deleted for hardening (readme.html, license.txt…) are not reported as missing.
* Auto-patch: a custom or premium plugin whose folder name matches a wordpress.org slug is never replaced with the other plugin.

= 1.3.1 =
* Optional "help improve detection": with consent, quarantined files (<512KB) are sent to HostShield for review; confirmed samples become a signature that protects every customer. Off by default.

= 1.3.0 =
* Plugin integrity: every wordpress.org plugin is verified against its official per-file checksums. Catches code injected into legitimate plugins, and backdoors planted inside plugin folders, with near-zero false positives. Premium/custom plugins are skipped, not flagged. New "إضافات مصابة" panel and weekly-report counter.

= 1.2.0 =
* Central malware signatures: daily signed updates from HostShield (free and Pro), verified before use; "Update now" button.
* Weekly Arabic protection report by email; licensed sites also feed the customer's consolidated report (email + WhatsApp).
* Free 14-day Pro trial link in Settings.
* WAF picks up new scanners from central releases; generic HTTP clients (curl/wget, monitors, webhooks) always allowed.

= 1.1.0 =
* Security: login brute-force lockout now counts failures correctly (5 per IP / 15 min, 20 per username).
* Security: math CAPTCHA is stateless and only checks the form submission (no longer blocks the login page).
* Security: quarantine vault and logs are always protected from web access.
* Security: admin actions require manage_options; quarantine limited to files inside the site.
* Licensing: activate with the licence key only; renewals apply automatically; the "enable Pro manually" option was removed.
* Licensing: pasted licence JSON is unslashed before parsing (installing a licence file works again).
* WAF: no database write per page view; rate limit applies to login, XML-RPC and anonymous POSTs; wget cron and REST webhooks are no longer blocked; Cloudflare visitor IPs supported.
* Safety: core-file restore and plugin auto-patch verify the replacement before touching the live copy, with rollback.
* Scheduled scans start as soon as Pro becomes active.

= 1.0.1 =
* Fix activation paths and regex delimiters
* Skip self-files in scanner
* Phone/WhatsApp contacts in admin

= 1.0.0 =
* Initial release: free scan + Pro quarantine/restore/upload scan
