diff --git a/composer.json b/composer.json index 487ade6..94113ed 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,9 @@ "php": ">=7.0", "arrilot/dotenv-php": "^1.0", "a7/autoload": ">=2", - - "zeek/php-utils": ">=2" + + "zeek/php-utils": ">=2", + + "zeek/wp-sentry": "^1.0" } } diff --git a/src/bootstrap/bootstrap.php b/src/bootstrap/bootstrap.php index 0c654e5..88c34b9 100644 --- a/src/bootstrap/bootstrap.php +++ b/src/bootstrap/bootstrap.php @@ -14,8 +14,6 @@ function bootstrap( $dir ) { /** * Add Sentry Error Logging */ - // @todo remove old call - //ErrorHandling::init(); WpSentry::init(); /** diff --git a/src/third-party/Sentry.php b/src/third-party/Sentry.php deleted file mode 100644 index 233c989..0000000 --- a/src/third-party/Sentry.php +++ /dev/null @@ -1,136 +0,0 @@ - function ( $data ) use ( $exclusions ) { - - if ( static::lite_mode_enabled() && ! ( $data['force'] ?? false ) ) { - return false; - } - - if ( 'error' === $data['level'] ) { - return $data; - } - - $value = $data['exception']['values'][0]['value'] ?? null; - - if ( empty( $value ) ) { - return $data; - } - - if ( in_array( $value, $exclusions ) ) { - return false; - } - - return $data; - }, - ]; - - self::$client = new \Raven_Client( static::$sentry_url, $options ); - self::$client->install(); - - return self::$client; - } - - /** - * @return \Raven_Client - */ - static function get_client() { - if ( empty( self::$client ) ) { - self::init(); - } - - return self::$client; - } - - - static function capture( $exception ) { - if ( empty( self::$client ) ) { - return; - } - - self::$client->captureException( $exception, [ 'force' => true ] ); - } - - /** - * Enqueue the Sentry Javascript SDK. - */ - public static function js_enqueue_sentry_sdk() { - wp_enqueue_script( - 'sentry', - sprintf( 'https://browser.sentry-cdn.com/%s/bundle.min.js', static::SENTRY_JS_SDK_VERSION ) - ); - } - - /** - * Initialize the Sentry Javascript SDK. - */ - public static function js_init_sentry_sdk() { - ?> - -