Skip to content

feat: Pollora and WordPress in Laravel Debugbar (phase 1) - #1

Merged
ogorzalka merged 3 commits into
developfrom
feat/phase-1
Oct 8, 2026
Merged

ogorzalka merged 3 commits into
developfrom
feat/phase-1

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Phase 1 of the Debugbar integration spec.

Tabs

  • Pollora: what answered (Route::wp(), template hierarchy + view, Laravel route, or WordPress alone), versions, discovery scans, modules, theme, async actions.
  • WP Request: rewrite rule, query vars, queried object, main query, true conditionals, template and hierarchy candidates.
  • WP Queries: $wpdb queries in Debugbar's SQL widget (SAVEQUERIES turned on before WordPress loads), slow flag, soft/hard limits, main query marked.
  • WP Hooks: hooks that ran, callbacks, those registered by Pollora (via AbstractHook::all(), feat: AbstractHook::all() and the pollora/async/dispatched action hook#18; degrades gracefully without it).
  • Timeline: WordPress loading and notable actions on Debugbar's timeline.

Request contexts

REST and admin-ajax exit before Laravel's RequestHandled/Terminating: the package sends phpdebugbar-id (on rest_post_dispatch / admin_init) and collects at shutdown, so the calls appear in the bar's request list.

Extension points

  • Level 1: Debugbar's own API, unchanged.
  • Level 2: Pollora\Debugbar\Collector base class (origin, title, widget presets, sections), container tags pollora.debugbar.collectors / pollora.debugbar.sections.
  • Level 3: pollora/debugbar/register action with a Registry (variables(), table(), section()), plus pollora/debugbar/message|start|stop and Query Monitor's qm/* actions.

Origins are told apart: Pollora tab first, WP … tabs next, third parties last (order option); wp_* and pollora* names reserved.

Depends on

Tests

61 Pest tests (unit + Testbench feature), PHPStan level 6, Pint.

Draft until checked on a real site (scratch project).

Pollora tab (what answered the request, versions, discovery, modules,
theme, async actions), WP Request, WP Queries, WP Hooks and WordPress
phases on the timeline; REST and admin-ajax requests stored and tagged
with phpdebugbar-id; qm/* and pollora/debugbar/* actions bridged.

Extension points: the Collector base class and container tags for
packages, the pollora/debugbar/register action for WordPress code.
Most of Pollora's callbacks are closures, which all read as "Closure":
first-class callables now read as Class::method and real closures as
the class and file:line they were written in. Tab icons are taken from
php-debugbar's own set; any other name renders as an empty square.
@ogorzalka
ogorzalka marked this pull request as ready for review October 8, 2026 13:30
A Playwright job installs the skeleton under DDEV with this package,
adds a fixture mu-plugin that extends the bar both ways (actions and a
tagged Collector), and checks the tabs, their order, the answering
template, wpdb queries, a REST call listed by the bar and the third
party data.
@ogorzalka
ogorzalka merged commit 23c9ba0 into develop Oct 8, 2026
4 checks passed
@ogorzalka
ogorzalka deleted the feat/phase-1 branch October 8, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant