Skip to content

feat(frontend): device test names blockers and gives a verdict - #2063

Merged
rpgmem merged 5 commits into
developfrom
claude/device-check-blockers
Oct 24, 2026
Merged

rpgmem merged 5 commits into
developfrom
claude/device-check-blockers

Conversation

@rpgmem

@rpgmem rpgmem commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

The device test ([ffc_verification] with ?ffc_device_check=1) could not see a blocker that stops the plugin's own scripts, and listed its rows in no particular order. Closes #2062.

  • Server requests (new row): an empty POST to admin-ajax.php, which WordPress answers with 400 and 0. The row reports the response time; a firewall's status code ("refused"); or no answer at all ("blocked"). Each failure carries its own fix.
  • Device ID: when the device limit is on and the browser has Web Crypto, a missing collector is reported as stopped by a blocker.
  • Captcha: where the site uses ALTCHA (altcha or both), the page loads the same ffc-altcha bundle the forms use, before the script, and fails the row when altcha-widget never defined itself.
  • Stalled notice: a shared .ffc-notice sits in the markup and the stylesheet alone reveals it after 12 s. The script cancels it on start (is-running), or shows it at once when FFC.Preflight / FFC.Platform are missing (is-stalled). The <noscript> message now uses Notice::render() too.
  • Verdict above the rows: ready / ready with warnings / may not work, drawn with FFC.notice() from the row states once every row has answered. Kept at the top, where a screenshot shows it first.
  • Location: permission and precision are one row ("Allowed · About 12 m, read in 2.1 s"), taking the worse state and its fix.
  • Order: the network, the browser, the forms' protections, the device's settings, the display, then the PDF last.
  • Copy the results adds the plugin version (ffcCoreConfig.version), the captcha mode and whether the device limit is on (ffc_device_config).

Reused rather than added: Notice / FFC.notice, ffcCoreConfig, ffc_device_config, ffc_ajax.ajax_url, AltchaCaptcha::register_assets(). No new endpoint, no inline style. A stale-JS-cache notice was left out: telling it reliably would need the server to report its version through a new endpoint.

Tests

  • Vitest: server ok / refused / blocked, captcha bundle missing vs defined vs math, device blocked vs no Web Crypto, verdict ok / warn / fail / checking, running vs stalled, merged location row, copied summary lines. Full suite: 2,566 passed.
  • PHPUnit DeviceCheckTest: row order, stalled and verdict markup, no style=, ALTCHA dependency for altcha and both, captcha in the localized config.
  • Chromium check of the CSS timer: with no script the notice is revealed after the delay; with is-running it stays hidden; with is-stalled it shows at once.
  • Catalogues recompiled; translation, documentation, CSS and minifier guards pass.

Docs

The Certificates documentation topic describes the new rows, the verdict, the blocker notices and the copied setup. The CHANGELOG has an Added entry.


Generated by Claude Code

…e screen row

Work in progress for #2060, waiting on the format to be confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
The connection row printed `effectiveType`, a speed class the browser
estimates, as a network generation, so a wired desktop read "4G". It
now reads one pair on every device, "Online/Speed: <medium> / <speed>":
the medium from `connection.type` where Chromium for Android gives it
(Wi-Fi, mobile data, wired, Bluetooth, other), the speed as "Fast (like
4G or better)", "Slow (like 3G)", "Very slow (like 2G)" or "Very slow
(below 2G)", and "not reported" in the slot the browser leaves empty.
When neither is given, the row stays informational and its "i" button
says iOS (or this browser) does not tell, and that the forms do not
need it. Data saver is a warning whose fix carries the message. The
screen row says density instead of zoom.

Closes #2060

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
The device test could not see a blocker that stops the plugin's own
scripts, and listed its rows in no particular order (#2062).

- New "Server requests" row: an empty POST to admin-ajax.php, which
  WordPress answers with 400 and "0"; a firewall's code or no answer
  is reported, with the time taken.
- Device ID: a collector missing where the browser could run it is
  reported as stopped by a blocker.
- Captcha: where the site uses ALTCHA, the page loads the bundle the
  forms use and reports when its widget never defined itself.
- A notice revealed by the stylesheet alone after a delay says the test
  could not run; the script cancels it on start, or shows it at once
  when a script it needs is missing. The noscript message uses the
  shared notice component.
- A verdict above the rows (ready / warnings / may fail), drawn with
  FFC.notice from the row states.
- Location permission and precision are one row; the rows are grouped
  by subject with the PDF last.
- "Copy the results" adds the plugin version, the captcha mode and
  whether the device limit is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
@rpgmem rpgmem added enhancement New feature or request area:certificates labels Oct 24, 2026 — with Claude
…k-blockers

# Conflicts:
#	assets/js/ffc-device-check.js
#	assets/js/ffc-device-check.min.js
#	includes/frontend/class-ffc-device-check.php
#	languages/ffcertificate-pt_BR.l10n.php
#	languages/ffcertificate-pt_BR.mo
#	languages/ffcertificate-pt_BR.po
CaptchaFieldNameTest reads `{ altcha: … }` as a script enumerating the
captcha's fields. The copied-results label is now a small function, so
the device test names the mode without that shape (#2062).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA
@rpgmem
rpgmem marked this pull request as ready for review October 24, 2026 14:34
@rpgmem
rpgmem merged commit e1329a3 into develop Oct 24, 2026
26 checks passed
@rpgmem
rpgmem deleted the claude/device-check-blockers branch October 24, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:certificates enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants