Download the PHP package itgalaxy/sentry-integration without Composer

On this page you can find all versions of the php package itgalaxy/sentry-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sentry-integration

Sentry Integration

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License composer.lock

A (unofficial) WordPress plugin to report PHP, JavaScript and security headers (Expect-CT and X-XSS-Protection) errors to Sentry.

Introduction

This plugin can report PHP errors (optionally), JavaScript errors (optionally) and security headers (Expect-CT and X-XSS-Protection) (optionally) to Sentry and integrates with its release tracking.

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

Usage

  1. Install this plugin by cloning or copying this repository to your wp-contents/plugins folder
  2. Configure your DSN as explained below
  3. Activate the plugin through the WordPress admin interface

Note: this plugin does not do anything by default and has no admin interface. A DSN must be configured first.

Configuration

PHP tracker

Track PHP errors by adding this snippet to your wp-config.php and replace ADDRESS_YOUR_DSN with your actual DSN that you find in Sentry:

Note: Do not set this constant to disable the PHP tracker.


(Optionally) Set the error types the PHP tracker will track:

JavaScript tracker

Track JavaScript errors by adding this snippet to your wp-config.php and replace PUBLIC_ADDRESS_YOUR_DSN with your actual public DSN that you find in Sentry (never use your private DSN):

Note: Do not set this constant to disable the JavaScript tracker.


(Optionally) You can control how plugin should register and enqueue sentry JavaScript script (i.e. raven.min.js):

There are 3 values for SENTRY_INTEGRATION_PUBLIC_DSN_ENQUEUE_MODE constant.

  1. inline (by default for better performance and avoid problems with order scripts from other plugins/themes) - print inline script and configuration in head html tag.
  2. standard - use standard WordPress api for scripts (i.e. using wp_register_script, wp_enqueue_script and wp_add_inline_script functions on wp_enqueue_scripts, login_enqueue_scripts and admin_enqueue_scripts actions).
  3. manual - don't register and enqueue script and configuration. You should manually register and enqueue sentry JavaScript script with configuration.

Expect-CT header tracker

Track Expect-CT header errors by adding this snippet to your wp-config.php and replace ADDRESS_YOUR_DSN with your actual DSN that you find in Sentry:

Note: Do not set this constant to disable the Expect-CT tracker. Note: You should send Expect-CT header with report-uri="http://you-site.com/sentry-integration/expect-ct/report/" using .htaccess, php or another prefer method. See more about Expect-CT header.

X-XSS-Protection tracker

Track X-XSS-Protection header errors by adding this snippet to your wp-config.php and replace ADDRESS_YOUR_DSN with your actual DSN that you find in Sentry:

Note: Do not set this constant to disable the X-XSS-Protection tracker. Note: You should send X-XSS-Protection header with report="http://you-site.com/sentry-integration/x-xss-protection/report/" using .htaccess, php or another prefer method. See more about X-XSS-Protection header.

Common configuration for all trackers

(Optionally) Define a version of your site; by default the theme version will be used. This is used for tracking at which version of your site the error occurred. When combined with release tracking this is a very powerful feature.

(Optionally) Define an environment of your site. Defaults to unspecified.

Note: By default SENTRY_INTEGRATION_VERSION constant contains wp_get_theme()->get('Version') result.

Filters

This plugin provides the following filters to plugin/theme developers.

Please note that some filters are fired when the Sentry trackers are initialized so they won't fire if you define them in you theme or in a plugin that loads after Sentry Integration does.

For PHP, JavaScript, Expect-CT and X-XSS-Protection trackers

sentry_integration_user_context (array)

You can use this filter to extend the Sentry user context for both PHP, JS and security headers trackers.

WARNING: These values are exposed to the public in the JS tracker, so make sure you do not expose anything private!

Example usage:

Note: _This filter fires on the WordPress set_current_user action._

Specific to PHP tracker

sentry_integration_dsn (string)

You can use this filter to override the Sentry DSN used for the PHP tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_options (array)

You can use this filter to customize the Sentry options used to initialize the PHP tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_send_data (array|bool)

Provide a function which will be called before Sentry PHP tracker sends any data, allowing you both to mutate that data, as well as prevent it from being sent to the server.

Example usage:

Note: This filter fires whenever the Sentry SDK is sending data to the Sentry server.

Specific to JavaScript tracker

sentry_integration_public_dsn (string)

You can use this filter to override the Sentry DSN used for the JS tracker.

WARNING: This value is exposed to the public, so make sure you do not use your private DSN!

Example usage:


sentry_integration_public_options (array)

You can use this filter to customize/override the sentry options used to initialize the JS tracker.

WARNING: These values are exposed to the public, so make sure you do not expose anything private !

Example usage:

Specific to Expect-CT tracker

sentry_integration_expect_ct_dsn (string)

You can use this filter to override the Sentry DSN used for the Expect-CT tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_expect_ct_options (array)

You can use this filter to customize the Sentry options used to initialize the Expect-CT tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_expect_ct_send_data (array|bool)

Provide a function which will be called before Sentry Expect-CT tracker sends any data, allowing you both to mutate that data, as well as prevent it from being sent to the server.

Example usage:

Note: This filter fires whenever the Sentry SDK is sending data to the Sentry server.

Specific to X-XSS-Protection tracker

sentry_integration_x_xss_protection_dsn (string)

You can use this filter to override the Sentry DSN used for the X-XSS-Protection tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_x_xss_protection_options (array)

You can use this filter to customize the Sentry options used to initialize the Expect-CT tracker.

Example usage:

Note: _This filter fires on when Sentry Integration initializes and after the WP after_setup_theme._


sentry_integration_x_xss_protection_send_data (array|bool)

Provide a function which will be called before Sentry Expect-CT tracker sends any data, allowing you both to mutate that data, as well as prevent it from being sent to the server.

Example usage:

Note: This filter fires whenever the Sentry SDK is sending data to the Sentry server.

Catching plugin errors

Since this plugin is called sentry-integration it loads a bit late which could miss errors or notices occuring in plugins that load before it.

You can remedy this by loading WordPress Sentry as a must-use plugin by creating the file wp-content/mu-plugins/sentry-integration.php (if the mu-plugins directory does not exists you must create that too).

Now sentry-integration will load always and before all other plugins.

Note: We advise you leave the original sentry-integration in the /wp-content/plugins folder to still have updates come in through the WordPress updater. However enabling or disabling does nothing if the above script is active (since it will always be enabled).

License

Sentry Integration plugin is open-sourced software licensed under the MIT license.


All versions of sentry-integration with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
sentry/sentry Version ^1.10
composer/installers Version ^1.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itgalaxy/sentry-integration contains the following files

Loading the files please wait ....