Add --plugin grouping to wp profile hook resource output#220
Draft
Copilot wants to merge 10 commits into
Draft
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add table of plugin resource usage with --plugin
Add May 28, 2026
--plugin grouping to wp profile hook resource output
swissspidy
reviewed
May 28, 2026
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new --plugin flag to wp profile hook so hook callback metrics can be aggregated and displayed at plugin granularity (including mu-plugins), with docs and Behat coverage updated accordingly.
Changes:
- Added
--pluginflag towp profile hookand implemented plugin-level aggregation of callback metrics. - Updated CLI documentation/usage strings to include the new flag.
- Added a Behat scenario for plugin-grouped output and a dev dependency to support plugin activation in tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Command.php |
Adds --plugin option handling, plugin grouping aggregation, and plugin slug extraction from callback location. |
README.md |
Documents the new --plugin flag in synopsis/options. |
features/profile.feature |
Updates usage output to include --plugin. |
features/profile-hook.feature |
Adds acceptance coverage for --plugin grouped output. |
composer.json |
Adds wp-cli/extension-command to dev dependencies (used by the new Behat scenario). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
wp profilecould not report resource usage at plugin granularity when profiling hooks. This change adds a plugin-level view so callback metrics can be aggregated per plugin via a first-class CLI flag.Hook command surface
--plugintowp profile hookoptions.README.md, feature usage output) to include the new flag.Plugin-level aggregation
Command::hook()to aggregate callback metrics by plugin when--pluginis set.time, query/cache/request counters and durations, and computes aggregatecache_ratio.location.Behavior constraints
--pluginis only valid when profiling callbacks (wp profile hook <hook>or--all).Acceptance coverage
init.Example output shape: