Make WordPress Core

Changeset 59790


Ignore:
Timestamp:
02/08/2025 03:58:11 PM (10 months ago)
Author:
audrasjb
Message:

General: Error messages improvements in /wp-includes files.

This changeset improves a bunch of 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.
Fixes #43622.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r59078 r59790  
    455455
    456456        if ( ! $message ) {
    457             $message = __( 'Something went wrong.' );
     457            $message = __( 'An error occurred while customizing. Please refresh the page and try again.' );
    458458        }
    459459
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r59754 r59790  
    40324032
    40334033        if ( ! $comment_id ) {
    4034             return new IXR_Error( 403, __( 'Something went wrong.' ) );
     4034            return new IXR_Error( 403, __( 'An error occurred while processing your comment. Please ensure all fields are filled correctly and try again.' ) );
    40354035        }
    40364036
     
    50525052
    50535053        if ( ! $posts_list ) {
    5054             $this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
     5054            $this->error = new IXR_Error( 500, __( 'No posts found or an error occurred while retrieving posts.' ) );
    50555055            return $this->error;
    50565056        }
     
    65856585
    65866586        if ( ! $posts_list ) {
    6587             $this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
     6587            $this->error = new IXR_Error( 500, __( 'No posts found or an error occurred while retrieving posts.' ) );
    65886588            return $this->error;
    65896589        }
  • trunk/src/wp-includes/functions.php

    r59724 r59790  
    36733673function wp_nonce_ays( $action ) {
    36743674    // Default title and response code.
    3675     $title         = __( 'Something went wrong.' );
     3675    $title         = __( 'An error occurred.' );
    36763676    $response_code = 403;
    36773677
  • trunk/src/wp-includes/script-loader.php

    r59770 r59790  
    811811        array(
    812812            'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
    813             'broken' => __( 'Something went wrong.' ),
     813            'broken' => __( 'An error occurred while processing your request. Please try again later.' ),
    814814        )
    815815    );
     
    12931293            'action'                  => __( 'Action' ),
    12941294            'discardChanges'          => __( 'Discard changes' ),
    1295             'cheatin'                 => __( 'Something went wrong.' ),
     1295            'cheatin'                 => __( 'An error occurred. Please try again later.' ),
    12961296            'notAllowedHeading'       => __( 'You need a higher level of permission.' ),
    12971297            'notAllowed'              => __( 'Sorry, you are not allowed to customize this site.' ),
  • trunk/src/wp-mail.php

    r59064 r59790  
    4040
    4141if ( $last_checked ) {
    42     wp_die( __( 'Slow down cowboy, no need to check for new mails so often!' ) );
     42    wp_die(
     43        sprintf(
     44            // translators: %s human readable rate limit.
     45            __( 'Email checks are rate limited to once every %s.' ),
     46            human_time_diff( time() - WP_MAIL_INTERVAL, time() )
     47        ),
     48        __( 'Slow down, no need to check for new mails so often!' ),
     49        429
     50    );
    4351}
    4452
Note: See TracChangeset for help on using the changeset viewer.