Conversation
|
Contributor
There was a problem hiding this comment.
Pull request overview
Staging release updating the bundled Query Monitor plugin to v4.0.6, including internal ID/menu handling adjustments and various encoding/output hardening changes.
Changes:
- Bump Query Monitor version metadata/constants from 4.0.0 to 4.0.6 and update composer reference.
- Introduce a shared
QM_ArrayAccesstrait and apply it across QM data objects for backward-compatible array access. - Update dispatcher/output code to use
wp_json_encode()and refine panel/menu ID handling and HTML fallback output behavior.
Reviewed changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| query-monitor/wp-content/db.php | Bumps drop-in header version to 4.0.6. |
| query-monitor/vendor/composer/installed.php | Updates Query Monitor package reference hash. |
| query-monitor/vendor/composer/autoload_static.php | Adds classmap entry for new QM_ArrayAccess trait. |
| query-monitor/readme.txt | Updates stable tag to 4.0.6. |
| query-monitor/query-monitor.php | Updates plugin version header and QM_VERSION constant to 4.0.6. |
| query-monitor/output/html/headers.php | Adjusts panel-menu keys and uses raw collector IDs for child panels. |
| query-monitor/output/html/db_queries.php | Updates menu keys/child placement to align with qm- prefixed menu keys + raw panel IDs. |
| query-monitor/output/html/db_dupes.php | Moves submenu items under the updated qm-db_queries parent key. |
| query-monitor/output/html/db_components.php | Moves submenu items under the updated qm-db_queries parent key. |
| query-monitor/output/html/db_callers.php | Moves submenu items under the updated qm-db_queries parent key. |
| query-monitor/output/html/assets.php | Removes early-return for empty assets and relies on type counts for menu rendering. |
| query-monitor/output/headers/php_errors.php | Switches JSON encoding to wp_json_encode(). |
| query-monitor/output/Headers.php | Switches JSON encoding to wp_json_encode() for non-scalar header values. |
| query-monitor/dispatchers/REST.php | Switches REST fatal output JSON encoding to wp_json_encode(). |
| query-monitor/dispatchers/Html.php | Adds fallback container output behavior; fixes concerned-hooks menu keying; hardens inline JSON encoding and number formatting. |
| query-monitor/dispatchers/AJAX.php | Removes obsolete TODO and outputs JSON via wp_json_encode(). |
| query-monitor/data/php_error.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/http/http_response.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/http/http_request.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/frame.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/callsite.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/callback.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/data/block_editor/post_block.php | Implements ArrayAccess via shared trait for DTO compatibility. |
| query-monitor/classes/Util.php | Updates deprecated JSON helper to use wp_json_encode(). |
| query-monitor/classes/Data.php | Replaces inline ArrayAccess methods with the shared trait. |
| query-monitor/classes/Collector_Assets.php | Changes header sentinel to null and adjusts processing checks accordingly. |
| query-monitor/classes/Collector.php | Changes id() to return a qm- prefixed string. |
| query-monitor/classes/ArrayAccess.php | Adds the new shared QM_ArrayAccess trait. |
| query-monitor/assets/build/query-monitor.css | Updates built CSS asset bundle. |
Comments suppressed due to low confidence (1)
query-monitor/output/html/assets.php:61
admin_menu()now always callsarray_sum( $data->types ), butQM_Collector_Assets::process()can exit early (or complete without callinglog_type()) leaving$data->typesunset/NULL. In that case this line will throw a TypeError in PHP 8+ (array_sum(): Argument #1 must be of type array, null given). Either restore the early return when there are no assets, or defensively default to an empty array/0 here (or initialize$this->data->typesto an empty array in the collector).
$type_label = $this->get_type_labels();
$args = array(
'title' => $type_label['label'],
'count' => array_sum( $data->types ),
);
rinatkhaziev
approved these changes
Apr 17, 2026
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.



No description provided.