Contributors: @sewmyheadon
Tags: development, tools, dev tools
Requires at least: 4.5
Tested up to: 5.0.2
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Bug Spray is a WordPress plugin that contains a small suite of developer tools to make WordPress development and debugging easier and more fun.
This plugin includes:
- Composer - Manage PHP dependencies.
- Kint - Helpful replacement for var_dump(), print_r() and debug_backtrace().
- Whoops - Replaces default PHP orange error table with information you can actually use.
- Grunt - Used only if you wish to help develop this plugin further. Grunt is used for i18n and readme.txt to readme.md conversion.
Composer must already be installed on your system.
- Clone this project into a directory within
wp-content/plugins/
. - Use Terminal to
cd
into the plugin directory and runcomposer install
. This will load this plugin's dependencies. - If you are developing Bug Spray rather than using it for development, run
npm install
from the plugin directory. - Log into your WordPress site
- Activate the plugin.
Once you have installed and activated Bug Spray, your WordPress Admin bar will turn orange.
Kint is debugging tool for PHP developers.
Kint is (not) just a pretty replacement for var_dump(), print_r() and debug_backtrace()
Once activated you can use the following functions to help troubleshoot code:
d()
- Dumps dataddd()
- Dumps data and dies
Just wrap these functions around a variable and you'll get a nicer visual presentation of the variable data.
When your PHP code has an error, Whoops will whip the error codes into a more helpful, readable format to make debugging easier.
There's also a sandbox.php file in the src
directory that you can use to try out code.
- Currently, this is the official documentation. Docs for Composer, Kint, and Whoops can be found on their respective sites.
- You can post issues on Github.
Feel free to contribute pull requests.
This plugin is inspired by Tonya Mork of KnowTheCode, who has a great tutorial on building this plugin on KnowTheCode.io.
GPL v2 license. See LICENSE for full details.