Skip to content

Commit c5293a0

Browse files
committed
Administration: Error messages improvements in WP Admin.
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. Built from https://develop.svn.wordpress.org/trunk@59789 git-svn-id: http://core.svn.wordpress.org/trunk@59131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent d76c427 commit c5293a0

17 files changed

+24
-24
lines changed

wp-admin/customize.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676

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

wp-admin/includes/class-custom-image-header.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,8 @@ public function step_2() {
830830

831831
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
832832
wp_die(
833-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
834-
'<p>' . __( 'The active theme does not support uploading a custom header image.' ) . '</p>',
833+
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
834+
'<p>' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '</p>',
835835
403
836836
);
837837
}
@@ -1018,8 +1018,8 @@ public function step_3() {
10181018

10191019
if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) {
10201020
wp_die(
1021-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
1022-
'<p>' . __( 'The active theme does not support uploading a custom header image.' ) . '</p>',
1021+
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
1022+
'<p>' . __( 'The active theme does not support uploading a custom header image. Please ensure your theme supports custom headers and try again.' ) . '</p>',
10231023
403
10241024
);
10251025
}
@@ -1029,7 +1029,7 @@ public function step_3() {
10291029
&& ! current_theme_supports( 'custom-header', 'flex-width' )
10301030
) {
10311031
wp_die(
1032-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
1032+
'<h1>' . __( 'An error occurred while processing your header image.' ) . '</h1>' .
10331033
'<p>' . __( 'The active theme does not support a flexible sized header image.' ) . '</p>',
10341034
403
10351035
);

wp-admin/includes/file.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ function wp_edit_theme_plugin_file( $args ) {
635635
wp_opcache_invalidate( $real_file, true );
636636

637637
if ( ! isset( $result['message'] ) ) {
638-
$message = __( 'Something went wrong.' );
638+
$message = __( 'An error occurred. Please try again later.' );
639639
} else {
640640
$message = $result['message'];
641641
unset( $result['message'] );

wp-admin/includes/revision.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ function wp_print_revision_templates() {
466466

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

wp-admin/js/tags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jQuery( function($) {
5959
tr.children().css('backgroundColor', '');
6060

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

wp-admin/js/tags.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/js/theme-plugin-editor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ wp.themePluginEditor = (function( $ ) {
226226
var notice = $.extend(
227227
{
228228
code: 'save_error',
229-
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.' )
229+
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.' )
230230
},
231231
response,
232232
{

wp-admin/js/theme-plugin-editor.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/js/updates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@
23332333
* 'update' or 'install'.
23342334
*/
23352335
wp.updates.isValidResponse = function( response, action ) {
2336-
var error = __( 'Something went wrong.' ),
2336+
var error = __( 'An error occurred during the update process. Please try again.' ),
23372337
errorMessage;
23382338

23392339
// Make sure the response is a valid data object and not a Promise object.

wp-admin/js/updates.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/media-upload.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
// Require an ID for the edit screen.
3636
if ( isset( $action ) && 'edit' === $action && ! $ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
3737
wp_die(
38-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
39-
'<p>' . __( 'Invalid item ID.' ) . '</p>',
38+
'<h1>' . __( 'An error occurred during the upload process.' ) . '</h1>' .
39+
'<p>' . __( 'Invalid item ID. You can view all media items in the <a href="upload.php">Media Library</a>.' ) . '</p>',
4040
403
4141
);
4242
}

wp-admin/network/site-users.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
// If the user doesn't already belong to the blog, bail.
156156
if ( ! is_user_member_of_blog( $user_id ) ) {
157157
wp_die(
158-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
158+
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
159159
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
160160
403
161161
);

wp-admin/themes.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
if ( ! $theme->exists() || ! $theme->is_allowed() ) {
2626
wp_die(
27-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
27+
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
2828
'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
2929
403
3030
);
@@ -67,7 +67,7 @@
6767

6868
if ( ! $theme->exists() ) {
6969
wp_die(
70-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
70+
'<h1>' . __( 'An error occurred while deleting the theme.' ) . '</h1>' .
7171
'<p>' . __( 'The requested theme does not exist.' ) . '</p>',
7272
403
7373
);

wp-admin/users.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
// If the user doesn't already belong to the blog, bail.
156156
if ( is_multisite() && ! is_user_member_of_blog( $id ) ) {
157157
wp_die(
158-
'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
158+
'<h1>' . __( 'An error occurred.' ) . '</h1>' .
159159
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
160160
403
161161
);

wp-includes/js/wp-ajax-response.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ window.wpAjax = jQuery.extend( {
8383
selector = jQuery( selector );
8484
return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length;
8585
}
86-
}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } );
86+
}, 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.' } );
8787

8888
// Basic form validation.
8989
jQuery( function($){

wp-includes/js/wp-ajax-response.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-includes/version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.8-alpha-59788';
19+
$wp_version = '6.8-alpha-59789';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)