-
Notifications
You must be signed in to change notification settings - Fork 0
Tracer
Core\Tracer records, in order, each of the plugin's own Hook and Route firings during a request —
with timing and memory — so you can debug sequencing and measure performance. It's off by default and
adds zero overhead when off.
add_filter('wppm/trace_enabled', '__return_true'); // default: WP_DEBUGThe gate is evaluated once at boot. When off, the Hook/Router resolvers return the raw callable
verbatim — no wrapping, no microtime, no allocation. When on, each plugin callable is decorated to record
a flat trace entry:
{ name, type (action|filter|rest|ajax), callback, order, duration_ms, mem_delta, priority }
Filters stay transparent (the wrapper returns the filtered value unchanged); the AJAX wrap sits inside the existing nonce → method → capability gate.
A read-only Tracer admin page (wp-plugin-matrix-tracer, capability manage_options) renders the
current request's trace as a table — the page traces its own load. Optionally persist the last trace:
add_filter('wppm/trace_dump', '__return_true'); // on shutdown, store the last trace in a transient + logThe Tracer wraps only your plugin's registrations (everything routed through Core\Hook and
Core\Router) — it deliberately ignores WordPress's global all action, which keeps it cheap.
Design:
docs/adr/0007-execution-tracer-wraps-hook-router-seams.md. v1 is a flat ordered list (no span tree, no REST API, no ring buffer) and does not catch/alter thrown callables.
WP Plugin Matrix · GPL-2.0-or-later · source · pages are generated from docs/wiki/ — edit there, not in the wiki UI.
Seams
Tooling