Repository navigation
feat(frontend): device test pings the plugin under a per-address limit - #2066
Merged
Merged
Conversation
The device test sent a HEAD for the clock and an empty POST to admin-ajax for the server row. WordPress rejects the empty POST before any plugin code runs and the page cache answers the HEAD, so neither could be limited, and a page served from an old cache went unnoticed (#2064). - One public endpoint, ffc_device_check_ping, answers with the server's time and the plugin's version and feeds both rows. A version that differs from the page's names an old cached page. - It is limited per address in fixed windows (default 60 per 600 s, 0 off), edited on Settings > Rate Limit beside the captcha cap and bounded on save and on read by RateLimitSettingsReader. Over the cap the row warns with the wait instead of failing. - The fixed-window counter the ALTCHA mint cap used moves to Core\WindowThrottle, now shared by both endpoints; the mint cap's behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
rpgmem
marked this pull request as ready for review
October 24, 2026 15:14
rpgmem
enabled auto-merge (squash)
October 24, 2026 15:14
7 tasks done
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.
Summary
The device test sent two requests to the server. It sent a HEAD on the page itself for the clock row, and an empty POST to
admin-ajax.phpfor the server row. Neither could be limited by the plugin: WordPress rejects the empty POST before any plugin code runs, and the page cache answers the HEAD. A page served from an old cache also went unnoticed. Closes #2064.ffc_device_check_ping:nocache_headers();FFC_VERSION;ffcCoreConfig.version) differs from the server's, the server row warns that the page is an old copy and says how to fix it.0turns it off.RateLimitSettingsReader, the typed reader offfc_rate_limit_settings.retryAfter. The row shows a warning with the wait, not a failure, because the device is not at fault.AltchaChallengeEndpoint::allow_mint()moves toCore\WindowThrottle, now used by both endpoints. The address is still hashed into the key and never stored raw. The ALTCHA tests pass unchanged.DeviceCheck::init()registers its own hooks withself::AJAX_ACTION, and theFrontendconstructor calls it.Tests
DeviceCheckPingTest(separate process,RequestInputalias):nocache_headers();retryAfterpast the cap, with a hashed key;TabRateLimitTest: defaults, bounds on save, 0 accepted as "no cap", a cleared field keeps the stored value.DeviceCheckTest: the localizedpingconfig.Docs
Addedentry.Generated by Claude Code