PHP 8.1+ Support
-
Webhost: BlueHost
PHP Version: 8.3When activating the plugin, the site breaks. Looking into the culprit and it seems this line is the problem:
return new GuzzleClient([ RequestOptions::CRYPTO_METHOD => Config::$defaultTlsMethod, RequestOptions::CONNECT_TIMEOUT => Config::$defaultConnectionTimeout, RequestOptions::TIMEOUT => Config::$defaultRequestTimeout, RequestOptions::HTTP_ERRORS => true, 'handler' => $this->handlerStack, ]);The first RequestOptions uses Crypto Method which apparently isn’t there in PHP 8, so I had to change to this instead:
‘curl’ => [CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2]
this is under vendor/saloonphp/saloon/src/Http/Senders
I also get 2 addition notices regarding REST API I will have to look into but at least that one change to use curl seems to have addressed the PHP 8.1+ issue.Notice: Function register_rest_route was called incorrectly. The REST API route definition for zonos-for-woocommerce/v1/order/update-tracking-number is missing the required permission_callback argument.
Notice: Function register_rest_route was called incorrectly. The REST API route definition for zonos-for-woocommerce/v1/order/update-status is missing the required permission_callback argument.
Both of these mention that REST API routes that are intended to be public, use __return_true as the permission callback.
The topic ‘PHP 8.1+ Support’ is closed to new replies.