Skip to content

Separate blocked-request counts from saved detection rows - #132

Merged
cport1 merged 2 commits into
mainfrom
feat/wordpress-request-outcome-counters
Nov 14, 2026
Merged

cport1 merged 2 commits into
mainfrom
feat/wordpress-request-outcome-counters

Conversation

@cport1

@cport1 cport1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

A request from an already-blocked IP returns 403 before scoring, so it creates no new detection row. The dashboard previously showed saved detections and the size of the IP block list without a separate request-denial count. This adds explicit local request accounting and labels those measures separately.

A fresh trap can create a finding and an IP block; subsequent denied requests now increment Blocked requests without writing duplicate findings. Throttles, challenges and withheld enforcement are separate outcomes. The dashboard shows today's UTC counts, Statistics compares matching UTC calendar windows, and the Detections page explains that rows are findings rather than requests. Dashboard finding/IP summaries are read fresh alongside the new counters.

The new schema stores only UTC hour, a closed outcome enum and an atomic count. One request contributes once, even when several monitor decisions occur. Actual denial counts require the corresponding final HTTP status. Setup tests, nonces/permission failures, CLI maintenance, decoy responses and earlier Wordfence denials are excluded. Schema installation is retryable, tracking start is visible, no historical counts are invented, retention is 30 calendar days and uninstall removes the new storage. No protection decisions or cloud reporting contracts change.

Validation:

  • 235 unit tests passed.
  • 14 focused checks passed across 60 real HTTP requests in isolated WordPress/MariaDB: monitor deduplication, repeated blocks, 40 concurrent increments, separate challenges/429s, authenticated UI values, counter-write failure isolation/recovery, failed-upgrade recovery, retention and actual uninstall.
  • One monitor login produced three withheld actions but one request count; 40 concurrent repeat blocks produced exactly 40 increments and no new detection rows.
  • All 122 installed-plugin compatibility cases passed again, including native Wordfence prepend mode and explicit exclusion of its denials from WebDecoy counters.
  • Corrected the fixture's admin-directory routing and strengthened admin assertions to require the wp-admin body class. Earlier admin-bar-only assertions could mistake the front page for the dashboard; actual admin UI checks now pass.

Both disposable containers were removed. This is an unreleased implementation; no marketplace/CDN release was published. Browser JavaScript, vendor signature feeds and full multisite integration remain outside this validation. Definitions, compact measurements and repeatable fixtures are included.

@cport1
cport1 merged commit 7c449b6 into main Nov 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant