Skip to content

Remove the image challenge threshold from the statistics page - #53

Merged
forgetso merged 2 commits into
mainfrom
fix/remove-image-threshold-row
Aug 31, 2026
Merged

Remove the image challenge threshold from the statistics page#53
forgetso merged 2 commits into
mainfrom
fix/remove-image-threshold-row

Conversation

@forgetso

Copy link
Copy Markdown
Member

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 — and sites/wp-details still 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 the getFrictionlessImageThresholdLabel helper. appComponent.tsx, config.ts and Statistics_Settings_Tab.php are 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.ts that accepts frictionlessThreshold as 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 bare z.number() throws, ApiClient.resolveSite() swallows it into null, and refreshData() calls markAsFailed() — 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 → default 0.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

forgetso and others added 2 commits August 31, 2026 11:30
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>
@forgetso
forgetso merged commit 6ad8272 into main Aug 31, 2026
1 of 8 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