XRPL-Labs/xumm-for-woocommerce

Critical error after saving API and API secret key

Closed this issue · 6 comments

removed plugin completely and installed newest version
Activate the plugin and go to settings
As soon as I save the settings/API key a critical error occurs and only thing I can do is deactivate the plugin

Log from Woocommerce:

2023-03-29T17:16:04+00:00 CRITICAL Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/libraries/guzzlehttp/guzzle/src/functions.php:61
Stack trace:
#0 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/backwpup/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/backwpup/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
#2 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/libraries/xrpl/xumm-sdk-php/src/XummSdk.php(165): GuzzleHttp\Client->__construct()
#3 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/libraries/xrpl/xumm-sdk-php/src/XummSdk.php(44): Xrpl\XummSdkPhp\XummSdk->configure()
#4 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/admin/partials/xumm-for-woocommerce-admin-form-fields.php(8): Xrpl\XummSdkPhp\XummSdk->__construct()
#5 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/admin/class-xumm-for-woocommerce-admin.php(127): include('/home/abcd/...')
#6 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/class-wp-hook.php(308): Xumm_For_Woocommerce_Admin->init_form_fields()
#7 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#8 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/src/Woocommerce/XummPaymentGateway.php(122): apply_filters()
#9 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/src/Woocommerce/XummPaymentGateway.php(105): Xrpl\XummForWoocommerce\Woocommerce\XummPaymentGateway->init_form_fields()
#10 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(97): Xrpl\XummForWoocommerce\Woocommerce\XummPaymentGateway->__construct()
#11 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-payment-gateways.php(304): WC_Payment_Gateways->init()
#12 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/class-wp-hook.php(308): WC_Settings_Payment_Gateways->save()
#13 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#14 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/plugin.php(517): WP_Hook->do_action()
#15 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-settings.php(78): do_action()
#16 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(151): WC_Admin_Settings::save()
#17 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/class-wp-hook.php(308): WC_Admin_Menus->save_settings()
#18 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#19 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-includes/plugin.php(517): WP_Hook->do_action()
#20 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-settings.php(639): do_action()
#21 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-config.php(115): require_once('/home/abcd/...')
#22 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-load.php(50): require_once('/home/abcd/...')
#23 /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-admin/admin.php(34): require_once('/home/abcd/...')
#24 {main}
thrown in /home/abcd/efgh/iets.eu/public_html/ergens/blog/wp-content/plugins/xumm-payments-for-woocommerce/libraries/guzzlehttp/guzzle/src/functions.php op de lijn 61

I found out what the problem was.
There is a lot to find about this error "CRITICAL Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler()"
I saw another plugin "Backwpup " was also using GuzzleHTTP
Disabling Backwpup fixed the Xumm for Woocommerce issue.

Thank you for the feedback we will close the issue as it seems resolved.

I have tried after initial setup off XUMM plugin to activate BackWPup again but then Xumm payment does not work, just waiting forever.
I have no idea how many other WP plugins use GuzzleHttp and if they will cause problems too.

Let us have a look @rosseti

The result of our analysis:

Our plugin works together with other composer components, which is a php libs version management. In the wordpress approach, we need to ship all the packages that are needed along with the project for it to work properly. As there is a "gap" between PHP version 7 and version 8, this is evident when some components in common with other plugins walk in different PHP base versions.

This GAP becomes more evident from PHP 8 onwards, in which some libraries such as Guzzle, which makes an HTTP request, contain differences from others that are used in the PHP 7 version.

I have got the plugin working on my site, just for testing purpose, on PHP 8.1.18
Other site with an actual store and also PHP 8.1.18 I can get this plugin working but it disables Paypal payments.
Because this is not my own site and it has to be online 24/7 with Paypal payments working we decided to stop trying Xumm plugin.
For me it is OK to close thise issue.
Thanks for explanation!