Skip to content

Commit 6309ca8

Browse files
committed
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. Built from https://develop.svn.wordpress.org/trunk@59790 git-svn-id: http://core.svn.wordpress.org/trunk@59132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent c5293a0 commit 6309ca8

6 files changed

+17
-9
lines changed

wp-includes/class-wp-customize-manager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ protected function wp_die( $ajax_message, $message = null ) {
454454
}
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

460460
if ( $this->messenger_channel ) {

wp-includes/class-wp-xmlrpc-server.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,7 @@ public function wp_newComment( $args ) {
40314031
}
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

40374037
/**
@@ -5051,7 +5051,7 @@ public function blogger_getRecentPosts( $args ) {
50515051
$posts_list = wp_get_recent_posts( $query );
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
}
50575057

@@ -6584,7 +6584,7 @@ public function mt_getRecentPostTitles( $args ) {
65846584
$posts_list = wp_get_recent_posts( $query );
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
}
65906590

wp-includes/functions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3672,7 +3672,7 @@ function get_allowed_mime_types( $user = null ) {
36723672
*/
36733673
function 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

36783678
if ( 'log-out' === $action ) {

wp-includes/script-loader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ function wp_default_scripts( $scripts ) {
810810
'wpAjax',
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
);
816816

@@ -1292,7 +1292,7 @@ function wp_default_scripts( $scripts ) {
12921292
'close' => __( 'Close' ),
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.' ),
12981298
'previewIframeTitle' => __( 'Site Preview' ),

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-59789';
19+
$wp_version = '6.8-alpha-59790';
2020

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

wp-mail.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939
$last_checked = get_transient( 'mailserver_last_checked' );
4040

4141
if ( $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

4553
set_transient( 'mailserver_last_checked', true, WP_MAIL_INTERVAL );

0 commit comments

Comments
 (0)