Repository navigation
WordPress
WordPress sites usually have no Composer setup, so the easiest way is the global install: peep() then works in every theme and plugin file without changes.
With Composer (for example in a Bedrock site, or a plugin that has its own vendor/):
composer require shibbirweb/peep --devAdd a peep.php file next to wp-config.php (it is found by walking up from the directory of the script PHP runs):
<?php
return [
'enabled' => true,
'project' => 'blog',
];Keep it out of production deployments, or set 'enabled' => false there.
peep(get_queried_object())->label('Queried object');
peep($wp_query->request)->label('Main query SQL');
peep()->trace();WordPress shows a "critical error" page for fatal errors and hides warnings when WP_DEBUG is off. Send them to Peep from a must-use plugin, which loads before every other plugin. Create wp-content/mu-plugins/peep.php:
<?php
/**
* Plugin Name: Peep
* Description: Sends PHP errors and fatal errors to the Peep viewer.
*/
if (class_exists('ShibbirWeb\\Peep\\Bridge\\ErrorHandler\\ErrorHandler')) {
\ShibbirWeb\Peep\Bridge\ErrorHandler\ErrorHandler::register();
}Without the global install, add require_once for your Composer vendor/autoload.php above the class_exists() check.
WordPress core and many plugins still raise deprecations on new PHP versions, so the viewer can get busy. To see only fatal errors and uncaught exceptions, turn off the first argument:
\ShibbirWeb\Peep\Bridge\ErrorHandler\ErrorHandler::register(false);Errors hidden by error_reporting or the @ operator are still shown, marked silenced, because they are often what you are looking for.
To see which actions run on a request, add this to the must-use plugin while you debug:
add_action('all', function ($hook) {
if (strpos($hook, 'gettext') === false) {
peep()->count($hook);
}
});This wiki is written in docs/wiki; change it there by pull request.
Using Peep
- Getting Started
- Installation
- Version Support
- Configuration
- The Viewer
- API Reference
- API Values
- API Inspecting
- API Control
- API Laravel
- Laravel
- Query Debugging
- Plain PHP
- Symfony
- Slim
- WordPress
- Global Install
- Mail and SMS
- Webhooks
- Logs
- Desktop App
- Finding Leftover Calls
- AI Agents
- Troubleshooting
Working on Peep