Add "Check only" fixer option (check links without redirecting)#349
Merged
Conversation
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>
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.
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 andrecords 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
FIXER_OPTION_CHECK_ONLY;should_render_html_link_output()now true for check-only so the checker still enqueues and records results.
replace_linkonly.Testing
composer test:php— 355 tests / 912 assertions pass (incl. 2 new check-only tests).npm run test:e2e— all specs pass, including a newfixer-mode.spec.jsthatdrives all three modes in a real browser and asserts check-only records the
check but leaves the href/class untouched.
🤖 Generated with Claude Code