10, 'body' => array( 'secret' => $security['secret_key'], 'response' => $token, ), ) ); if ( is_wp_error( $response ) ) { // Fail open: an outage at the provider must not stop all bookings. return true; } $data = json_decode( (string) wp_remote_retrieve_body( $response ), true ); return is_array( $data ) && ! empty( $data['success'] ) && ( ! isset( $data['score'] ) || (float) $data['score'] >= 0.5 ); } }