Skip to content

Add "Check only" fixer option (check links without redirecting)#349

Merged
gin0115 merged 2 commits into
trunkfrom
feature/add-profile-only-mode
Jul 1, 2026
Merged

Add "Check only" fixer option (check links without redirecting)#349
gin0115 merged 2 commits into
trunkfrom
feature/add-profile-only-mode

Conversation

@gin0115

@gin0115 gin0115 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a third Fixer Option — "Check broken links but do not redirect them"
(FIXER_OPTION_CHECK_ONLY). In this mode the front-end checker still runs and
records each link's status server-side, but it never rewrites the href or flags
the link — visitor-facing output is untouched. Also relabels the do-nothing
option to "Do not auto check links" (it was ambiguous next to the new mode).

Changes

  • Settings: new FIXER_OPTION_CHECK_ONLY; should_render_html_link_output()
    now true for check-only so the checker still enqueues and records results.
  • Front checker JS: the href swap is gated to replace_link only.
  • Settings page: third dropdown option + relabel of do-nothing.
  • README: Fixer Option docs updated for all three modes.

Testing

  • composer test:php — 355 tests / 912 assertions pass (incl. 2 new check-only tests).
  • npm run test:e2e — all specs pass, including a new fixer-mode.spec.js that
    drives all three modes in a real browser and asserts check-only records the
    check but leaves the href/class untouched.

🤖 Generated with Claude Code

gin0115 and others added 2 commits July 1, 2026 22:23
Adds a third Fixer Option, FIXER_OPTION_CHECK_ONLY, that runs the
front-end link checker (recording each link's status server-side) but
never rewrites the href or flags the link. Relabels the do-nothing
option to "Do not auto check links".

- Settings: new constant; should_render_html_link_output() now true for
  check-only so the checker still enqueues and records results.
- Front checker JS: href swap gated to replace_link only.
- Settings page: third dropdown option + relabel of do-nothing.
- README: Fixer Option docs updated for all three modes.
- Tests: PHPUnit coverage for the check-only enqueue/output; new
  Playwright fixer-mode spec + seeder mu-plugin covering all three modes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The tests failed intermittently in CI depending on the PHPUnit random
seed. Test_Find_Or_Create_Snapshot mocks archive.org at the HTTP layer
(pre_http_request), but several other test classes register fake clients
via the iawmlf_snapshot_client / iawmlf_link_checker_client filters and
only cleared them in set_up, never in tear_down. When one ran just before
Find_Or_Create, the stale client hijacked the event so get_latest_snapshot
returned null and the link stuck at 'pending' instead of 'new'/'done'.

- Defensive: clear both client filters in Find_Or_Create_Snapshot::set_up.
- Root cause: add tear_down cleanup to the set_up-only leakers
  (Check_Snapshot_Status_Event, Action_Scheduler_Garbage_Collection,
  Report_Table_Actions).

Verified: the previously-failing seed 1782941233 now passes, plus three
further random seeds - 355 tests green each.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gin0115 gin0115 merged commit ba81627 into trunk Jul 1, 2026
11 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