Guzzle 7 dependency conflict with another WordPress plugin
-
Hello Metricool Support,
We have identified a dependency conflict caused by the Guzzle library loaded by the Metricool WordPress plugin.
Our WordPress website encounters the following fatal error when another plugin attempts to use its Google API client:
PHP Fatal error: Uncaught Error: Undefined constant GuzzleHttp\ClientInterface::VERSION
The error occurs in:
/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Client.php:1042
We added a temporary diagnostic check using PHP Reflection and confirmed that the Guzzle ClientInterface currently loaded in WordPress comes from:
/wp-content/plugins/metricool/vendor/guzzlehttp/guzzle/src/ClientInterface.php
The loaded interface contains:
{“MAJOR_VERSION”:7}
This means Metricool loads Guzzle 7 globally under the standard GuzzleHttp namespace. Another active plugin uses an older Google API client that expects the following constant:
GuzzleHttp\ClientInterface::VERSION
Because Guzzle 7 is already loaded by Metricool and only provides MAJOR_VERSION, the second plugin uses Metricool’s version of the class and crashes.
Diagnostic log:
Guzzle ClientInterface loaded from:
/wp-content/plugins/metricool/vendor/guzzlehttp/guzzle/src/ClientInterface.phpGuzzle constants:
{“MAJOR_VERSION”:7}The conflict appears to be caused by multiple WordPress plugins loading different versions of Guzzle under the same global namespace.
Temporarily disabling Metricool prevents its Guzzle 7 ClientInterface from being loaded first, but this is not a suitable long-term solution.
Environment:
- WordPress website
- WooCommerce active
- Metricool WordPress plugin active
- Guzzle loaded by Metricool: major version 7
- Conflicting plugin: Gmail SMTP / Google API PHP Client
- Fatal error triggered during Google OAuth authentication
Please let us know whether this is a known issue and whether an update with isolated Composer dependencies is planned.
Thank you.
You must be logged in to reply to this topic.