rollbar-php-wordpress icon indicating copy to clipboard operation
rollbar-php-wordpress copied to clipboard

Monolog version conflict with WooCommerce Cybersource plugin due to non-prefixed vendor libraries

Open iugo-robert opened this issue 1 month ago • 8 comments

We’re encountering a fatal PHP error when the Rollbar for WordPress plugin is active alongside the WooCommerce Cybersource payment gateway plugin.

The Rollbar plugin bundles monolog/monolog via Composer but does not vendor-prefix or otherwise isolate its dependencies. This causes a version conflict when another plugin (such as WooCommerce Cybersource) includes a different version of Monolog.

Could you please vendor-prefix all Rollbar dependencies in the distributed plugin build to prevent these kinds of conflicts with other WordPress plugins? Tools like Mozart or PHP-Scoper could be used to achieve this.

iugo-robert avatar Oct 31 '25 03:10 iugo-robert

SDK-560

linear[bot] avatar Oct 31 '25 03:10 linear[bot]

Thank you for bringing this to our attention. Are you on the new v3 release?

danielmorell avatar Oct 31 '25 19:10 danielmorell

@danielmorell Yes we're on the new v3 release.

iugo-robert avatar Nov 02 '25 22:11 iugo-robert

We will get this resolved.

danielmorell avatar Nov 03 '25 23:11 danielmorell

Thanks @danielmorell

iugo-robert avatar Nov 05 '25 22:11 iugo-robert

We've also seen the same issue come up on as site with the cloudflare plugin installed as well.

We're seeing this error on rollbar plugin activation when cloudflare plugin is already installed and activated.

PHP Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = []) in wp-content/plugins/rollbar/vendor/monolog/monolog/src/Monolog/Logger.php on line 683

Unfortunately both plugins include monolog, but running are different versions of the library and are not vendor prefixed.

iugo-robert avatar Nov 06 '25 04:11 iugo-robert

This is definitely one of the pain points with WordPress plugins. We will vendor prefix the dependencies we include in the version of the plugin we upload to the WordPress plugin directory.

Another install path that is an option in 3.0 and above is directly via Composer and Packagist https://packagist.org/packages/rollbar/rollbar-php-wordpress. Granted, this option only solves your issue if you can also mange the rest of your dependency tree with composer. And unfortunately, most plugins on the WP plugin directory don't do that.

danielmorell avatar Nov 07 '25 17:11 danielmorell

Looking forward to a conflict free release. Any update?

therealgilles avatar Nov 23 '25 09:11 therealgilles

We were just waiting on some updates to the underlying core PHP SDK to support PHP 8.5, and update the Rollbar JS version. We are putting out a release (v4.2.0) which will be included in the next version this plugin. Should be very soon.

danielmorell avatar Nov 26 '25 23:11 danielmorell