instanceUrl ) || empty( $this->siteKey ) || empty( $this->secretKey ) ) { return false; } $verify_url = trailingslashit( $this->instanceUrl ) . rawurlencode( $this->siteKey ) . '/siteverify'; $response_obj = wp_remote_post( $verify_url, array( 'headers' => array( 'Content-Type' => 'application/json' ), 'body' => wp_json_encode( array( 'secret' => $this->secretKey, 'response' => $response, ) ), 'timeout' => 20, ) ); if ( is_wp_error( $response_obj ) ) { return false; } $body = wp_remote_retrieve_body( $response_obj ); $result = json_decode( $body, true ); return ! empty( $result['success'] ); } }