Closed androidacy-user closed 2 years ago
I can confirm replacing the two calls to get_bloginfo() with static values is enough for that to work as expected, but for obvious reasons static values won't work for everyone.
Please either correct the documentation, or find out how you can replace the call to a function that isn't defined until wordpress is fully loaded.
Woah, easy there. This was just released in good faith and obviously something was overlooked which can always happen.
Have a little patience while I investigate on how to fix this nicely or submit a PR if you feel like you have a good solution yourself.
This should be fixed in v4.10.1 that was just released.
Still not solved.....
PHP Fatal error: Uncaught Error: Call to undefined function get_bloginfo() in /var/www/www/wp-content/plugins/wp-sentry-integration/src/class-wp-sentry-js-tracker.php:139
Stack trace:
#0 /var/www/www/wp-content/plugins/wp-sentry-integration/src/class-wp-sentry-js-tracker.php(47): WP_Sentry_Js_Tracker->get_default_context()
#1 /var/www/www/wp-content/plugins/wp-sentry-integration/src/class-wp-sentry-js-tracker.php(36): WP_Sentry_Js_Tracker->__construct()
#2 /var/www/www/wp-content/plugins/wp-sentry-integration/wp-sentry.php(99): WP_Sentry_Js_Tracker::get_instance()
#3 /var/www/www/wp-config.php(102): require_once('...')
#4 /var/www/www/wp-load.php(50): require_once('...')
#5 /var/www/www/wp-blog-header.php(13): require_once('...')
#6 /var/www/www/index.php(17): require('...')
#7 {main}
thrown in /var/www/www/wp-content/plugins/wp-sentry-integration/src/class-wp-sentry-js-tracker.php on line 139
I do apologize if I sounded rude, that was not my intention
https://github.com/stayallive/wp-sentry/blob/493626b7d73ac6a143320c0f0bf6df1b3958ab32/src/class-wp-sentry-js-tracker.php#L139-L140
is the problematic code. get_bloginfo()
is not yet defined. I don't know of any other good way to get this information, so I've been hand editing to set those to static values
Since that looks like the JS tracker, there's no reason to load it that early, and it would probably be safer to attempt to load it once we're in the WordPress env proper. You could, perhaps, add a couple action hooks so that logic doesn't get executed until we know we have the proper info ready.
My apologies, in the rush trying to get multiple fixes out I totally forgot to even look at the JavaScript side assuming it worked (never assume, never rush).
This time it should be fixed in v4.10.2 that was just released. The JS tracker did way too much way to early anyway as you suspected.
Waiting for the update to roll out to my site, but no problem. I do a bit of work with plugin development myself (custom plugin for some behind the scenes API interaction and authentication) myself, so i kinda get it. It's always the simple mistakes that get you the hardest 😆
Yeah WordPress plugin repo is alway a little slow with the release processing, it'll get there!
Do let me know if it's broken still for some reason of course but I think I got all the "edge" cases this time 😄
https://github.com/stayallive/wp-sentry#loading-sentry-before-wordpress says you can now add the call to sentry in wp-config, but it throws an error:
Please either correct the documentation, or find out how you can replace the call to a function that isn't defined until wordpress is fully loaded.