Skip to content

Commit

Permalink
Return true if response code is OK
Browse files Browse the repository at this point in the history
  • Loading branch information
valendesigns committed Jun 8, 2016
1 parent 2088512 commit 0bc3dfe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions includes/class-dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function add_default_form() {
$username = GEM_Settings_Controls::get_option( 'username' );
$api_key = GEM_Settings_Controls::get_option( 'api-key' );

if ( ! ( $username && $api_key ) ) {
if ( ! ( $username || $api_key ) ) {
return false;
}

Expand All @@ -98,12 +98,12 @@ public static function add_default_form() {
),
) );

// Credentials are incorrect.
if ( ! in_array( wp_remote_retrieve_response_code( $response ), self::$ok_codes ) ) {
return false;
// Credentials are correct.
if ( self::is_response_ok( $response ) ) {
return true;
}

return true;
return false;
}

/**
Expand Down

0 comments on commit 0bc3dfe

Please sign in to comment.