Overview
Gratis Security (version 2.0.0, requires WordPress 6.4+ and PHP 8.1+) is a seven-tab WordPress hardening, monitoring, and firewall suite under Settings → Gratis Security. Operational logs, baselines, threat signatures, IP rules, and quarantined files are stored as JSON and JSONL files inside wp-content/uploads/gratis-security/ (protected with .htaccess deny rules and an index.php guard) and parsed with the simdjson extension when available, keeping MySQL free of log-table overhead. Only plugin settings (gratis_security_settings), login lockout transients, the FIM alert transient, 2FA login nonces, and per-user 2FA meta live in the WordPress database.
Admin UI language note: The admin tab labels and dashboard copy currently render in Lithuanian, while option keys, audit check labels, server diagnostics, and WP-CLI commands are in English. Both the Lithuanian tab names and their English meanings are listed below.
Opening the dashboard
- In the WordPress admin sidebar, hover Settings and click Gratis Security (
/wp-admin/options-general.php?page=gratis-security). - Until you run the 1-click setup wizard, the plugin opens on Vedlys ir apžvalga (
&tab=wizard). Once completed, it opens on Failų stebėjimas (FIM) (&tab=fim). - Switch between the seven tabs via the top navigation bar (
wizard,fim,malware,requests,feeds,server,general; legacy&tab=blocksredirects torequests).

Setup Wizard & Security Audit (wizard)
The Vedlys ir apžvalga tab scores your site from 0 to 100 (Grades A–F) across 14 weighted checks and inspects PHP capabilities (simdjson, inotify, openssl, curl, posix, fileinfo, ClamAV availability, writable storage, and DISABLE_WP_CRON):
- 14 Posture Checks: PHP runtime version (8.2+ pass, 8.1 warn),
DISALLOW_FILE_EDIT/DISALLOW_FILE_MODS, suppressedWP_DEBUG_DISPLAYanddisplay_errors, hardened storage directory, HTTP security headers, XML-RPC blocking, login brute-force protection, WAF mode, FIM status, signature feed freshness (within 7 days), last malware scan status, TOTP 2FA enforcement,wp-config.phppermissions (0640/0600), and absence ofadminorrootadministrator usernames. - 1-Click PHP Auto-Configuration (no SSH): Creates hardened storage and
fim-events.jsonl, applies safe PHP defaults (choosingmonitororblockWAF mode), syncs built-in signatures and WordPress.org Core checksums, schedules all four WP-Cron jobs, purges manifest-verified false-positive FIM detections, and runs initial FIM and malware scans. - Optional OS-Level Hardening (Step 4): Collapsible commands for Linux
auditdsyscall rules, a systemdgratis-fim.service(inotifywait) unit,/etc/cron.d/gratis-security, and AIDE, selectable for either the PHP runtime user orroot.
File Integrity Monitoring (fim)
The Failų stebėjimas (FIM) tab runs in Server-Assisted mode when SOURCE-MANIFEST.sha256 (and optionally COMPOSER-MANIFEST.sha256) is present at the project root, or Autonomous PHP mode on standard hosting.

- Core & WordPress.org Plugin Checksums: Verifies core files against official MD5 checksums from
api.wordpress.organd WordPress.org plugins againstdownloads.wordpress.org. - Local SHA-256 Baseline: Hashes
.php,.js,.css,.json,.yml,.yaml, and.htaccessfiles inmu-plugins,plugins, themes,packages/plugins, andconfigintofim-baseline.json. Auto-builds on the first scan if missing; click Atnaujinti bazinę liniją (Baseline) after deliberate updates. - Uploads Executable Guard: Flags rogue
.php,.phtml,.phar,.cgi,.pl,.py, and double-extension.php.files insidewp-content/uploads/. - Diff Viewer & Filters: Filter results by path, component (
core,mu-plugins,plugins,themes,vendor,config), or status (modified,missing,untracked). The Diff / Krizė modal compares against local Git, WordPress Core SVN, WordPress.org Plugin SVN, or shows file metadata, SHA-256, and suspicious pattern hits. - Scheduling & Alerts: Scheduled hourly by the setup wizard (
gratis_security_fim_cron_scan) and sends admin email alerts whennotify_email_on_fimis enabled (default on).
Malware Scanner & Quarantine (malware)
The Kenkėjiškas kodas tab scans wp-content across php, phtml, phar, pht, php5, php7, inc, js, htaccess, shtml, cgi, and sh files up to 1.5 MB each.

- Quick vs. Deep Scan: Quick Scan (Greita patikra) skips files verified by
SOURCE-MANIFEST.sha256or the SHA-256 whitelist; Deep Scan (Gili patikra) inspects every matching file. - Detection Layers: Uploads executable policy, known bad SHA-256 hashes, 43 built-in malware regex rules (obfuscated
eval/assert/create_function, webshells such as FilesMan/WSO/c99/r57/b374k/IndoXploit/Alfa-Team/mini_shell/LeafMailer, GIF/PNG/JPEG polyglots,.htaccessbackdoors, remote includes, JS droppers/skimmers, and hidden admin creation), plus optional local ClamAV (clamdscan/clamscan). - Quarantine Vault & SHA-256 Whitelist: Moves suspicious files into
uploads/gratis-security/quarantine/*.quarantine(chmod 0600) with Restore and Delete actions, or exempts verified files by SHA-256 (auto-invalidates if the file changes). - Daily Cron & Alerts: Runs daily via
gratis_security_malware_cron_scan(default on) and emails the site admin on critical/high findings whennotify_email_on_malwareis enabled (default on).
Web Application Firewall & IP Rules (requests)
The Užklausos ir WAF tab inspects incoming requests at init priority -9999 and tracks 404 probe floods on template_redirect. WP-CLI, wp-admin, WP-Cron, autosaves, and logged-in users with edit_posts are exempted to prevent Gutenberg or page-builder false positives.

- WAF Modes (
waf_mode):monitor(default, logs matches without blocking visitors),block(returns HTTP403and logs), oroff. - 29 Built-In Request Rules: Detects SQLi, XSS, path traversal / LFI (
php://filter,/etc/passwd,/proc/self/environ), RCE, serialized PHP object injection, sensitive file probes (wp-config.php,.env,.git,phpMyAdmin,Adminer,phpinfo.php), and scanner user-agents (sqlmap,nikto,nuclei,wpscan, etc.). - Block XML-RPC (
block_xmlrpc): Enabled by default; rejects/xmlrpc.phpwith HTTP403unless disabled. - 404 Probe Flood & Auto-Ban: Tracks 404 hits on probe paths (
.php,.env,.sql,.bak,.zip,.tar,wp-login,admin,config,.git); 20 hits in 60 seconds triggers a404_floodevent. Whenauto_ban_enabledis on (default), IPs exceedingauto_ban_threshold(default5) high/critical strikes in 15 minutes are temporarily banned forauto_ban_minutes(default60). - IP Allowlist, Blocklist & Log: Supports IPv4, IPv6, and CIDR rules. Allowlist entries override blocklists, auto-bans, and WAF rules. Stores up to 2,000 events in
malicious-requests.jsonland firesgratis_security_malicious_requestandgratis_security_blockedactions.
Threat Intelligence & Signature Feeds (feeds)
The Parašų atnaujinimai tab merges the built-in signature bundle (version 2026.11.23: 43 malware rules, 29 request rules, 3 bad SHA-256 hashes) with official WordPress.org Core checksums and optional external HTTPS feeds into signatures.json and ip-feed-blocklist.json.

- Custom JSON Signature Feed URL: Optional
https://endpoint returningmalware_rules,request_rules,bad_hashes, andblocked_ips, authenticated via optional Bearer /X-API-Keytoken. Remote regexes undergo ReDoS safety validation before merging. - External IP Blocklist URL: Optional
https://newline-delimited IPv4/IPv6/CIDR feed (up to 10,000 entries). - Daily Sync: Runs automatically via WP-Cron (
signature_auto_update, default on) alongside WordPress.org Core checksum caching (sync_wp_checksums, default on).
Server Diagnostics & Event Log Trail (server)
The Serveris ir žurnalai tab inspects the host environment (OS, architecture, init system, PHP user:group, SELinux mode, running inotifywait processes, and installed security binaries) and provides two paginated audit views.

- Stored Detections (
fim-detections.jsonl): Up to 2,000 persistent filesystem incident records withopen,acknowledged, andresolvedworkflow statuses, bulk acknowledge, manifest-verified false-positive purge, and resolved cleanup. - Live Event Log Trail: Tails
fim-events.jsonland/var/log/audit/audit.logincrementally by inode/offset every 5 minutes via WP-Cron (gratis_security_fim_trail_cron) or on demand, with a 10-second auto-refresh toggle.
General Settings, Headers, Login Protection & 2FA (general)
The Nustatymai tab exposes all core toggles and thresholds in one form.

Security Response Headers
Strips X-Powered-By on all WordPress responses (frontend and admin). When Saugumo antraštės (headers_enabled, default on) is enabled, frontend responses emit X-Frame-Options: SAMEORIGIN, X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, X-XSS-Protection: 1; mode=block, Permissions-Policy: geolocation=(), microphone=(), camera=(), an optional Content-Security-Policy (blank by default), and Strict-Transport-Security: max-age=31536000; includeSubDomains when HTTPS is active. Filterable via gratis_security_headers.
Login Brute-Force Protection
Enabled by default (login_protection). Tracks failed attempts per IP (REMOTE_ADDR) in transients (default 5 attempts, 15-minute lockout), clears the counter on successful login, and records login_failed / login_lockout events in malicious-requests.jsonl.
Two-Factor Authentication (TOTP)
Disabled by default (twofa_enabled = 0). Once enabled, administrators (manage_options) can self-enroll or disable TOTP from Users → Profile using any standard authenticator app (Google Authenticator, Aegis, 1Password), or provision secrets via WP-CLI. Enforcement interrupts interactive wp-login.php logins only for administrators who have a confirmed secret (admins without a secret are never locked out; XML-RPC, REST API, and Application Passwords are excluded).

WP-CLI Reference
# Setup wizard diagnostics and 1-click PHP auto-configuration
wp gratis-security wizard [--auto] [--waf-mode=monitor|block] [--no-scans] [--user=php|root] [--format=table|json]
wp gratis-security audit [--format=table|json]
# File integrity monitoring and live event trailing
wp gratis-security fim status|scan|baseline|instructions|wizard|trail|detections|logs|purge-verified
wp gratis-security fim diff wp-content/plugins/example/file.php
# Malware scanning and quarantine management
wp gratis-security scan [--dir=<path>] [--deep] [--clamav] [--format=table|json]
wp gratis-security quarantine list|add <path>|restore <id>|delete <id>
# WAF logs, IP allow/block rules, and auto-bans
wp gratis-security requests list|clear|bans [--category=<cat>] [--severity=<sev>] [--action=blocked|logged] [--since=1h|24h|7d|all]
wp gratis-security requests block-ip|unblock-ip|allow-ip|unban <ip-or-cidr> [--note="reason"]
wp gratis-security blocks
# Threat signature feeds and TOTP 2FA management
wp gratis-security signatures status|update
wp gratis-security 2fa set|reset|disable <user-id-or-login>
Recommended Starting Point
- Open Settings → Gratis Security and run Automatiškai sukonfigūruoti viską per PHP on the Wizard tab (keep
monitormode first if you want to review traffic before blocking). - Inspect Užklausos ir WAF for false positives, then switch
waf_modetoblockunder Nustatymai (or runwp gratis-security wizard --auto --waf-mode=block). - Have each administrator enroll TOTP on Users → Profile, then enable
twofa_enabled. - Set a
Content-Security-Policyonly after testing it against your active theme and plugins. - On Linux VPS/dedicated servers, optionally apply the
auditdandgratis-fim.servicecommands from Step 4 of the Wizard for real-time kernel-level file monitoring.