Administration: Error messages improvements in WP Admin.
Some checks failed
Cleanup Pull Requests / Clean up pull requests (push) Waiting to run
Coding Standards / PHP coding standards (push) Waiting to run
Coding Standards / JavaScript coding standards (push) Waiting to run
Coding Standards / Slack Notifications (push) Blocked by required conditions
Coding Standards / Failed workflow tasks (push) Blocked by required conditions
End-to-end Tests / Test with SCRIPT_DEBUG disabled (push) Waiting to run
End-to-end Tests / Test with SCRIPT_DEBUG enabled (push) Waiting to run
End-to-end Tests / Slack Notifications (push) Blocked by required conditions
End-to-end Tests / Failed workflow tasks (push) Blocked by required conditions
JavaScript Tests / QUnit Tests (push) Waiting to run
JavaScript Tests / Slack Notifications (push) Blocked by required conditions
JavaScript Tests / Failed workflow tasks (push) Blocked by required conditions
Performance Tests / Determine Matrix (push) Waiting to run
Performance Tests / ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} (push) Blocked by required conditions
Performance Tests / Compare (push) Blocked by required conditions
Performance Tests / Slack Notifications (push) Blocked by required conditions
Performance Tests / Failed workflow tasks (push) Blocked by required conditions
PHP Compatibility / Check PHP compatibility (push) Waiting to run
PHP Compatibility / Slack Notifications (push) Blocked by required conditions
PHP Compatibility / Failed workflow tasks (push) Blocked by required conditions
Test Build Processes / Core running from build (push) Waiting to run
Test Build Processes / Core running from src (push) Waiting to run
Test Build Processes / Gutenberg running from build (push) Waiting to run
Test Build Processes / Gutenberg running from src (push) Waiting to run
Test Build Processes / Slack Notifications (push) Blocked by required conditions
Test Build Processes / Failed workflow tasks (push) Blocked by required conditions
Test Default Themes & Create ZIPs / twentyeleven empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentyfifteen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentyfourteen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentynineteen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentyseventeen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentysixteen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentyten empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentythirteen empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwelve empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwenty empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwentyfive empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwentyfour empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwentyone empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwentythree empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / twentytwentytwo empty file check (push) Has been cancelled
Test Default Themes & Create ZIPs / Test twentynineteen build script (push) Has been cancelled
Test Default Themes & Create ZIPs / Test twentytwenty build script (push) Has been cancelled
Test Default Themes & Create ZIPs / Test twentytwentyone build script (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentyeleven ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentyfifteen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentyfourteen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentynineteen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentyseventeen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentysixteen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentyten ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentythirteen ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwelve ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwenty ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwentyfive ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwentyfour ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwentyone ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwentythree ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Create twentytwentytwo ZIP file (push) Has been cancelled
Test Default Themes & Create ZIPs / Slack Notifications (push) Has been cancelled
Test Default Themes & Create ZIPs / Failed workflow tasks (push) Has been cancelled
PHPUnit Tests / PHP 7.2 (push) Has been cancelled
PHPUnit Tests / PHP 7.3 (push) Has been cancelled
PHPUnit Tests / PHP 7.4 (push) Has been cancelled
PHPUnit Tests / PHP 8.0 (push) Has been cancelled
PHPUnit Tests / PHP 8.1 (push) Has been cancelled
PHPUnit Tests / PHP 8.2 (push) Has been cancelled
PHPUnit Tests / PHP 8.3 (push) Has been cancelled
PHPUnit Tests / PHP 8.4 (push) Has been cancelled
PHPUnit Tests / html-api-html5lib-tests (push) Has been cancelled
PHPUnit Tests / Slack Notifications (push) Has been cancelled
PHPUnit Tests / Failed workflow tasks (push) Has been cancelled

This changeset improves a bunch of WP-Admin error messages, notably replacing the good old cryptic "Something went wrong" message with more helpful information.

Props peterwilsoncc, netweb, karmatosed, JoshuaWold, mrtortai, audrasjb, sukhendu2002, joedolson.
See #43622.




git-svn-id: https://develop.svn.wordpress.org/trunk@59789 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2025-02-08 15:51:03 +00:00
parent fc8fa6a615
commit 3428f3a0f9
12 changed files with 19 additions and 19 deletions

View File

@ -59,7 +59,7 @@ jQuery( function($) {
tr.children().css('backgroundColor', '');
} else {
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'Something went wrong.' ) + '</p></div>');
$('#ajax-response').empty().append('<div class="error"><p>' + wp.i18n.__( 'An error occurred while processing your request. Please try again later.' ) + '</p></div>');
tr.children().css('backgroundColor', '');
}
});

View File

@ -83,7 +83,7 @@ window.wpAjax = jQuery.extend( {
selector = jQuery( selector );
return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length;
}
}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'An error occurred while processing your request. Please refresh the page and try again.' } );
// Basic form validation.
jQuery( function($){

View File

@ -226,7 +226,7 @@ wp.themePluginEditor = (function( $ ) {
var notice = $.extend(
{
code: 'save_error',
message: __( 'Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.' )
message: __( 'An error occurred while saving your changes. Please try again. If the problem persists, you may need to manually update the file via FTP.' )
},
response,
{

View File

@ -2333,7 +2333,7 @@
* 'update' or 'install'.
*/
wp.updates.isValidResponse = function( response, action ) {
var error = __( 'Something went wrong.' ),
var error = __( 'An error occurred during the update process. Please try again.' ),
errorMessage;
// Make sure the response is a valid data object and not a Promise object.

View File

@ -76,8 +76,8 @@ if ( $wp_customize->changeset_post_id() ) {
if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
'<h1>' . __( 'An error occurred while saving your changeset.' ) . '</h1>' .
'<p>' . __( 'Please try again or start a new changeset. This changeset cannot be further modified.' ) . '</p>' .
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
403
);

View File

@ -830,8 +830,8 @@ endif;
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<p>' . __( 'The active theme does not support uploading a custom header image.' ) . '</p>',
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
'<p>' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '</p>',
403
);
}
@ -1018,8 +1018,8 @@ endif;
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<p>' . __( 'The active theme does not support uploading a custom header image.' ) . '</p>',
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
'<p>' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '</p>',
403
);
}
@ -1029,7 +1029,7 @@ endif;
&& ! current_theme_supports( 'custom-header', 'flex-width' )
) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
'<p>' . __( 'The active theme does not support a flexible sized header image.' ) . '</p>',
403
);

View File

@ -635,7 +635,7 @@ function wp_edit_theme_plugin_file( $args ) {
wp_opcache_invalidate( $real_file, true );
if ( ! isset( $result['message'] ) ) {
$message = __( 'Something went wrong.' );
$message = __( 'An error occurred. Please try again later.' );
} else {
$message = $result['message'];
unset( $result['message'] );

View File

@ -466,7 +466,7 @@ function wp_print_revision_templates() {
<script id="tmpl-revisions-diff" type="text/html">
<div class="loading-indicator"><span class="spinner"></span></div>
<div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
<div class="diff-error"><?php _e( 'An error occurred while loading the comparison. Please refresh the page and try again.' ); ?></div>
<div class="diff">
<# _.each( data.fields, function( field ) { #>
<h2>{{ field.name }}</h2>

View File

@ -35,8 +35,8 @@ $post_id = isset( $post_id ) ? (int) $post_id : 0;
// Require an ID for the edit screen.
if ( isset( $action ) && 'edit' === $action && ! $ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<p>' . __( 'Invalid item ID.' ) . '</p>',
'<h1>' . __( 'An error occurred during the upload process.' ) . '</h1>' .
'<p>' . __( 'Invalid item ID. You can view all media items in the <a href="upload.php">Media Library</a>.' ) . '</p>',
403
);
}

View File

@ -155,7 +155,7 @@ if ( $action ) {
// If the user doesn't already belong to the blog, bail.
if ( ! is_user_member_of_blog( $user_id ) ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403
);

View File

@ -24,7 +24,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
if ( ! $theme->exists() || ! $theme->is_allowed() ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
403
);
@ -67,7 +67,7 @@ if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
if ( ! $theme->exists() ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<h1>' . __( 'An error occurred while deleting the theme.' ) . '</h1>' .
'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
403
);

View File

@ -155,7 +155,7 @@ switch ( $wp_list_table->current_action() ) {
// If the user doesn't already belong to the blog, bail.
if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
wp_die(
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403
);