stayallive / wp-sentry

A (unofficial) WordPress plugin reporting PHP and JavaScript errors to Sentry.
https://wordpress.org/plugins/wp-sentry-integration/
MIT License
305 stars 48 forks source link

Fatal error in WP 6.0 #133

Closed andrewdcato closed 2 years ago

andrewdcato commented 2 years ago

Hello - I'm getting a fatal error on plugin activation when configuring this in my site.

Installation Details:

Plugin Config:

Here's what I have for plugin config in my wp-config.php file (DSN has been redacted for obvious reasons):

/** Configures WP Sentry */
require_once ABSPATH . 'wp-content/plugins/wp-sentry-integration/wp-sentry.php';
define( 'WP_SENTRY_PHP_DSN', 'https://<secret>@<secret>.ingest.sentry.io/<secret>' );

/* That's all, stop editing! Happy publishing. */

And here is the what I am seeing in my WP Debug log:

[29-Jun-2022 16:50:31 UTC] PHP Fatal error:  Uncaught Error: Undefined constant 'CURLOPT_TIMEOUT' in /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/HttpClient/HttpClientFactory.php:104
Stack trace:
#0 /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/HttpClient/HttpClientFactory.php(76): Sentry\HttpClient\HttpClientFactory->resolveClient()
#1 /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/Transport/DefaultTransportFactory.php(57): Sentry\HttpClient\HttpClientFactory->create()
#2 /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/ClientBuilder.php(143): Sentry\Transport\DefaultTransportFactory->create()
#3 /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/ClientBuilder.php(131): Sentry\ClientBuilder->createTransportInstance()
#4 /var/www/blog/wp-content/plugins/wp-sentry-integration/src/class-wp-sentry-php-tracker.php(211): Sentry\ClientBuilder->getClient()
#5 /var/www/blo in /var/www/blog/wp-content/plugins/wp-sentry-integration/build/vendor/sentry/sentry/src/HttpClient/HttpClientFactory.php on line 104
[29-Jun-2022 16:50:31 UTC] PHP Notice:  Function is_embed was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /var/www/blog/wp-includes/functions.php on line 5831
[29-Jun-2022 16:50:31 UTC] PHP Notice:  Function is_search was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /var/www/blog/wp-includes/functions.php on line 5831
stayallive commented 2 years ago

Does your PHP installation have the cURL extension enabled? It sounds like that might be missing 🤔

andrewdcato commented 2 years ago

That seems to have resolved the issue for the PHP error tracking! Thanks for the quick response, @stayallive.

I can open a PR for the README to document this dependency, if you'd like.

stayallive commented 2 years ago

Honestly, I don't see how any application that talks with the outside world can function without that extension present and I have never seen an installation in the wild without it personally (unless I forgot to install it 😅).

However, it is a dependency, so I'd not be opposed to documenting it.