diff --git a/application-passwords.js b/application-passwords.js index 6372486..0179487 100644 --- a/application-passwords.js +++ b/application-passwords.js @@ -19,6 +19,14 @@ method: 'POST', beforeSend: function( xhr ) { xhr.setRequestHeader( 'Authorization', 'Basic ' + btoa( testBasicAuthUser + ':' + testBasicAuthPassword ) ); + }, + error: function( jqXHR ) { + if ( 404 === jqXHR.status ) { + $newAppPassForm.before( tmplNotice( { + type: 'error', + message: appPass.text.no_credentials + } ) ); + } } } ).done( function( response ) { if ( response.PHP_AUTH_USER === testBasicAuthUser && response.PHP_AUTH_PW === testBasicAuthPassword ) { diff --git a/class.application-passwords.php b/class.application-passwords.php index c979613..2bea0ea 100644 --- a/class.application-passwords.php +++ b/class.application-passwords.php @@ -515,7 +515,7 @@ public static function show_user_profile( $user ) { 'nonce' => wp_create_nonce( 'wp_rest' ), 'user_id' => $user->ID, 'text' => array( - 'no_credentials' => __( 'Due to a potential server misconfiguration, it seems that HTTP Basic Authorization may not work for the REST API on this site: `Authorization` headers are not being sent to WordPress by the web server.' ), + 'no_credentials' => __( 'Due to a potential server misconfiguration, it seems that HTTP Basic Authorization may not work for the REST API on this site: `Authorization` headers are not being sent to WordPress by the web server. You can learn more about this problem, and a possible solution, on our GitHub Wiki.' ), ), ) ); @@ -580,7 +580,7 @@ public static function show_user_profile( $user ) { wp.getUsers1USERNAMEAPPLICATION_PASSWORD' LOCALHOST ``` -In the above example, replace *USERNAME* with your username, and *APPLICATION_PASSWORD* with your new application password. This should output a response containing all users on your site. \ No newline at end of file +In the above example, replace *USERNAME* with your username, and *APPLICATION_PASSWORD* with your new application password. This should output a response containing all users on your site. +