Repository navigation
Only collect debug info for the subcommands that show it - #22
Conversation
The constructor collected `WP_Debug_Data::debug_data()` for every subcommand, but only `info` and `list-info-sections` use it. On a test site with a few large plugins it took 220-540 ms, and it shells out to Ghostscript to check its version. Collect it on first use instead, so `wp site-health check` and `wp site-health status` skip it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesSite Health Info
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change defers debug-data collection until an info command needs it and reuses the result. No actionable merge risk is established by the supplied evidence. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The constructor collected
WP_Debug_Data::debug_data()for every subcommand, but onlyinfoandlist-info-sectionsuse it.On a test site with a few large plugins, collecting it took 220–540 ms. It also shells out to Ghostscript to check its version, which printed
gs: not foundon stderr where Ghostscript isn't installed.It's now collected on first use, so
wp site-health checkandwp site-health statusskip it. The output ofinfoandlist-info-sectionsdoesn't change.Tests
infoandlist-info-sections, and the change has no visible effect apart from timing.🤖 Generated with Claude Code
https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS
Generated by Claude Code
Summary by CodeRabbit