Repository navigation
feat: Query Monitor parity (phase 2) - #2
Merged
Merged
Conversation
Full backtrace, error and rows for each wpdb query through core filters (no wpdb subclass, so any db.php drop-in keeps working) and attribution of queries, HTTP calls, transients and checks to a component. New tabs: WP HTTP, WP Cache, WP Capabilities (aggregated, on by default), WP Blocks (with block bindings), WP Assets (with Vite builds), WP Languages and Doctor (pollora:doctor's web checks on demand). Redirects made with wp_redirect() are stacked for the next page. The Pollora tab adds the async actions queued, WordPress constants and drop-ins.
…irectories, readable doctor errors Each query keeps its 10 innermost frames to show, and is attributed from its whole trace when it runs: full traces made most of the bar's weight (309 KB of 411 on a WooCommerce shop page, now 154). Component directories are not cached until WordPress defines where plugins live, which had left early lookups without them. The Doctor tab says what came back when the answer is not JSON (a proxy's 404 while a server restarts) instead of a JSON syntax error. The Pollora tab adds the database server, memory limits and web server Query Monitor shows.
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.
Phase 2 of the Debugbar integration spec, stacked on #1 (retarget to
developonce #1 is merged, before deleting its branch).Queries without a wpdb subclass
The skeleton's
db.phpreplaces$wpdbafter anything this package could set, so the planned subclass is dropped.log_query_custom_dataadds a trimmed backtrace to each saved query; thequeryfilter, which runs before WordPress flushes the previous query, copies its error and row count. Works with any drop-in (Pollora's, Query Monitor's, HyperDB).Components
Each query, HTTP call, transient and (opt-in) capability check is attributed to plugin, mu-plugin, theme, module, app — the project's own code wins, otherwise the innermost frame (a query WordPress makes while Pollora boots it is core's). In WP Queries it is the SQL widget's connection, so its filter links group by component.
New tabs
WP HTTP, WP Cache, WP Capabilities (aggregated: identical checks counted once, no backtrace unless
options.wp_capabilities.backtrace), WP Blocks (render time per type, Pollora Blade blocks, block bindings viaBindingResolved), WP Assets (scripts, styles, script modules, missing dependencies, Vite builds), WP Languages, and Doctor: a Run doctor button calling_debugbar/pollora/doctor(guarded like Debugbar's stored requests), errors first.Redirects
wp_redirect()exits outside a Laravel response: the request is stacked by giving Debugbar's HTTP driver a temporary response and sending its cookie withheader(). Route names are refreshed first — WordPress can exit before Laravel indexes them, which made Debugbar's collectors throw.Pollora tab
Async actions queued in the request (
pollora/async/dispatched, Pollora/hook#18), WordPress constants and drop-ins.Depends on
Pollora/framework#442 (
BindingResolved,AssetManager::containers()), Pollora/hook#18 (pollora/async/dispatched); both degrade gracefully when absent.Tests
83 Pest tests (unit + feature), PHPStan level 6, Pint; E2E extended to 10 tests (components, HTTP, transient, capability, blocks, Vite, redirect, doctor button), green locally against the scratch site.