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' ) ) {
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' ),
array(
'response' => 501,
@ -147,13 +147,13 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php
printf(
/* 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>'
);
?>
</p>
<?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
@ -247,7 +247,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php
submit_button(
__( 'Yes, I approve of this connection.' ),
__( 'Yes, I approve of this connection' ),
'primary',
'approve',
false,
@ -262,7 +262,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
printf(
/* translators: %s: The URL the user is being redirected to. */
__( 'You will be sent to %s' ),
'<strong><kbd>' . esc_html(
'<strong><code>' . esc_html(
add_query_arg(
array(
'site_url' => site_url(),
@ -271,7 +271,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
),
$success_url
)
) . '</kbd></strong>'
) . '</code></strong>'
);
} else {
_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
submit_button(
__( 'No, I do not approve of this connection.' ),
__( 'No, I do not approve of this connection' ),
'secondary',
'reject',
false,
@ -296,7 +296,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
printf(
/* translators: %s: The URL the user is being redirected to. */
__( 'You will be sent to %s' ),
'<strong><kbd>' . esc_html( $reject_url ) . '</kbd></strong>'
'<strong><code>' . esc_html( $reject_url ) . '</code></strong>'
);
} else {
_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.
*
* @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 $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 $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 $reject_url The URL the user will be redirected to after rejecting 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.
@ -620,7 +620,7 @@ function wp_is_authorize_application_password_request_valid( $request, $user ) {
if ( 'http' === $scheme ) {
$error->add(
'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 ) {
$error->add(
'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'] ) ) {
$error->add(
'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
*
* @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.
*/
public static function get_user_application_password( $user_id, $uuid ) {
@ -198,7 +198,7 @@ class WP_Application_Passwords {
* @since 5.6.0
*
* @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.
* @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
*
* @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.
*/
public static function record_application_password_usage( $user_id, $uuid ) {
@ -290,7 +290,7 @@ class WP_Application_Passwords {
* @since 5.6.0
*
* @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.
*/
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 ) {
return new WP_Error(
'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() )
);
}
@ -519,7 +519,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
if ( ! $uuid ) {
return new WP_Error(
'rest_no_authenticated_app_password',
__( 'Cannot introspect Application Password.' ),
__( 'Cannot introspect application password.' ),
array( 'status' => 404 )
);
}
@ -788,7 +788,7 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller {
'readonly' => true,
),
'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',
'format' => 'uuid',
'context' => array( 'view', 'edit', 'embed' ),

View File

@ -13,7 +13,7 @@
*
* @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.