It is recommended to use the plugins interface in WordPress to install this plugin.
If manual installation is required, please make sure that the plugin files are in a folder named “wp-sentry-integration” in the WordPress plugins folder, usually “wp-content/plugins”.
To start using the plugin first setup the DSN for either the PHP side or the Browser side or both.
All other configuration options are optional but it’s advised you read through them to see if any are applicable to you or are thing you’d like to configure.
You can find more information and the full documentation: here. The following are the basics.
Note: When configuring constants in your wp-config.php do this before the That's all, stop editing! Happy publishing. line, otherwise they won’t work!
Note: this plugin does not do anything by default and has only a admin interface to test the integration and view it’s configuration. A Sentry DSN must be configured in your wp-config.php.
Sentry uses something called a DSN (read more) to configure the SDK.
To track PHP errors add this snippet to your wp-config.php and replace PHP_DSN with your actual DSN that you find inside Sentry in the project settings under “Client Keys (DSN)”:
define( 'WP_SENTRY_PHP_DSN', 'PHP_DSN' );
Note: Do not set this constant to disable the PHP tracker.
To track Browser (JavaScript) errors add this snippet to your wp-config.php and replace JS_DSN with your actual DSN that you find inside Sentry in the project settings under “Client Keys (DSN)”:
define( 'WP_SENTRY_BROWSER_DSN', 'JS_DSN' );
// You can _optionally_ enable or disable the JavaScript tracker in certain parts of your site with these constants:
define('WP_SENTRY_BROWSER_ADMIN_ENABLED', true); // Add the JavaScript tracker to the admin area. Default: true
define('WP_SENTRY_BROWSER_LOGIN_ENABLED', true); // Add the JavaScript tracker to the login page. Default: true
define('WP_SENTRY_BROWSER_FRONTEND_ENABLED', true); // Add the JavaScript tracker to the front end. Default: true
Note: Do not set this constant to disable the Browser (JavaScript) tracker.
You can find more information and the full documentation: here. The above are the basics.