WordPress

WordPress and WooCommerce Plugin

Free on every plan, including the free one
Where to get it WordPress.org plugin directory
Requirements WordPress 5.6+, PHP 7.2+
Package name dockray
Pricing Free

What it is for

The official DockRay plugin connects WordPress to the monitoring platform and automatically reports PHP errors and unhandled exceptions. Issues from WordPress, the active theme, installed plugins, or WooCommerce are sent directly to the DockRay dashboard.

Error Information

Reported events can include:

  • the error type and message,
  • where the error occurred and the stack trace,
  • environment and application version information,
  • context related to the request being processed.

You can customize which PHP errors are reported to reduce the collection of less relevant events.

Simple Configuration

You can configure the integration under Settings → DockRay by entering your project token and private key. The credentials can also be defined in the wp-config.php file.

Privacy and Developer Features

By default, DockRay does not send user data. You can optionally enable additional context such as the user ID, email address, IP address, or user agent.

The plugin also allows you to add custom tags and context, modify the client configuration, and manually report exceptions from your code.

Installation

Installation from the WordPress Plugin Directory

  1. In the WordPress dashboard, go to Plugins → Add New.
  2. Search for DockRay and click Install Now.
  3. Once the installation is complete, click Activate.
  4. Go to Settings → DockRay.
  5. Enter the project token and private key available in the DockRay dashboard and save the settings.
  6. Use the Send Test Event button to verify that the connection is working correctly.

Once configured, the plugin will automatically start reporting supported errors and exceptions to your project in DockRay.

Configuration via wp-config.php

If you do not want to store credentials in the WordPress database, you can define the project token and private key directly in the wp-config.php file:

define( 'DOCK_RAY_TOKEN', 'YOUR_PROJECT_TOKEN' );
define( 'DOCK_RAY_PRIVATE_KEY', 'YOUR_PRIVATE_KEY' );

Add these constants before the comment marking the end of the editable section in wp-config.php. Once saved, the plugin will automatically detect the configuration, and its source will be shown under Settings → DockRay.

Installation from a ZIP File

  1. Download the latest version of the DockRay plugin from WordPress.org.
  2. In the WordPress dashboard, go to Plugins → Add New → Upload Plugin.
  3. Select the downloaded ZIP file and start the installation.
  4. Activate the plugin.
  5. Go to Settings → DockRay and configure the connection to your project.

How to use it

The integration reports exceptions on its own. This is for the reports you send deliberately.

php
<?php

if ( function_exists( 'dock_ray_safe' ) ) {
    dock_ray_safe( fn( $hub ) => $hub->captureMessage( 'Error message...' ) );
}

try {
    $order->finalize();
} catch ( Throwable $e ) {
    if ( function_exists( 'dock_ray_safe' ) ) {
        dock_ray_safe( fn( $hub ) => $hub->captureException( $e ) );
    }
}

Knowledge base articles

Start Monitoring

Connect your first application and get full visibility into what’s happening in production.

DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.