WordPress Security Plugin: Safe, Free Shield, Build Log 006

Bot spam with .top links and open user enumeration led to one small, defensive WordPress security plugin. Build Log 006 covers its architecture, the safe change process and the lesson that cache layers bypass PHP.

Paper courtyard with a brass gate, a honey jar, an hourglass, a teal ledger and envelopes on a navy desk.

Darja Rihla Shield is a small, defensive WordPress security plugin, built after a wave of bot spam and user enumeration on this site. This build log shows how it works and what live verification revealed about cache layers.

December 2026, Cybersecurity, WordPress, Published plugin, open source on GitHub

BUILD, VERIFY, PROVE, PUBLISH

Why we built a WordPress security plugin

The contact forms on darjarihla.com started to fill with entries nobody had written. The WordPress Security Quick Check, the Dutch lessons sign-up and the security contact form all received the same kind of traffic.

The pattern was consistent enough to describe:

  • links to .top domains, sent from throwaway addresses made of a short random name and digits, such as luh4821, at disposable mail domains like pokamail, postlane, letterio and kenzomail
  • Russian SEO spam pointing to the same family of domains
  • polite, human written SEO sales mails offering rankings and backlinks

At the same time, the site was open to user enumeration. A request to the public REST users endpoint or a simple ?author=1 was enough to learn login names. Spam is noise. Enumeration is reconnaissance. The wider background is in Why WordPress sites get hacked.

The starting question

How do you stop cheap bots and close reconnaissance paths on a small WordPress site, without stacking yet another large security plugin and without breaking anything?

Envelopes pinned with tiny brass spinning tops pour through a mail slot while a beam scans blank nameplates.
Form spam with .top links and throwaway mail, and probes that try to read login names.

The decision: one defensive layer, not another plugin stack

The site already ran a security plugin with login protection, two form plugins, a cache plugin, a consent plugin and a backup plugin. Fluent Forms’ own honeypot was already on, and its token based spam protection was switched on as a first step.

Adding another all-in-one security suite would have meant more overlapping features, more settings that fight each other and more code that nobody on the site fully understands. The alternative was a single, small WordPress security plugin with a clear scope:

  • only defensive measures
  • every module can be switched off on its own
  • no edits to theme files, functions.php or .htaccess, because all behaviour lives in the plugin folder
  • logs that respect the GDPR, with a fixed 30 day retention

The earlier site plugin, Darja Rihla Security, already covered user names, headers and admin hardening. Everything was consolidated into one plugin with a new name: Darja Rihla Shield.

Architecture

Darja Rihla Shield is a modular WordPress security plugin with a registry, one settings page and one log.

A cream and brass cabinet with five open drawers, each holding one security module in miniature.
Five modules, each in its own drawer: hide user names, login protection, security headers, admin hardening and bot defense.

Hide user names

Logged-out visitors get a 401 on the REST users endpoint. ?author= requests and author archives are redirected to the home page before WordPress can leak the slug. The user sitemap and oEmbed author data are removed.

Login protection

Off by default on this site. The existing security plugin already limits logins, and two lockout systems at once can be stricter than intended. The module detects that overlap and explains it instead of silently doubling up.

Security headers

X-Content-Type-Options, X-Frame-Options, Referrer-Policy and a minimal Permissions-Policy. HSTS is optional. There is deliberately no Content Security Policy, because a strict CSP easily breaks ad, consent and analytics scripts.

Admin hardening

No file editor in the dashboard, the WordPress version hidden on core assets, and XML-RPC disabled.

Bot defense

The new module, built for this problem:

  • Honeypot: a hidden field that people never see and bots happily fill in.
  • Minimum fill time and token: a signed timestamp in every Fluent Forms and WPForms form. A submission that arrives within three seconds, or without a valid token, is rejected.
  • Domain blocklist: links to .top domains and a list of known disposable mail domains, editable in the settings.
  • Decoys: a decoy user name, a fake login path and a hidden link that only crawlers follow. Each answers with a plain 404 and is logged. The paths are also listed as Disallow in robots.txt, so well behaved crawlers stay away and only bots that ignore the rules walk into them.
  • Enumeration logging: author probes and REST users requests are recorded.
  • Optional IP blocking: a temporary, site wide block, off by default.
  • A 30 day log: time, IP, event type, path and user agent, purged automatically.
  • Optional AbuseIPDB reporting: off by default and only with an API key.

Rejected visitors see one calm message: the form could not be sent, please check your details and try again. No technical detail is revealed to a bot.

A safe change process

The rule for this site is simple: nothing may break. Build Log 005, the PHP2Shell decision guide, applies the same defensive thinking to a security advisory. Every change followed the same routine:

  1. A backup of the existing plugin on an external drive before anything changes.
  2. php -l on every PHP file.
  3. A diff between the old and the new version, reviewed before upload.
  4. Never touch functions.php. All behaviour lives in a plugin that can be switched off.
  5. An emergency stop that works without WordPress: rename the plugin folder to darja-rihla-shield.off over SFTP and the site falls back to normal.

The plugin was installed through the WordPress admin, and the old plugin was deactivated and removed after the new settings were confirmed. The cache was cleared as well. As the check below shows, clearing it did not mean that every cached copy was gone.

Live verification

After installation, the live site was checked from the outside with plain HTTP requests:

CheckResult
REST users endpoint, logged out401
?author=1301 to the home page
Fake login path and hidden decoy link404, and logged
XML-RPC403
robots.txtboth Disallow rules present
Security headerspresent on login, REST API and uncached pages
Security headers on the cached home pagemissing

The last line is the lesson of this build. The layer that remained was the static page cache. Even after the clear, the home page was still served from a file that WP Fastest Cache had created on 23 November, before Shield was installed. Apache hands that file to the visitor without starting PHP, so headers set by a PHP plugin never reach it.

Cache layers bypass PHP. A security control that lives in PHP, such as a WordPress security plugin, only protects the responses that PHP actually produces.

Diagram: a request passes an edge cache and a page cache before PHP. A cached hit skips PHP, so the WordPress security plugin never adds its headers.
A cached hit is answered by the edge cache or the page cache and never reaches PHP, so the headers that Shield adds there are missing. The .htaccess fix closes that gap.

The fix is now live. On 4 December the same four headers were added to .htaccess, after a backup and a review of the diff. Apache now adds them to every response, including static cache files and error pages, and each header is sent exactly once.

Preparing the open-source release

Most of this WordPress security plugin is not specific to one site. User name hiding, the headers, admin hardening, the form checks for Fluent Forms and WPForms, the decoys, the log and the AbuseIPDB integration work on any WordPress site. Only the name of the old plugin, the migration from it, the Dutch interface texts and the site specific decoy path were tied to this site.

For the public version these parts were made generic: English source strings with a full Dutch translation, a decoy path that is generated randomly on activation, overlap detection for the common login limiting plugins, a GPL license and documentation that states the limitations plainly.

Running the plugin against real, current versions of the form plugins in a local test site also exposed two bugs that the first site build had missed. Fluent Forms passes only its own fields to the validation filter, so the hidden honeypot and token were invisible to the check and genuine submissions were refused. The REST users block could be bypassed with a different letter case, because WordPress matches routes case insensitively. Both bugs were found during release preparation and fixed in version 2.0.1, which now runs on darjarihla.com.

The live check after the update repeated the cache lesson. The REST users endpoint now answers 401 in every letter case and through the rest_route parameter, but only after an edge cache in front of the site was cleared. Until then it kept serving the old open response from before the fix. A genuine test submission on the contact form, with form spam protection switched on, went through.

Verification and limitations

What this build does not establish:

  • It does not measure how much spam is stopped. That needs observation over the coming weeks.
  • The fill time check is weaker on cached pages, because the form HTML can be days old.
  • Only Fluent Forms and WPForms are covered.
  • Headers set in PHP do not reach statically cached pages. They belong in .htaccess or the server configuration as well.
  • Cheap filters stop cheap bots. They do not replace updates, two-factor authentication and backups, which the 7 WordPress security checks for small businesses cover.

Defensive only. The WordPress security plugin observes, rejects and temporarily blocks requests to its own site. It does not scan, probe or attack anyone. There is no hack-back.

What this build taught us

Detection is not enough without a log

A honeypot that silently drops entries teaches you nothing. A short, privacy aware log shows which defence actually fires.

Overlap is a risk of its own

Two security plugins that both lock out logins can lock out the wrong person. Detecting the overlap and explaining it is part of the design.

Cache layers bypass PHP

Verification from the outside showed what no settings page could: a static cache file does not carry headers that only PHP sends. After the 2.0.1 update, an edge cache did the same with an old REST response. Every fix needs a check after every cache layer is cleared.

Test against the real dependency

A simulated form proved the logic. Only the real form plugin showed how it actually hands data to the check.

The next development stage

  • Measure whether the .top and disposable mail spam stops, using the plugin log and the form entries.
  • Consider Cloudflare Turnstile as an additional, privacy friendly challenge if spam continues.
  • Fold feedback from other users into the next version of the WordPress security plugin.

These are next steps, not features claimed as delivered.

Download and feedback

Darja Rihla Shield is a free, open source WordPress security plugin under the GPL, ready to use on any WordPress site. The code, documentation and limitations are on GitHub. The installable zip with checksum is attached to release 2.0.1.

Feedback is welcome, including when something does not work or conflicts with another plugin. Join the feedback discussion on GitHub. Please report security problems privately through the Security tab of the repository, not in public.

Build status and reflection

ProjectDarja Rihla Shield
Build006
StatusLive on darjarihla.com, open source on GitHub (version 2.0.1)
PlatformWordPress security plugin
ModulesHide user names, login protection, security headers, admin hardening, bot defense
Hack-backNot included, by design

Build Log 006 documents how a practical annoyance became a small WordPress security plugin: describe the pattern, choose the narrowest defence, change safely, verify from the outside and write down what the verification revealed. It is one of the build logs in Startup Lab.

BUILD, VERIFY, PROVE, PUBLISH

Darja Rihla, December 2026

Article record

Published

Last updated