stayallive / wp-sentry

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

const SDK_VERSION is plugin version not Sentry PHP SDK version #149

Closed pawelkmpt closed 1 year ago

pawelkmpt commented 1 year ago

I find the naming of the given constant confusing. At the first glance it looks to me as version of Sentry SDK but actually it's a plugin version.

https://github.com/stayallive/wp-sentry/blob/87f7afd957b573ecdd9314012213b9caaf7ecede/src/class-wp-sentry-version.php#L8

Could you maybe rename it or introduce new constant with Sentry SDK version?

stayallive commented 1 year ago

No, sorry.

This is code within the plugin itself and the plugin could be considered a SDK depending on your view. This might be confusing but you should quickly find out that the PHP SDK is not on version 6 yet for a long time 😄

Also at this point this is a breaking change and I don't want to make that just for clarity for a constant that should only be used internally anyway (there are other better way to figure out the plugin version).

If you need the Sentry PHP SDK version for some reason (I'd love to know why) you can find that here: https://github.com/getsentry/sentry-php/blob/94e1a8ed9fcfb41fec740c9a973a81bfffcd14ea/src/Client.php#L38.