WordPress Sentry

Description

This plugin can report PHP errors and Browser (JavaScript) errors to Sentry.

It will auto detect authenticated users and add context where possible. All context/tags can be adjusted/expanded using filters.

For more information and documentation have a look at the full documentation.

Contributors

See: github.com/stayallive/wp-sentry/graphs/contributors

Installation

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.

Reviews

18 Disember 2023
Very easy to set up and all your errors automatically get tracked by Sentry.
28 Julai 2023
This plugin is super easy to use. Sentry allows us to have so much more insight into exceptions/errors occurring. And the plugin is open source!
20 Februari 2023 6 replies
Just one thing - it would be much more convenient if you could set up the variables inside admin-panel instead of editing wp-config file (especially in case when you don't have one in your repository due to Docker-based installation)
10 Januari 2022
This plugin is fantastic. It is simple and fast, and it does exactly what it needs to, with no extra fluff. Also, the support is top-tier. Alex responded with an immediate solution.
15 Oktober 2021
It works like a charm ! Thank you so much 🙂
Read all 15 reviews

Contributors & Developers

“WordPress Sentry” adalah perisian sumber terbuka. Orang-orang berikut telah menyumbang kepada pemalam ini.

Penyumbang

Changelog

7.8.0

  • Add new wp_sentry_before_send filter to allow modifying or discarding a PHP error event before it’s sent to Sentry (#180, thanks @herewithme)
  • Update Sentry Browser to version 7.103.0

7.7.0

  • Update PHP SDK to version 4.6.0
  • Update Sentry Browser to version 7.101.0

7.6.0

  • Update Sentry Browser to version 7.100.0

7.5.1

  • Fix the rendering of installation instructions on the WordPress plugin directory

7.5.0

  • Update PHP SDK to version 4.5.0
  • Update Sentry Browser to version 7.98.0

7.4.0

  • Update Sentry Browser to version 7.94.1

7.3.1

  • Update browser bundles to contain changes from 7.3.0

7.3.0

  • Browser: Call wp_sentry_hook after setting up the integrations to allow the user modifying the integrations array from the hook

7.2.1

  • Fix using is_plugin_active_for_network unconditionally which is not always available

7.2.0

  • Update PHP SDK to version 4.3.1
  • Update Sentry Browser to version 7.91.0
  • Improve handling of the default version especially when in a network environment using a child theme (#171)

7.1.0

  • Update PHP SDK to version 4.0.1
  • Update Sentry Browser to version 7.80.0

7.0.0

Note: This is a breaking release for the PHP SDK, please test it well and read the migration guides if applicable before upgrading!

If you are doing anything more than just have this plugin installed and a DSN configured in your wp-config.php, check out the upgrade docs:

  • PHP SDK: https://github.com/getsentry/sentry-php/blob/master/UPGRADE-4.0.md

  • Update PHP SDK to version 4.0.0

  • Update Sentry Browser to version 7.77.0

6.28.0

  • Update PHP SDK to version 3.22.0
  • Update Sentry Browser to version 7.76.0

6.27.0

  • Update Sentry Browser to version 7.74.0

6.26.0

  • Update Sentry Browser to version 7.73.0
  • Improved admin tools page with documentation links and a more clear layout

6.25.0

  • Update Sentry Browser to version 7.70.0

6.24.0

  • Update PHP SDK to version 3.21.0
  • Update Sentry Browser to version 7.67.0

6.23.0

  • Update Sentry Browser to version 7.60.0

6.22.1

  • Update Sentry Browser to version 7.59.3

6.22.0

  • Update Sentry Browser to version 7.59.1

6.21.0

  • Default Sentry release to current theme version

6.20.0

  • Update PHP SDK to version 3.20.1
  • Update Sentry Browser to version 7.57.0

6.19.0

  • Update Sentry Browser to version 7.56.0

6.18.1

  • Update Sentry Browser to version 7.55.2

6.18.0

  • Update Sentry Browser to version 7.55.0

6.17.0

  • Update Sentry Browser to version 7.54.0

6.16.0

  • Update PHP SDK to version 3.19.1
  • Update Sentry Browser to version 7.53.1

6.15.0

  • No longer rely on the WP_HTTP_Proxy class to configure the HTTP proxy, this allows you to initialize the SDK before WordPress is fully loaded
  • Add WP_SENTRY_BROWSER_FRONTEND_ENABLED, WP_SENTRY_BROWSER_ADMIN_ENABLED and WP_SENTRY_BROWSER_LOGIN_ENABLED constants to enable/disable the browser SDK on the frontend, admin and login pages respectively (they are enabled by default)
  • Update PHP SDK to version 3.18.2
  • Update Sentry Browser to version 7.52.1

6.14.0

  • Update PHP SDK to version 3.18.0
  • Update Sentry Browser to version 7.51.2

6.13.0

  • Update PHP SDK to version 3.17.0
  • Update Sentry Browser to version 7.49.0

6.12.0

  • Update Sentry Browser to version 7.46.0
  • Allow regexes to be used in the new ignoreTransactions option of the browser SDK

6.11.0

If you are using an HTTP proxy in WordPress but don’t want Sentry to use it you should configure WP_PROXY_BYPASS_HOSTS to include the Sentry domain.

6.10.0

  • Add WP_SENTRY_BROWSER_REPLAYS_SESSION_SAMPLE_RATE and WP_SENTRY_BROWSER_REPLAYS_ON_ERROR_SAMPLE_RATE options to enable browser session replays
  • Add WP_SENTRY_BROWSER_SESSION_REPLAY_OPTIONS to configure options passed to new Replays() when browser session replays are enabled
  • Add WP_SENTRY_BROWSER_TRACING_OPTIONS to configure options passed to new BrowserTracing() when browser tracing is enabled
  • Allow regexes to be used in the ignoreErrors option of the browser SDK

6.9.0

  • Update PHP SDK to version 3.16.0
  • Update Sentry Browser to version 7.45.0

6.8.0

  • Update PHP SDK to version 3.14.0
  • Update Sentry Browser to version 7.41.0

6.7.0

  • Update PHP SDK to version 3.13.1
  • Update Sentry Browser to version 7.37.2

6.6.0

  • Update PHP SDK to version 3.12.1
  • Update Sentry Browser to version 7.34.0

6.5.0

  • Update Sentry Browser to version 7.28.0

6.4.0

  • Update Sentry Browser to version 7.26.0

6.3.0

  • Update Sentry Browser to version 7.24.2

6.2.0

  • Update PHP SDK to version 3.12.0
  • Update Sentry Browser to version 7.23.0

6.1.0

  • Update PHP SDK to version 3.9.1
  • Update Sentry Browser to version 7.16.0

6.0.0

Note: This is a breaking release for the Browser/JavaScript SDK

Since 5.0.0 of this plugin, which bundles the Browser SDK version 7, the whitelistUrls and blacklistUrls are no longer working. They are renamed to allowUrls and denyUrls respectively, please update your code if you are using those options.

Since this version of the plugin we no longer bundle the ES5 versions of the Browser SDK by default, which means that if you still need to support older browsers (Internet Explorer 11 mainly) you need to enable the new WP_SENTRY_BROWSER_USE_ES5_BUNDLES option by setting it to true. Enabling the ES5 bundles will also loads an externally hosted polyfill library for the needed polyfills.

If you are still on a WP Sentry version older than version 5.0.0 don’t forget to see the Browser SDK v7 migration guide.

  • Browser: Bundle ES6 compiled browser SDK by default
  • Browser: Introduce new WP_SENTRY_BROWSER_USE_ES5_BUNDLES flag to enable ES5 bundles + external hosted polyfill library
  • Browser: Fix broken whitelistUrls and blacklistUrls which are now called allowUrls and denyUrls options (thanks @dr5hn)

5.2.0

  • Update PHP SDK to version 3.7.0
  • Update Sentry Browser to version 7.10.0
  • Fix potential error when using wp_sentry_options filter when no DSN is set

5.1.0

  • Update PHP SDK to version 3.6.0
  • Update Sentry Browser to version 7.2.0

5.0.0

Note: This is a breaking release for the Browser/JavaScript SDK, please test it well and read the migration guides if applicable before upgrading!
Note: The v7 version of the JavaScript SDK requires a self-hosted version of Sentry 20.6.0 or higher. If you are using a version of self-hosted Sentry (aka onpremise) older than 20.6.0 then you will need to upgrade.

Version 7 of the Sentry JavaScript SDK brings a variety of features and fixes including bundle size and performance improvements, brand new integrations, support for the attachments API, and key bug fixes.
This release does not change or remove any top level public API methods (captureException, captureMessage), and only requires changes to certain configuration options or custom clients/integrations/transports.
For detailed overview of all the changes, please see the v7 migration guide.

  • Update Sentry Browser to version 7.1.1

4.18.0

  • Update PHP SDK to version 3.5.0

4.17.0

  • Fix Sentry Browser context (thanks @giilby)
  • Update Sentry Browser to version 6.19.7

4.16.0

  • Update Sentry Browser to version 6.19.3
  • Bump version of bundled guzzlehttp/psr7 dependency (https://github.com/advisories/GHSA-q7rv-6hp3-vh96)

4.15.0

  • Update PHP SDK to version 3.4.0
  • Update Sentry Browser to version 6.18.2

4.14.0

4.13.1

  • The plugin is now tested on WordPress 5.9

4.13.0

  • Update PHP SDK to version 3.3.7
  • Update Sentry Browser to version 6.17.2
  • Fix possible undefined index notice on admin page

4.12.0

  • Update PHP SDK to version 3.3.6
  • Use WPINC constant instead of hardcoded path to wp-includes

4.11.0

  • Update PHP SDK to version 3.3.5
  • Update Sentry Browser to version 6.16.1

4.10.3

  • Fix possible composer autoloader conflict with Sentry SDK helpers file

4.10.2

  • Fix problem loading plugin in wp-config.php with browser DSN enabled

4.10.1

  • Fix Interface 'Stringable' not found on PHP < 8.0
  • Fix problem loading plugin in wp-config.php without WP_SENTRY_VERSION defined

4.10.0

  • Allow loading the plugin from wp-config.php before WordPress is loaded (see documentation) (thanks @ocean90)
  • Add support for modifying the Sentry PHP SDK ClientBuilder builder (see documentation)

4.9.0

  • Update Sentry Browser to version 6.15.0

4.8.0

  • Update PHP SDK to version 3.3.4
  • Update Sentry Browser to version 6.14.1

4.7.0

  • Update PHP SDK to version 3.3.3
  • Update Sentry Browser to version 6.13.2

4.6.0

  • Update PHP SDK to version 3.3.2
  • Update Sentry Browser to version 6.11.0

4.5.0

  • Update Sentry Browser to version 6.8.0

4.4.1

  • Update PHP SDK to version 3.3.1
  • Update Sentry Browser to version …