sympress / profiler
Profiler and web debug toolbar for the WordPress kernel.
Requires
- php: ^8.5
- ext-json: *
- symfony/filesystem: ^8.1.11
- sympress/kernel: ^1.1.1
Requires (Dev)
- brain/monkey: ^2.6
- friendsofphp/php-cs-fixer: ^3.94
- mockery/mockery: ^1.6
- symfony/var-dumper: ^8.1
- sympress/qa: ^0.1.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- 1.0.1
- 1.0.0
- dev-fix/http-client-preempted-duration
- dev-release/1.0.6
- dev-codex/use-private-kernel-cache
- dev-chore/composer-author-sympress-io
This package is auto-updated.
Last update: 2026-11-23 13:42:31 UTC
README
Profiler and web debug toolbar for SymPress WordPress kernel applications.
The package records request, runtime, WordPress, and rendering data during development and exposes it through an in-browser toolbar and profiler pages. It is distributed as a Composer-powered WordPress MU plugin and integrates with the SymPress kernel service container.
Installation
composer require --dev sympress/profiler
Install it as a development dependency so production builds (composer install --no-dev) do not ship it. Stored profiles are not redacted, so keep the
profiler out of production deployments.
The package requires PHP 8.5, WordPress 6.9 or newer, and sympress/kernel.
Features
- Symfony-style web debug toolbar for WordPress frontoffice requests
- Profiler pages with searchable stored profiles
- Request, response, performance, memory, and PHP error collection
- WordPress data collectors for hooks, templates, blocks, assets, REST/AJAX, options, cache, cron, plugins, themes, queries, and localization
- HTTP client, database, security, kernel, and runtime diagnostics
- Filesystem profile storage under the kernel cache directory
- Development-only access by default with filter-based overrides
- Optional
SAVEQUERIESactivation for local debug environments - Bundled toolbar icons, styles, templates, and font assets
Usage
When the SymPress kernel discovers the package, it registers
SymPress\Profiler\ProfilerBundle and loads profiler/profiler.php as the MU
plugin entry point.
The profiler collects frontoffice requests in local and development environments by default. The toolbar links each request to a stored profile with all collector panels.
See docs/architecture.md for the hook and persistence
lifecycle. Collector keys, priorities, payload fields, and sensitive data are
cataloged in docs/collectors.json.
<?php add_filter('profiler.collect', static fn (bool $collect): bool => $collect);
The gate opens at plugins_loaded priority −1000, before plugins and themes run
their own plugins_loaded callbacks. Add profiler.enable_outside_development
and profiler.collect_parameter in a MU plugin or at a plugin's file scope.
profiler.collect is asked again before a profile is stored, so returning
false from a theme or a later hook still prevents storage for that request.
The toolbar is injected only into browser page navigations: GET requests whose
Accept header names text/html or application/xhtml+xml. Requests sent with
Accept: */* (fetch, XHR, curl) are profiled without buffering their output.
Collection can also be controlled through the service parameters in
Resources/config/services.yaml:
parameters: profiler.storage_dir: '%kernel.cache_dir%/profiler' profiler.max_profiles: 100 # newest profiles kept on disk profiler.ttl: 172800 # seconds before a profile expires profiler.collect: true profiler.collect_parameter: '' profiler.toolbar.ajax_replace: false
Access Control
Profiler access is enabled automatically for local and development
environments. To enable access outside development, return true from the
profiler.enable_outside_development filter. Users must still be able to manage
WordPress options.
<?php add_filter( 'profiler.enable_outside_development', static fn (bool $enabled, string $environment): bool => $environment === 'staging', 10, 2, );
Development
composer install composer qa
Use composer cs:fix to apply automatic style fixes.
License
This package is licensed under GPL-2.0-or-later.
Bundled third-party assets (Symfony WebProfilerBundle templates, Tabler Icons, JetBrains Mono) keep their own licenses; see NOTICE.