Merged in feature/117-dev-dev01 (pull request #8)

auto-patch  117-dev-dev01-2023-12-15T16_09_06

* auto-patch  117-dev-dev01-2023-12-15T16_09_06
This commit is contained in:
Tony Volpe
2023-12-15 16:10:57 +00:00
parent 0825f6bd5f
commit 3dc9eca989
1424 changed files with 28118 additions and 10097 deletions

View File

@@ -420,12 +420,12 @@ class Plugins extends \WC_REST_Data_Controller {
/**
* Kicks off the WCCOM Connect process.
*
* @return WP_Error|array Connection URL for WooCommerce.com
* @return WP_Error|array Connection URL for Woo.com
*/
public function request_wccom_connect() {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-api.php';
if ( ! class_exists( 'WC_Helper_API' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the Woo.com Helper API.', 'woocommerce' ), 404 );
}
$redirect_uri = wc_admin_url( '&task=connect&wccom-connected=1' );
@@ -442,12 +442,12 @@ class Plugins extends \WC_REST_Data_Controller {
$code = wp_remote_retrieve_response_code( $request );
if ( 200 !== $code ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Woo.com. Please try again.', 'woocommerce' ), 500 );
}
$secret = json_decode( wp_remote_retrieve_body( $request ) );
if ( empty( $secret ) ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Woo.com. Please try again.', 'woocommerce' ), 500 );
}
do_action( 'woocommerce_helper_connect_start' );
@@ -477,7 +477,7 @@ class Plugins extends \WC_REST_Data_Controller {
}
/**
* Finishes connecting to WooCommerce.com.
* Finishes connecting to Woo.com.
*
* @param object $rest_request Request details.
* @return WP_Error|array Contains success status.
@@ -488,7 +488,7 @@ class Plugins extends \WC_REST_Data_Controller {
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-updater.php';
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
if ( ! class_exists( 'WC_Helper_API' ) ) {
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the WooCommerce.com Helper API.', 'woocommerce' ), 404 );
return new \WP_Error( 'woocommerce_rest_helper_not_active', __( 'There was an error loading the Woo.com Helper API.', 'woocommerce' ), 404 );
}
// Obtain an access token.
@@ -504,12 +504,12 @@ class Plugins extends \WC_REST_Data_Controller {
$code = wp_remote_retrieve_response_code( $request );
if ( 200 !== $code ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Woo.com. Please try again.', 'woocommerce' ), 500 );
}
$access_token = json_decode( wp_remote_retrieve_body( $request ), true );
if ( ! $access_token ) {
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Woo.com. Please try again.', 'woocommerce' ), 500 );
}
\WC_Helper_Options::update(
@@ -525,7 +525,7 @@ class Plugins extends \WC_REST_Data_Controller {
if ( ! \WC_Helper::_flush_authentication_cache() ) {
\WC_Helper_Options::update( 'auth', array() );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce' ), 500 );
return new \WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to Woo.com. Please try again.', 'woocommerce' ), 500 );
}
delete_transient( '_woocommerce_helper_subscriptions' );