I would be great to use this plugin to enable/disable Bugsnag Frontend and Performance monitoring. I have this functionality current implemented as part of a plugin or in the theme itself using the following code (this includes setting the version using theme/plugin versioning):
<?php
function configure_bugsnag(): void
{
global $bugsnagWordpress;
if (!isset($bugsnagWordpress)) {
return;
}
$bugsnagWordpress->setContext(wp_get_theme()->get('title'));
$version = wp_get_theme()->get('Version');
$bugsnagWordpress->setAppVersion($version);
$bugsnagWordpress->setBeforeNotifyFunction(function ($error) {
$plugin_data = get_plugin_data( __FILE__ );
if (isset($plugin_data['Name']) && $plugin_data['Name']) {
$error->setMetaData([
'plugin' => $plugin_data
]);
}
});
// Add frontend sessions
if (defined('BUGSNAG_FE') && BUGSNAG_FE) {
add_action('wp_enqueue_scripts', function () use ($version) {
wp_enqueue_script(
'bugsnag_fe',
'//d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js',
[],
'v7'
);
wp_add_inline_script(
'bugsnag_fe',
"Bugsnag.start({
apiKey:'".get_site_option('bugsnag_api_key')."',
appVersion:'$version'
})"
);
}, 1);
}
// Add performance tracking
if (defined('BUGSNAG_PERF') && BUGSNAG_PERF) {
add_action('wp_enqueue_scripts', function () use ($version) {
wp_enqueue_script(
'bugsnag_perf',
'//d2wy8f7a9ursnm.cloudfront.net/v2.1.0/bugsnag-performance.min.js',
[],
'v1'
);
wp_add_inline_script(
'bugsnag_perf',
"BugsnagPerformance.start({
apiKey:'".get_site_option('bugsnag_api_key')."',
appVersion:'$version'
})"
);
}, 2);
}
}
configure_bugsnag();
]]>
Hi there,
The current version of this plugin is not compatible with PHP8.0.
Here is the error log:
30-Mar-2021 08:42:16 UTC] PHP Fatal error: Uncaught ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option in ../plugins/bugsnag/bugsnag-php/Notification.php:239
#0 ../plugins/bugsnag/bugsnag-php/Notification.php(239): curl_setopt()
#1 ../plugins/bugsnag/bugsnag-php/Notification.php(164): Bugsnag_Notification->postWithCurl()
#2 ../plugins/bugsnag/bugsnag-php/Notification.php(124): Bugsnag_Notification->postJSON()
#3 ../plugins/bugsnag/bugsnag-php/Client.php(638): Bugsnag_Notification->deliver()
Is there an update on the way?
]]>Hi,
I can’t activate Automatically Paginate Posts (APP) plugin on my website because there is a conflict with Bugsnag plugin.
I love your tool and I can’t run my customer website without it. But I need APP plugin running as well.
Could you help me, please?
]]>Expected behavior
$bugsnagWordpress->setNotifyReleaseStages([‘production’]);
Should only report errors from production env
Observed behavior
Reports errors from all env
Steps to reproduce
– Install plugin
– Add $bugsnagWordpress->setNotifyReleaseStages([‘production’]); to the theme functions file
– Produce an error/exception
Version
1.3.1
Additional information
In Configuration.php in the method shouldNotify is $this->notifyReleaseStages = NULL, setNotifyReleaseStages in Client.php is never triggered for what I was able to debug.
https://docs.bugsnag.com/platforms/php/wordpress/configuration-options/#setnotifyreleasestages
Also added on Github: https://github.com/bugsnag/bugsnag-wordpress/issues/33
]]>Hey all,
I would like to enquire about multisite support for this plugin?
If it’s network activated, the settings won’t show in the plugins list per site. If you turn off network activate and then enabled it on each site, the settings link (and page) is then available.
I tried to access the page with the plugin network activated and it would not let me.
As i run several multisite networks, this would be very useful.
]]>For a while now I was getting a notice about end of life for v1 of the Bugsnag Data Access API (July 10th).
Will this plugin be updated to accommodate the changes?
]]>When developing locally I would like to use PHP’s native error handler instead of Bugsnag’s, but still have the same code base/database for my local and live server (and not being forced to manually deactivate the plugin for different servers).
ATM it’s impossible to override with the bugsnag_set_error_and_exception_handlers
filter from within functions.php (since it’s applied directly when the plugin loads (which is before the theme)). Would it be possible to run constructBugsnag()
in the init
hook or similar, and not directly when the plugin is loaded? That way I could disable bugsnag’s error handlers depending on my debug environment variable from within the theme’s function.php.
I also tried running restore_error_handler();
, but that results in this warning:
strpos(): Empty needle in plugins\bugsnag\bugsnag-php\Error.php on line 386
]]>
Hello,
I would love to see multisite support for this plugin added. In WordPress multisite, currently the site admin has to manually enter the API key for every single site. It would be nice to be able to enter the API key and configuration once on the network settings page and apply it to all of the blogs.
]]>