Repository navigation
feat: record why the spam layers flagged an entry - #9
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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_expiryfailed 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