From 7f991e9fe61ca72af8bb24e3d17f2dd01cd94f7d Mon Sep 17 00:00:00 2001 From: Marcus Dahl Date: Wed, 3 Jan 2024 11:32:15 +0100 Subject: [PATCH] fix: no longer use the `wp_safe_remote_post` function and instead use `wp_remote_post` because it causes problems on some hosts, and our calls are to endpoints returned by Vipps either way --- README.txt | 3 +++ includes/wc-vipps-recurring-api.php | 2 +- woo-vipps-recurring.php | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index 1a7069e..f89cfe0 100755 --- a/README.txt +++ b/README.txt @@ -162,6 +162,9 @@ Alternatively you could look into using WooCommerce "Early renewals": [https://d == Changelog == += 1.17.3 = +* Fixed: No longer use the `wp_safe_remote_post` function and instead use `wp_remote_post` because it causes problems on some hosts, and our calls are to endpoints returned by Vipps either way. + = 1.17.2 = * Fixed: Hide this gateway if there are no subscription products in the cart. diff --git a/includes/wc-vipps-recurring-api.php b/includes/wc-vipps-recurring-api.php index 579725c..d1e5517 100755 --- a/includes/wc-vipps-recurring-api.php +++ b/includes/wc-vipps-recurring-api.php @@ -346,7 +346,7 @@ private function http_call( string $endpoint, string $method, array $data = [], 'body' => $body, ]; - $response = wp_safe_remote_post( $url, $args ); + $response = wp_remote_post( $url, $args ); // throw WP error as a WC_Vipps_Recurring_Exception if response is not valid $default_error = ''; diff --git a/woo-vipps-recurring.php b/woo-vipps-recurring.php index b776d8c..799b99e 100755 --- a/woo-vipps-recurring.php +++ b/woo-vipps-recurring.php @@ -5,7 +5,7 @@ * Description: Offer recurring payments with Vipps for WooCommerce Subscriptions * Author: Everyday AS * Author URI: https://everyday.no - * Version: 1.17.2 + * Version: 1.17.3 * Requires at least: 4.4 * Tested up to: 6.4 * WC tested up to: 8.2 @@ -17,7 +17,7 @@ // phpcs:disable WordPress.Files.FileName -define( 'WC_VIPPS_RECURRING_VERSION', '1.17.2' ); +define( 'WC_VIPPS_RECURRING_VERSION', '1.17.3' ); // declare compatibility with WooCommerce HPOS