Skip to content

feat: record why the spam layers flagged an entry - #9

Merged
oxyc merged 1 commit into
mainfrom
feat/spam-reasons
Nov 15, 2026
Merged

oxyc merged 1 commit into
mainfrom
feat/spam-reasons

Conversation

@oxyc

@oxyc oxyc commented Nov 15, 2026

Copy link
Copy Markdown
Member

The rate limit and the content filter mark entries as spam through gform_entry_is_spam, but never recorded why. Gravity Forms then notes a bare "flagged as spam by Spam Filter", and anything reading the submission can't tell a flood from a keyword hit.

Both layers now call GFCommon::set_spam_filter() with filter ALTCHA and a reason:

  • rate limit: "The submission rate limit for this IP address was exceeded."
  • content filter: "The content filter matched: keyword." (the signals that fired)

The reasons are translatable, so generoi/gds-monitoring 1.4.0 can match the rate-limit reason in the site's language and skip it as bot-only, while still logging content-filter catches, which can hit real people.

Also bumps to 0.7.0 and lists every rejection reason in the README's logging section (it said only missing / invalid / replay).

Tests: the integration suite (real Gravity Forms in wp-env) asserts the recorded filter and reason for both layers, and that a clean submission records none: 11 passed, none skipped. Unit tests and Pint pass; ChallengeTest::test_fingerprint_returns_signature_and_expiry failed once in a full run and passed on rerun, an existing flake in solving a random test challenge, unrelated to this change.

🤖 Generated with Claude Code

Both the rate limit and the content filter now call GFCommon::set_spam_filter()
with filter "ALTCHA" and a reason, so the entry's spam note says why instead of
a bare "Spam Filter", and monitoring (generoi/gds-monitoring) can tell a rate
limit from a content match.

Also lists every ALTCHA rejection reason in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oxyc
oxyc merged commit df53c0f into main Nov 15, 2026
5 checks passed
@oxyc
oxyc deleted the feat/spam-reasons branch November 15, 2026 02:58
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