wp-media / backwpup

BackWPup - WordPress Backup Plugin
https://backwpup.com
GNU General Public License v2.0
88 stars 37 forks source link

not compatible with other plugins that use newer Guzzle #94

Open janmyszkier opened 4 years ago

janmyszkier commented 4 years ago

the plugin breaks in admin settings when there's another plugin that uses GuzzleHttp and composer vendor autoloader. the plugin would probably work if both guzzlehttp versions were the same, but in most cases all plugin providers use their own.

their guzzleClient:

6.4.1

your guzzleClient

6.3.3

Please do not load classes that other plugins can provide with different versions or only load yours when in scope of backwpup.

Probably wrapping it within something like or whatever works for within-plugin scope

if( stristr($_SERVER['REQUEST_URI'],'backwpup')) {
require_once $autoloader;
}
rwngallego commented 3 years ago

Hello, I'm the creator of the Perfecty Push Notifications plugin and we're currently in conflict with your plugin because of the same reasons above.

In the mean time, is it possible to update your deps versions in your plugin? We're now using Guzzle 7.2.0.

@janmyszkier I don't think that approach will work because in some cases we could have requests that implicitly loads multiple plugins at once so the if statement is not necessarily exclusive.

Thank you!

gamertan commented 2 weeks ago

I'm going to tag onto this issue as well.

This issue is causing a fatal error in my plugin because we have BackWPUp active on our site and is globally requiring Guzzle via composer. It's loading an older function that our code, which uses a new version of Guzzle, isn't compatible with.

Disabling BackWPUp resolves the fatal error.

We've configured our repository with Composer's vendor-dir config, but because BackWPUp doesn't do that, it's catching the older version and is overriding ours locally. Implementing vendor-dir in the BackWPUp composer file would likely fix the issue for all (and some other issues that were raised and likely based on the same issue).

Since the plugin doesn't have a public composer file or any way to build the plugin from source, it's nearly impossible to rebuild the composer.json file and submit a PR.

Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler()
in /{dir}/{Plugin}/{Plugin}-vendor/guzzlehttp/guzzle/src/functions.php on line 61

Call stack:

GuzzleHttp\choose_handler()
wp-content/Plugins/backwpup/vendor/guzzlehttp/guzzle/src/HandlerStack.php:42
GuzzleHttp\HandlerStack::create()
wp-content/Plugins/backwpup/vendor/guzzlehttp/guzzle/src/Client.php:65
GuzzleHttp\Client::__construct()
wp-content/Plugins/{Plugin}/{Plugin}-vendor/minishlink/web-push/src/WebPush.php:79
Minishlink\WebPush\WebPush::__construct()
wp-content/Plugins/{Plugin}/includes/classes/{Class}.php:###
{Namespace}\{Class}::{Method}()
wp-content/Plugins/{Plugin}/includes/classes/{Class}.php:###
{Namespace}\{Class}::{Method}()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:348
WP_Hook::do_action()
wp-includes/Plugin.php:517
do_action()
wp-admin/admin-post.php:85

I would rather not switch backup plugins. I really do like the functionality.