• Resolved codrx

    (@codrx)


    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.php

    Guzzle 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Jarno Vos

    (@jarnovos)

    Hi @codrx,

    Thanks for sharing the error message and diagnosis with us.

    It looks like this error isn’t due to “two Guzzle versions fighting” in the usual sense. Guzzle 7 is loaded (as intended), but the other plugin’s source code is too old and incompatible with it.

    The fatal error occurs because the Gmail SMTP plugin bundles an outdated Google API PHP client that still references GuzzleHttp\ClientInterface::VERSION. In Guzzle 7 that constant was removed (replaced by MAJOR_VERSION), so once Metricool has loaded Guzzle 7, the Gmail SMTP code crashes during OAuth.

    Your error message pointing at google-api-php-client/src/Google/Client.php suggests an old client (v2.5.x or earlier). Current google-api-php-client releases should handle both Guzzle 6 and 7 safely; from v2.6.0 onward the VERSION constant is no longer accessed directly, and recent releases such as v2.15.3+ explicitly support Guzzle 6 and 7 in their dependencies (see changelog).

    This is not a bug in Metricool’s Guzzle integration per se, but the Gmail SMTP plugin needs to update its bundled google-api-php-client to avoid this conflict.

    Disabling Metricool only works because it prevents Guzzle 7 from loading first, which confirms the diagnosis, but I can imagine that it isn’t a viable long-term fix. We do not currently plan to downgrade Guzzle, so we recommend contacting the Gmail SMTP developer with your error log; they should be able to resolve this by updating google-api-php-client.

    Thanks again for sharing the errors here, hope this helps!
    Kind regards, Jarno

    • This reply was modified 1 week, 2 days ago by Jarno Vos. Reason: some formatting changes
    Plugin Support Jarno Vos

    (@jarnovos)

    Hi @codrx,

    I’ll mark this as resolved for now, as we think that the appropriate solution would be for the SMTP plugin to update to a more recent version of the google-api-php-client to avoid conflicts with other active plugin(s) that are using Guzzle 7.

    In the future, we might also explore dropping the dependency on Guzzle in later versions of the Metricool plugin. Though it’s worth noting that as long as Gmail SMTP bundles the outdated Google API client, you could still hit the same fatal error if any active plugin were to load Guzzle 7 first.

    Kind regards, Jarno

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.