diff --git a/inc/api.php b/inc/api.php index 80e2a87e..846b6dd2 100644 --- a/inc/api.php +++ b/inc/api.php @@ -206,6 +206,11 @@ public function request( $path, $method = 'GET', $params = [], $extra_headers = return 'disconnect'; } + if ( $path === '/optml/v2/account/details' + && isset( $response['error'] ) && $response['error'] === 'whitelist_limit_reached' ) { + return 'disconnect'; + } + return isset( $response['error'] ) ? new WP_Error( 'api_error', wp_kses(