Skip to content

Commit b88cb5e

Browse files
committed
allow a disabled account
1 parent e2496ab commit b88cb5e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-connect.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,13 @@ function ( $a ) {
308308
$test_result = $this->check_status();
309309

310310
if ( is_wp_error( $test_result ) ) {
311-
$result['type'] = 'connection_error';
311+
$error = $test_result->get_error_message();
312+
if ( 'disabled account' !== strtolower( $error ) ) {
313+
// Account Disabled, is still successful, so allow it, else we will never be able to change it.
314+
$result['type'] = 'connection_error';
315+
}
312316
$result['message'] = ucwords( str_replace( '_', ' ', $test_result->get_error_message() ) );
313317
} else {
314-
$this->api = $test;
315318
$this->usage_stats( true );
316319
}
317320

@@ -336,7 +339,8 @@ public function check_status() {
336339
* @return array|\WP_Error
337340
*/
338341
public function test_ping() {
339-
$test = new Connect\Api( $this, $this->plugin->version );
342+
$test = new Connect\Api( $this, $this->plugin->version );
343+
$this->api = $test;
340344

341345
return $test->ping();
342346
}

0 commit comments

Comments
 (0)