Repository navigation
feat: hook timings, the bar in wp-admin, multisite (phase 3) - #3
Merged
Merged
Conversation
- WP Hook timings tab (opt-in, options.wp_hooks.timings): each callback wrapped in place in $wp_filter under its own key, own and total time, slowest first; by-reference callbacks left alone - wp-admin: the bar printed with the admin footer scripts and stored, without Debugbar's Laravel-only tabs; the block editor's REST calls are listed in it - WP Request: admin page and screen; on a multisite, the site, the network, every site switch and a switch never restored - Hooks: a closure is named after a class only when written in it
The request is still stored; set DEBUGBAR_POLLORA_IFRAMES=true to print the bar in frames too.
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 3 of the debug bar integration, stacked on #2 (retarget to
developbefore deletingfeat/phase-2).options.wp_hooks.timings): at eachallcall, the hook's callbacks not timed yet are wrapped in place in$wp_filter, under their own key, soremove_action(),has_filter()and re-adds keep working (WP_Hookis final). Own time and total, slowest first, capped bytimings_limit. Callbacks with by-reference parameters and the package's own are left alone; array callbacks stay readable as[0]/[1].wp-config.phpboots providers without a kernel, so Debugbar never shows there. The bar is printed withadmin_print_footer_scriptsand stored, without Debugbar's Laravel-only tabs (route, views, session, livewire, inertia;admin.hidden_collectors). The REST calls of the block editor are listed in it. Off withDEBUGBAR_POLLORA_ADMIN=false.switch_blogwith its component, and a warning when the request ends still switched.Bootstrap).Checked on the scratch site: dashboard, post editor and Site Editor show the bar; 200 callbacks timed; multisite (converted, then restored) shows the switches and the unrestored one. Overhead of timings not measurable against run-to-run noise (median of 15, two runs); +26 KB on the front page.
Tests: 97 Pest tests, PHPStan, Pint; E2E 12 tests locally (2 new: admin page, editor REST call).