Make WordPress Core

Changeset 59789


Ignore:
Timestamp:
02/08/2025 03:51:03 PM (18 months ago)
Author:
audrasjb
Message:

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.

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/tags.js

    r53168 r59789  
    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                                }
  • trunk/src/js/_enqueues/lib/ajax-response.js

    r58455 r59789  
    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.
  • trunk/src/js/_enqueues/wp/theme-plugin-editor.js

    r57987 r59789  
    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,
  • trunk/src/js/_enqueues/wp/updates.js

    r59134 r59789  
    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
  • trunk/src/wp-admin/customize.php

    r59480 r59789  
    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
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r59554 r59789  
    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                        );
     
    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                        );
     
    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
  • trunk/src/wp-admin/includes/file.php

    r58975 r59789  
    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'];
  • trunk/src/wp-admin/includes/revision.php

    r59306 r59789  
    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 ) { #>
  • trunk/src/wp-admin/media-upload.php

    r56536 r59789  
    3636if ( 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        );
  • trunk/src/wp-admin/network/site-users.php

    r59784 r59789  
    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
  • trunk/src/wp-admin/themes.php

    r59784 r59789  
    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
     
    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
  • trunk/src/wp-admin/users.php

    r59784 r59789  
    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
Note: See TracChangeset for help on using the changeset viewer.