Expand link scanner coverage to comments, metadata, and widgets#234
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| $comment_items = get_comments([ | ||
| 'post_id' => $post->ID, | ||
| 'status' => 'approve', | ||
| 'type' => 'comment', |
There was a problem hiding this comment.
Fetch all post comments when scanning for links
The new comment scan uses get_comments() without overriding the default number parameter. WordPress limits this call to the site’s comments_per_page option (10 by default), so only the first page of approved comments is inspected. Posts with more comments will have most comment links skipped, defeating the goal of detecting broken links across all comments. Specify 'number' => 0 or 'nopaging' => true in the arguments to ensure every approved comment is scanned.
Useful? React with 👍 / 👎.
Summary
Testing
vendor/bin/phpunit tests/BlcScannerTest.phphttps://chatgpt.com/codex/tasks/task_e_68dda233a1c8832ebc8ca2c375cccfa0