Please check your SFTP Host and try again.'; return $trouble; } if($wpdbbkp_auth_type_=='key'){ $key = PublicKeyLoader::load($pkey,$key_pass); $result = $sftp->login($user, $key); }else{ $result = $sftp->login($user, $pass); } if ( ! $result ) { $trouble = 'Connected to the SFTP server but could not log in.
Please check your credentials and try again.'; return $trouble; } $trouble = 'OK'; // Lose this connection. $sftp->disconnect(); return $trouble; }