August 3, 2023 at 6:07 am
We are in a situation where we need to attach multiple sales pages to a cloud server (there is a reason why we need to do this).
I’ve tried to convert the code to 3 domain validation, which should be fine in principle, but it doesn’t work: it always only validates the first domain, and gives an error when attaching the cloud to the others – even though there is a valid key.
What am I messing up? Or is this not how it should work?
I followed this documentation, which is good for 1 sales page:
*Login to see link
And this is my new code snippet that doesn’t work:
// Define woocommerce site.
$api_url = ‘*Login to see link
$api_url_2 = ‘*Login to see link
$api_url_3 = ‘*Login to see link
$request_uri = $api_url . ‘?’ . http_build_query( $args );
$data = wp_safe_remote_get( $request_uri );
// Couldn’t Access the api site.
if ( is_wp_error( $data ) || $data[‘response’][‘code’] != 200 ) {
$api_url = $api_url_2;
$request_uri = $api_url . ‘?’ . http_build_query( $args );
$data = wp_safe_remote_get( $request_uri );
if ( is_wp_error( $data ) || $data[‘response’][‘code’] != 200 ) {
$api_url = $api_url_3;
$request_uri = $api_url . ‘?’ . http_build_query( $args );
$data = wp_safe_remote_get( $request_uri );
if ( is_wp_error( $data ) || $data[‘response’][‘code’] != 200 ) {
return $access;
}
}
}
Thanks in advance if you can help! 🙂
Sandor