Remove the image challenge threshold from the statistics page - #53
Merged
Conversation
The row was added in 1.20.5 but renders an em dash for every install: the value lives on the upper rung of the frictionless ladder, and the WordPress endpoint still sends frictionlessThreshold as a bare number, so there is nothing to show and no date by which there will be. Reverts the row, its label and its level helper. The statistics page is byte-identical to 1.20.4 again. The schema union is kept deliberately. It is not part of displaying the value: the portal has moved frictionlessThreshold to the ladder object, and because the whole site response is a single parse, a ladder arriving at a bare z.number() would fail and take out the entire statistics tab rather than one row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drops the Account Information, Captcha Settings and Whitelisted Domains panels, leaving the monthly image/PoW counts and the traffic chart. Takes the throw risk out at the root rather than guarding against it. `settings` is no longer declared on the site schema at all, so zod strips it: the whole response is a single parse, and a field the page does not display has no business being able to fail it. That removes the frictionlessThreshold union, its transform, and the Input types that existed only to describe them. Also removes the now-orphaned ListComponent and the account, captcha settings and domain label sets on both the TS and PHP sides. Note: no puzzle count. The endpoint does not carry one — MonthlyCaptchaRequestsSchema is limit/image/pow/year/month — so showing it needs a portal change first. Co-Authored-By: Claude Opus 5 (1M context) <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.
Why
The row shipped in 1.20.5 renders an em dash for every install. The value it shows is the upper rung of the frictionless ladder, which arrives nested inside
frictionlessThreshold— andsites/wp-detailsstill sends that field as a bare number. Verified against the live endpoint:frictionlessThreshold: 0.5. There is no date by which that changes, so the row is inert.What
Removes the row, its label (
config.ts+Statistics_Settings_Tab.php) and thegetFrictionlessImageThresholdLabelhelper.appComponent.tsx,config.tsandStatistics_Settings_Tab.phpare now byte-identical to 1.20.4 — the statistics page renders exactly as it did before 1.20.5.What is deliberately kept
The union in
procaptchaSite.tsthat acceptsfrictionlessThresholdas either a number or the ladder object.This is not part of displaying the value. The portal has moved the field to the ladder object, and the whole site response is a single
procaptchaSiteSchema.parse(). A ladder object hitting a barez.number()throws,ApiClient.resolveSite()swallows it intonull, andrefreshData()callsmarkAsFailed()— so the failure would take out the entire statistics tab, not one row. It also silently hides the free-tier upgrade banner, which routes through the same call.Parsing verified against all three wire shapes: bare number →
0.5; ladder → puzzle rung; ladder with no puzzle rung → default0.5. No image rung leaks into the output.Checks
TS 5.7.2, prettier 3.4.1, eslint, phpcs, phpstan, pest all pass (pinned versions, matching CI).
E2E remains red on the pre-existing blocklist 403 — unrelated to this diff, and gated on prosopo/captcha#3149 being deployed.
🤖 Generated with Claude Code