Skip to content

feat(frontend): device test sections and the location step - #2067

Merged
rpgmem merged 4 commits into
developfrom
claude/device-check-accordion
Oct 24, 2026
Merged

rpgmem merged 4 commits into
developfrom
claude/device-check-accordion

Conversation

@rpgmem

@rpgmem rpgmem commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

The device test listed its 14 rows as one long list, and could call a device ready before the visitor had read the location. Closes #2065.

  • Six native <details> sections, in the order the rows already had: Network, Browser, Form protections, Device settings, Display, PDF download.
    • They open and close without the test's script, so a blocker that stops the script does not lock the rows away.
    • All are closed while every row passes.
    • Each summary carries a chip that counts its rows: "N OK", "1 warning" / "N warnings", "1 failure" / "N failures", "Checking…" or "Test pending".
    • A section with a failure or a warning takes the danger or warning border, through data-ffc-state.
  • Auto-open, never auto-close: a section opens by itself when one of its rows warns, fails or waits on the visitor. The script never closes it again, so the screen does not jump under the reader.
  • The location step, as agreed with the maintainer:
    • Until the visitor reads the location, the row says "precision not tested yet".
    • The Device settings section opens, and the "Test my location" button now sits there, beside its row.
    • The verdict asks for the step: "One step left". A failure is still reported before the owed step.
    • The test never reads the location on its own.
  • "Copy the results" still copies every row, those in closed sections included.
  • CSS lives in ffc-device-check.css and uses palette tokens only: no inline style, no colour literal.

Tests

  • PHPUnit DeviceCheckTest: six closed sections in order, each section holding its own rows, and the location button inside the Device settings section.
  • Vitest:
    • passing sections stay closed and count their rows;
    • an owed location opens its section and the verdict asks for it;
    • reading the location finishes the test, and the section stays open;
    • a warning opens its section; a failure is named and reported first;
    • closed sections are still copied.
    • Full suite: 2,572 passed.
  • Chromium render at phone width, three cases:
    • all passing: every section closed except Device settings, which shows "Test pending";
    • after reading the location: "This device is ready";
    • server blocked: Network open with a red border and "1 failure".
  • Guards pass: CSS namespace, ownership, tokens, dark mode, spacing, typography, inline style, class emission, translation coverage and catalogue agreement, documentation coverage, comment language.

Docs

  • The Certificates topic describes the sections and the location step.
  • Strings are in the three catalogues; the CHANGELOG has an Added entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_018srx5hc431EYmG4MHUr2KA

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
The device test listed its rows as one long list, and could call a
device ready before the visitor had read the location (#2065).

- The rows sit in six native <details> sections (network, browser, form
  protections, device settings, display, PDF download). They open and
  close without the script, stay closed while they pass, and open by
  themselves on a warning, a failure or a step owed; the script never
  closes one again. A chip counts each section's rows by state.
- Until the location is read, its row says the precision is not tested
  yet, the section opens with the button beside its row, and the verdict
  asks for that step; a failure is still told first.
- "Copy the results" still copies every row, those in closed sections
  too.

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-accordion

# Conflicts:
#	CHANGELOG.md
#	assets/js/ffc-device-check.min.js
#	includes/frontend/class-ffc-device-check.php
#	includes/settings/views/documentation/feature-certificates.php
#	languages/ffcertificate-pt_BR.l10n.php
#	languages/ffcertificate-pt_BR.mo
#	languages/ffcertificate-pt_BR.po
#	languages/ffcertificate.pot
@rpgmem
rpgmem marked this pull request as ready for review October 24, 2026 15:15
@rpgmem
rpgmem enabled auto-merge (squash) October 24, 2026 15:15
@rpgmem
rpgmem merged commit 9a372b7 into develop Oct 24, 2026
26 checks passed
@rpgmem
rpgmem deleted the claude/device-check-accordion branch October 24, 2026 15:37
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