Hi Team,
Our WordPress site is running on PHP 8.2, but the Sentry plugin is not fully compatible with it. We are encountering many deprecated errors, which are impacting our site.
Please make the plugin compatible with PHP 8.2 as soon as possible. It will really help.
Thank you!
]]>I recently discovered that Sentry is causing issues with WP Rocket’s lazy loading for images and iframes. Have you encountered this before? If so, do you have any recommendations for getting them to work well together?
]]>Hi,
thank you very much for this great plugin. In the github docs, I did not see anything about monitoring cronjobs (send checkins, create monitoring configs), but I see the classes are there in the plugin. Could you kindly give me a short hint on how to properly set up cron monitoring using the provided constants from the plugin?
Thank you very much!
Best
Markus
]]>first, thank you for making this. Really good software.
second, I am new, and have been through the docs only a limited count of times yet. Do you have a quick suggestion for adding tags for backend vs front end errors (both php and js would be helpful). I know I can filter the text by user / logged in, which helps, but I imagine when building this for yourself that you had some ideas about isolating or understanding backend problems (admin area, builders, block editor) from front end generated issues affecting users rather than admins. Any tips?
]]>Hi,
I am using wordpress as Headless for JSON REST APIs using it in my Next.js App.
Option-1: is that i can integrated sentry with Next.js but it’s increasing the build and site load time, which i don’t want.
Option-2: If wordpress sentry plugin provide that would be great to monitor the health of my APIs or any potential errors tracking
Please let me know if any plan or any recent version already have this features, or am i missing anything in configuration to get it supported.
Hi Alex,
I hope you’re well and think your plugin is great! It’s really helped me troubleshoot a few issues, with the PHP logging.
Unfortunately Javascript logs are not appearing at all. I’ve setup Sentry and the WP Sentry plugin, however when I send a test error from the your plugin:
Browser test sent successfully, event ID: xxxxx!
(I’ve redacted the actual ID)I’ve gone over all your documentation, as well as the support forum here. I’ve ensured the following:
WP_SENTRY_PHP_DSN
). Here, I’ve ensure the file is present at: /wp-content/plugins/wp-sentry-integration/wp-sentry.php
/wp-content/mu-plugins/wp-sentry-integration.php
and adding the code specified in your documentation.Details on how I setup WP Sentry:
// Sentry PHP tracking
define( 'WP_SENTRY_PHP_DSN', 'https://xxxxx.ingest.us.sentry.io/xxxxx' );
define( 'WP_SENTRY_ERROR_TYPES', E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_USER_DEPRECATED & ~E_USER_NOTICE );
// Sentry Browser Javascript tracking
define( 'WP_SENTRY_BROWSER_DSN', 'https://xxxxx.ingest.us.sentry.io/xxxxx' );
// 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
define( 'WP_SENTRY_ENV', 'production' ); // Define an environment of your site. Defaults to the WordPress environment
require_once __DIR__ . '/wp-content/plugins/wp-sentry-integration/wp-sentry.php'; // Loading Sentry before WordPress
/* That's all, stop editing! Happy publishing. */
My setup on Sentry.io was as follows:
My PHP version is: PHP 8.0 (ea-php80)
I’d super appreciate your help, as to why the browser javascript logging is not working.
Many thanks!
]]>Hi, does this plugin affects the site speed and performance? Thanks.
]]>Hello,
I’d like to ignore all the errors on the site and keep only the errors in my theme and plugin. So I tried your code: https://github.com/stayallive/wp-sentry/tree/v7.3.1?tab=readme-ov-file#capturing-errors-only-from-certain-theme-andor-plugin
Which didn’t really work as I’d hoped.
So I tried to check whether the filter worked like this:
add_filter( 'wp_sentry_options', function ( \Sentry\Options $options ) {
$options->setBeforeSendCallback( function ( \Sentry\Event $event ) {
error_log( "DEBUG SENTRY : HOOK" );
return null;
} );
return $options;
} );
If I’m not too stupid, it shouldn’t log any errors in Sentry. However, most of them are ignored, but not all: https://prnt.sc/IsOC-DmjsSyM
How do you explain this?
]]>Hi,
How can I exclude PHP Warnings to be reported?
Thank you
I’m successfully getting errors logged in Sentry through the plugin, but when trying to use custom Structured Data as per the plugin docs this isn’t coming through with the error. It appears Sentry may have changed their approach to this as their docs use $scope->setContext
instead of $scope->setExtra
though this method doesn’t work in this plugin.
I’d appreciate any pointers on getting this data to flow through to Sentry.
Here’s an example of the code used:
$e = new Exception('Test exception');
if ( function_exists( 'wp_sentry_safe' ) ) {
wp_sentry_safe(function (\Sentry\State\HubInterface $client) use ($e) {
$client->withScope(function (\Sentry\State\Scope $scope) use ($client, $e) {
$scope->setExtra('test_label', 'test_data');
$client->captureException($e);
});
});
}
]]>
Hi! Thanks for a great plugin! We have it installed according to the instructions, but notice we are not receiving php error events in sentry.io
We have two projects running, one php and the other JS. the JS one seems to be working fine.
Any ideas on what we can do to see these PHP events?
While installing, I receive this error on activation. This is on godaddy shared wordpress hosting.
Fatal error: Cannot redeclare Sentry\init() (previously declared in /var/www/wp-content/mu-plugins/vendor/godaddy/mwc-core/vendor/sentry/sentry/src/functions.php:16) in?/var/www/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/functions.php?on line?16
]]>A pen test conducted on our site has reported an issue with mixed content. The issue relates to https://github.com/stayallive/wp-sentry/blob/master/public/wp-sentry-browser.min.js
and refers to making a call to https://www.example.com
can this URL be updated to //www.example.com or https://www.example.com
]]>Hi,
Thanks for the great plugin. Just wondering if it is possible to stop sensitive form submission data (post body) from being sent to sentry?
Thanks
]]>If any error occurs in the website that error is not logging to the sentry.
I’ve added the sentry DSN in the wp-config.php file WP_SENTRY_PHP_DSN still errors are not detecting in the sentry. Please help.
I would like to block a few events from going to Sentry using the before_send
callback, however the events kept on showing on Sentry. I have followed the approach on this topic, but seems it still doesn’t work. Here are the code snippet on my wp-sentry.php to block the issues, could someone point out the mistake?
add_filter( 'wp_sentry_options', function ( \Sentry\Options $options ) { $options->setBeforeSendCallback( function ( \Sentry\Event $event ) { $exceptions = $event->getExceptions(); // Little helper and fallback for PHP versions without the str_contains function $strContainsHelper = function ( $haystack, $needle ) { if ( function_exists( 'str_contains' ) ) { return str_contains( $haystack, $needle ); } return $needle !== '' && mb_strpos( $haystack, $needle ) !== false; }; // No exceptions in the event? Send the event to Sentry, it's most likely a log message if ( empty( $exceptions ) ) { return $event; } if ( $strContainsHelper( $exceptions[0]->getType(), 'UnhandledRejection') && $strContainsHelper( $exceptions[0]->getValue(), 'Non-Error promise rejection captured with value: ')) { return null; } $stacktrace = $exceptions[0]->getStacktrace(); // No stacktrace in the first exception? Send it to Sentry just to be safe then if ( $stacktrace === null ) { return $event; } foreach ( $stacktrace->getFrames() as $frame ) { // Check the the frame happened inside our theme or plugin // Change THEME_NAME and PLUGIN_NAME to whatever is required // And / or modify this
if
statement to detect other variables if ( $strContainsHelper( $frame->getAbsoluteFilePath(), 'utils/build/esm/supports' ) ) { return null; } if ( $strContainsHelper( $frame->getAbsoluteFilePath(), 'addthis_widget' ) ) { return null; } if ( $strContainsHelper( $frame->getAbsoluteFilePath(), 'plugins/addthis') ) { return null; } } // Stacktrace contained no frames in our theme and/or plugin? We send nothing to Sentry return null; } ); return $options; } );
The stacktrace shows that system>exception>stack-trace>frame>module contains 'utils/build/esm/supports'
and 'addthis_widget'
for the two issues I’m trying to filter out.
Would be handy if this plugin supported the new Session Replay feature.
]]>Hi,
it looks like the plugin doesn’t support PHP 8.1 at the moment.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 131072 bytes) in /Users/…/plugins/wp-sentry-integration/build/vendor/clue/stream-filter/src/functions.php on line 242
The reason is the package “clue/stream-filter” (which is a dependency of “php-http/curl-client” via “php-http/message”). This package should be updated to the version ^1.6:
1.6.0 (2022-02-21)
Feature: Support PHP 8.1 release.
$ composer why clue/stream-filter
php-http/message 1.13.0 requires clue/stream-filter (^1.5)
Is it possible to fix this in the next days? ??
Thx!
]]>I’d like to use Sentry to trap everything going in my check like:
if(is_wp_error) {
….
}
I’ve searched in the read.me file but did’nt understood how to do that.
Someone can help me?
]]>Hey Alex, great plugin – it’s working great on our install. Thanks for keeping it up to date!
I have q question regarding performance. Running the Performance Insights on Chrome shows that loading the Sentry script is an expensive task – is there a way to optimize this? I have the sample rate in my wp-config.php to sample 30% of visitors.
]]>Where can I find the project settings or Client Keys? The only tab I can find is “WP Sentry test” under tools.
The Github documentaton proivdes this instruction:
Track PHP errors by adding 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)”:
]]>Hi,
i’ve installed Sentry plugin on WP 5.9.
Following the instructions i succesfully sent a php test error message test from admin.
Sentry got it.
After that… stop.
No error, warning or notice (that i can see inside a wordpress debug log) are cathced by Sentry.
That’s my wp-config sentry settings:
define( 'WP_SENTRY_PHP_DSN', 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' );
define( 'WP_SENTRY_ENV', 'dev' );
define( 'WP_SENTRY_ERROR_TYPES', E_ALL);
define( 'WP_SENTRY_VERSION', 'v6.0.0' );
What i’m doing wrong?
Thanks a lot.
Would it be possible for this to be loaded via CDN?
]]>Hi does the Sentry work locally? I configured everything according to the documentation but I get an error.
https://gyazo.com/c87d63acc48f8de26c6d0b077bdb0eda
https://gyazo.com/3704db6f0709f1d35e50a045dd6a8515
https://gyazo.com/d4447a0913ebce20f4330846d8b90967
The file wp-sentry-browser.min.js
is only partially minified. This affects performance and it triggering a warning in SEMRush. Can this file (and wp-sentry-browser-tracing.min.js
) be minified for the next release?
Please and thank you!
]]>Hi Alex,
Thanks again for the great plugin.
Not sure why, but after getting your plugin working fine with multiple other websites, my latest website gives an console error on load:
Uncaught n: Invalid Sentry Dsn: https://846c67d8ebd34af29ff534a7adc…68(...)
Strange, because sending both a PHP and JavaScript test event from the admin work fine.
Could this be something with the latest version of the plugin?
Cheers!
]]>Hello,
We are getting the following issue:
Access to fetch at 'https://sentryf.ongage.net/api/72/envelope/?sentry_key=a14cd4c11ce14856b899e9d3d5bc1e9c&sentry_version=7' from origin 'https://dev2-www.ongage.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Our sentry is self hosted. We are at the latest version of the plugin (4.16.0)
Is there anything we can do to fix this issue?
Is it possible to exclude wp-admin issues? Here is an example
SyntaxError ?(wp-admin/edit)
Regression
Unhandled
Invalid or unexpected token
/wp-admin/edit.php at line 2751:10
{
from: /wp-admin/edit.php?post_type=shop_order&paged=2,
to: /wp-admin/edit.php?post_type=shop_order&paged=2
}
]]>
Wow. The plugin works amazingly well. Thank you for this.
I see in my Sentry console that there is an outdated SDK warning, should I worry about this?
Perhaps you can quickly release an update to fix this?
]]>Hello
I used this code to capture errors from current child theme only, but I still see many error from parent theme
foreach ( $stacktrace->getFrames() as $frame ) {
// Check the the frame happened inside our theme or plugin
// Change THEME_NAME and PLUGIN_NAME to whatever is required
// And / or modify this <code>if</code> statement to detect other variables
if ( $strContainsHelper( $frame->getFile(), 'themes/brooklyn-child' )
) {
// Send the event to Sentry
return $event;
}
}
Is it possible to ignore the parent theme?
Thanks
]]>