Skip to content

Commit bd3fdcc

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. git-svn-id: https://develop.svn.wordpress.org/trunk@59790 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3428f3a commit bd3fdcc

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
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 ) {

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

Lines changed: 3 additions & 3 deletions
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

src/wp-includes/functions.php

Lines changed: 1 addition & 1 deletion
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 ) {

src/wp-includes/script-loader.php

Lines changed: 2 additions & 2 deletions
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' ),

src/wp-mail.php

Lines changed: 9 additions & 1 deletion
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)