Application Passwords: Improve various user-facing and developer-facing terminology.

Fixes #53503, #53691

Built from https://develop.svn.wordpress.org/trunk@51463


git-svn-id: http://core.svn.wordpress.org/trunk@51074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2021-07-19 21:14:57 +00:00
parent 77f6357eac
commit f5713b8d71
5 changed files with 23 additions and 23 deletions

View File

@ -90,7 +90,7 @@ if ( is_wp_error( $is_valid ) ) {
if ( wp_is_site_protected_by_basic_auth( 'front' ) ) { if ( wp_is_site_protected_by_basic_auth( 'front' ) ) {
wp_die( wp_die(
__( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ), __( 'Your website appears to use Basic Authentication, which is not currently compatible with application passwords.' ),
__( 'Cannot Authorize Application' ), __( 'Cannot Authorize Application' ),
array( array(
'response' => 501, 'response' => 501,
@ -147,13 +147,13 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php <?php
printf( printf(
/* translators: %s: Application name. */ /* translators: %s: Application name. */
__( 'Would you like to give the application identifying itself as %s access to your account? You should only do this if you trust the app in question.' ), __( 'Would you like to give the application identifying itself as %s access to your account? You should only do this if you trust the application in question.' ),
'<strong>' . esc_html( $app_name ) . '</strong>' '<strong>' . esc_html( $app_name ) . '</strong>'
); );
?> ?>
</p> </p>
<?php else : ?> <?php else : ?>
<p><?php _e( 'Would you like to give this application access to your account? You should only do this if you trust the app in question.' ); ?></p> <p><?php _e( 'Would you like to give this application access to your account? You should only do this if you trust the application in question.' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php <?php
@ -247,7 +247,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php <?php
submit_button( submit_button(
__( 'Yes, I approve of this connection.' ), __( 'Yes, I approve of this connection' ),
'primary', 'primary',
'approve', 'approve',
false, false,
@ -262,7 +262,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
printf( printf(
/* translators: %s: The URL the user is being redirected to. */ /* translators: %s: The URL the user is being redirected to. */
__( 'You will be sent to %s' ), __( 'You will be sent to %s' ),
'<strong><kbd>' . esc_html( '<strong><code>' . esc_html(
add_query_arg( add_query_arg(
array( array(
'site_url' => site_url(), 'site_url' => site_url(),
@ -271,7 +271,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
), ),
$success_url $success_url
) )
) . '</kbd></strong>' ) . '</code></strong>'
); );
} else { } else {
_e( 'You will be given a password to manually enter into the application in question.' ); _e( 'You will be given a password to manually enter into the application in question.' );
@ -281,7 +281,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php <?php
submit_button( submit_button(
__( 'No, I do not approve of this connection.' ), __( 'No, I do not approve of this connection' ),
'secondary', 'secondary',
'reject', 'reject',
false, false,
@ -296,7 +296,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
printf( printf(
/* translators: %s: The URL the user is being redirected to. */ /* translators: %s: The URL the user is being redirected to. */
__( 'You will be sent to %s' ), __( 'You will be sent to %s' ),
'<strong><kbd>' . esc_html( $reject_url ) . '</kbd></strong>' '<strong><code>' . esc_html( $reject_url ) . '</code></strong>'
); );
} else { } else {
_e( 'You will be returned to the WordPress Dashboard, and no changes will be made.' ); _e( 'You will be returned to the WordPress Dashboard, and no changes will be made.' );

View File

@ -604,9 +604,9 @@ Please click the following link to activate your user account:
* The array of request data. All arguments are optional and may be empty. * The array of request data. All arguments are optional and may be empty.
* *
* @type string $app_name The suggested name of the application. * @type string $app_name The suggested name of the application.
* @type string $app_id A uuid provided by the application to uniquely identify it. * @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $success_url The url the user will be redirected to after approving the application. * @type string $success_url The URL the user will be redirected to after approving the application.
* @type string $reject_url The url the user will be redirected to after rejecting the application. * @type string $reject_url The URL the user will be redirected to after rejecting the application.
* } * }
* @param WP_User $user The user authorizing the application. * @param WP_User $user The user authorizing the application.
* @return true|WP_Error True if the request is valid, a WP_Error object contains errors if not. * @return true|WP_Error True if the request is valid, a WP_Error object contains errors if not.
@ -620,7 +620,7 @@ function wp_is_authorize_application_password_request_valid( $request, $user ) {
if ( 'http' === $scheme ) { if ( 'http' === $scheme ) {
$error->add( $error->add(
'invalid_redirect_scheme', 'invalid_redirect_scheme',
__( 'The success url must be served over a secure connection.' ) __( 'The success URL must be served over a secure connection.' )
); );
} }
} }
@ -631,7 +631,7 @@ function wp_is_authorize_application_password_request_valid( $request, $user ) {
if ( 'http' === $scheme ) { if ( 'http' === $scheme ) {
$error->add( $error->add(
'invalid_redirect_scheme', 'invalid_redirect_scheme',
__( 'The rejection url must be served over a secure connection.' ) __( 'The rejection URL must be served over a secure connection.' )
); );
} }
} }
@ -639,7 +639,7 @@ function wp_is_authorize_application_password_request_valid( $request, $user ) {
if ( ! empty( $request['app_id'] ) && ! wp_is_uuid( $request['app_id'] ) ) { if ( ! empty( $request['app_id'] ) && ! wp_is_uuid( $request['app_id'] ) ) {
$error->add( $error->add(
'invalid_app_id', 'invalid_app_id',
__( 'The app id must be a uuid.' ) __( 'The application ID must be a UUID.' )
); );
} }

View File

@ -151,12 +151,12 @@ class WP_Application_Passwords {
} }
/** /**
* Gets a user's application password with the given uuid. * Gets a user's application password with the given UUID.
* *
* @since 5.6.0 * @since 5.6.0
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @param string $uuid The password's uuid. * @param string $uuid The password's UUID.
* @return array|null The application password if found, null otherwise. * @return array|null The application password if found, null otherwise.
*/ */
public static function get_user_application_password( $user_id, $uuid ) { public static function get_user_application_password( $user_id, $uuid ) {
@ -198,7 +198,7 @@ class WP_Application_Passwords {
* @since 5.6.0 * @since 5.6.0
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @param string $uuid The password's uuid. * @param string $uuid The password's UUID.
* @param array $update Information about the application password to update. * @param array $update Information about the application password to update.
* @return true|WP_Error True if successful, otherwise a WP_Error instance is returned on error. * @return true|WP_Error True if successful, otherwise a WP_Error instance is returned on error.
*/ */
@ -252,7 +252,7 @@ class WP_Application_Passwords {
* @since 5.6.0 * @since 5.6.0
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @param string $uuid The password's uuid. * @param string $uuid The password's UUID.
* @return true|WP_Error True if the usage was recorded, a WP_Error if an error occurs. * @return true|WP_Error True if the usage was recorded, a WP_Error if an error occurs.
*/ */
public static function record_application_password_usage( $user_id, $uuid ) { public static function record_application_password_usage( $user_id, $uuid ) {
@ -290,7 +290,7 @@ class WP_Application_Passwords {
* @since 5.6.0 * @since 5.6.0
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @param string $uuid The password's uuid. * @param string $uuid The password's UUID.
* @return true|WP_Error Whether the password was successfully found and deleted, a WP_Error otherwise. * @return true|WP_Error Whether the password was successfully found and deleted, a WP_Error otherwise.
*/ */
public static function delete_application_password( $user_id, $uuid ) { public static function delete_application_password( $user_id, $uuid ) {

View File

@ -491,7 +491,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
if ( get_current_user_id() !== $user->ID ) { if ( get_current_user_id() !== $user->ID ) {
return new WP_Error( return new WP_Error(
'rest_cannot_introspect_app_password_for_non_authenticated_user', 'rest_cannot_introspect_app_password_for_non_authenticated_user',
__( 'The authenticated Application Password can only be introspected for the current user.' ), __( 'The authenticated application password can only be introspected for the current user.' ),
array( 'status' => rest_authorization_required_code() ) array( 'status' => rest_authorization_required_code() )
); );
} }
@ -519,7 +519,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
if ( ! $uuid ) { if ( ! $uuid ) {
return new WP_Error( return new WP_Error(
'rest_no_authenticated_app_password', 'rest_no_authenticated_app_password',
__( 'Cannot introspect Application Password.' ), __( 'Cannot introspect application password.' ),
array( 'status' => 404 ) array( 'status' => 404 )
); );
} }
@ -788,7 +788,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
'readonly' => true, 'readonly' => true,
), ),
'app_id' => array( 'app_id' => array(
'description' => __( 'A uuid provided by the application to uniquely identify it. It is recommended to use an UUID v5 with the URL or DNS namespace.' ), 'description' => __( 'A UUID provided by the application to uniquely identify it. It is recommended to use an UUID v5 with the URL or DNS namespace.' ),
'type' => 'string', 'type' => 'string',
'format' => 'uuid', 'format' => 'uuid',
'context' => array( 'view', 'edit', 'embed' ), 'context' => array( 'view', 'edit', 'embed' ),

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.9-alpha-51462'; $wp_version = '5.9-alpha-51463';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.