A WordPress plugin for error tracking with Honeybadger.
- PHP 7.3 or higher
- WordPress 5.3 or higher
- Honeybadger account and API key
- Install the plugin from the WordPress Plugin Directory, or upload the plugin files to the
/wp-content/plugins/honeybadger-application-monitoring
directory. - Activate the plugin through the 'Plugins' screen in WordPress.
- Use the Settings->Honeybadger screen to configure the plugin.
- Ensure you have a Honeybadger account and obtain your API key(s). It is recommended that you have 2 separate projects, one for PHP and another for JavaScript error monitoring.
- Enter your Honeybadger API key(s) in the plugin settings to start monitoring errors. Ensure that "PHP error reporting enabled" option is checked to enable automatic error reporting for the PHP code. Same goes for the "JS error reporting enabled" option.
- Optionally, you can check the "Send test notification" options to test the integration upon clicking save. Note: You should uncheck these options (make sure to click Save) after you've verified that error reporting works.
- WordPress admin integration
- PHP error tracking
- JavaScript error tracking
- User context tracking
- Custom error type filtering
The test environment was setup using the official WP-CLI plugin. To run the tests locally, you need to have the following installed:
- PHP (
brew install php && brew services start php
) - MySQL (
brew install mysql && brew services start mysql
) - Subversion (
brew install svn
)
Then:
- Run
composer install
. - Run
bash bin/install-wp-tests.sh wordpress_test root '' localhost latest
. This will install Wordpress to a/tmp
folder, along with a databasewordpress_test
. - Run
./vendor/bin/phpunit
- Update the version number in
hbapp-honeybadger-plugin.php
(both the PHPDoc and the env variableHBAPP_HONEYBADGER_VERSION
). - Update the
readme.txt
file with the new version number. - Push a new tag to the repository with the new version number.
- The previous step should trigger the GitHub Actions workflow to build the plugin and deploy it to the WordPress Plugin Directory.
A working WordPress installation is necessary to use the plugin during development.
Once WordPress is up and running:
- Run
composer install
in the plugin folder to install dependencies - Run
ln -s /absolute/path/to/honeybadger-wordpress /absolute/path/to/wordpress/wp-content/plugins/honeybadger-application-monitoring
Now any changes to the plugin code will be reflected immediately in your local WordPress installation.
For issues and feature requests, please create an issue on GitHub.
This project is licensed under the GPLv2 license - see the LICENSE file for details.