General: Error messages improvements in /wp-includes files.
Some checks are pending
Cleanup Pull Requests / Clean up pull requests (push) Waiting to run
Coding Standards / PHP coding standards (push) Waiting to run
Coding Standards / JavaScript coding standards (push) Waiting to run
Coding Standards / Slack Notifications (push) Blocked by required conditions
Coding Standards / Failed workflow tasks (push) Blocked by required conditions
End-to-end Tests / Test with SCRIPT_DEBUG disabled (push) Waiting to run
End-to-end Tests / Test with SCRIPT_DEBUG enabled (push) Waiting to run
End-to-end Tests / Slack Notifications (push) Blocked by required conditions
End-to-end Tests / Failed workflow tasks (push) Blocked by required conditions
JavaScript Tests / QUnit Tests (push) Waiting to run
JavaScript Tests / Slack Notifications (push) Blocked by required conditions
JavaScript Tests / Failed workflow tasks (push) Blocked by required conditions
Performance Tests / Determine Matrix (push) Waiting to run
Performance Tests / ${{ matrix.multisite && 'Multisite' || 'Single Site' }} ${{ matrix.memcached && 'Memcached' || 'Default' }} (push) Blocked by required conditions
Performance Tests / Compare (push) Blocked by required conditions
Performance Tests / Slack Notifications (push) Blocked by required conditions
Performance Tests / Failed workflow tasks (push) Blocked by required conditions
PHP Compatibility / Check PHP compatibility (push) Waiting to run
PHP Compatibility / Slack Notifications (push) Blocked by required conditions
PHP Compatibility / Failed workflow tasks (push) Blocked by required conditions
PHPUnit Tests / PHP 7.2 (push) Waiting to run
PHPUnit Tests / PHP 7.3 (push) Waiting to run
PHPUnit Tests / PHP 7.4 (push) Waiting to run
PHPUnit Tests / PHP 8.0 (push) Waiting to run
PHPUnit Tests / PHP 8.1 (push) Waiting to run
PHPUnit Tests / PHP 8.2 (push) Waiting to run
PHPUnit Tests / PHP 8.3 (push) Waiting to run
PHPUnit Tests / PHP 8.4 (push) Waiting to run
PHPUnit Tests / html-api-html5lib-tests (push) Waiting to run
PHPUnit Tests / Slack Notifications (push) Blocked by required conditions
PHPUnit Tests / Failed workflow tasks (push) Blocked by required conditions
Test Build Processes / Core running from build (push) Waiting to run
Test Build Processes / Core running from src (push) Waiting to run
Test Build Processes / Gutenberg running from build (push) Waiting to run
Test Build Processes / Gutenberg running from src (push) Waiting to run
Test Build Processes / Slack Notifications (push) Blocked by required conditions
Test Build Processes / Failed workflow tasks (push) Blocked by required conditions

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
This commit is contained in:
Jb Audras 2025-02-08 15:58:11 +00:00
parent 3428f3a0f9
commit bd3fdcce07
5 changed files with 16 additions and 8 deletions

View File

@ -454,7 +454,7 @@ final class WP_Customize_Manager {
}
if ( ! $message ) {
$message = __( 'Something went wrong.' );
$message = __( 'An error occurred while customizing. Please refresh the page and try again.' );
}
if ( $this->messenger_channel ) {

View File

@ -4031,7 +4031,7 @@ class wp_xmlrpc_server extends IXR_Server {
}
if ( ! $comment_id ) {
return new IXR_Error( 403, __( 'Something went wrong.' ) );
return new IXR_Error( 403, __( 'An error occurred while processing your comment. Please ensure all fields are filled correctly and try again.' ) );
}
/**
@ -5051,7 +5051,7 @@ class wp_xmlrpc_server extends IXR_Server {
$posts_list = wp_get_recent_posts( $query );
if ( ! $posts_list ) {
$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
$this->error = new IXR_Error( 500, __( 'No posts found or an error occurred while retrieving posts.' ) );
return $this->error;
}
@ -6584,7 +6584,7 @@ class wp_xmlrpc_server extends IXR_Server {
$posts_list = wp_get_recent_posts( $query );
if ( ! $posts_list ) {
$this->error = new IXR_Error( 500, __( 'Either there are no posts, or something went wrong.' ) );
$this->error = new IXR_Error( 500, __( 'No posts found or an error occurred while retrieving posts.' ) );
return $this->error;
}

View File

@ -3672,7 +3672,7 @@ function get_allowed_mime_types( $user = null ) {
*/
function wp_nonce_ays( $action ) {
// Default title and response code.
$title = __( 'Something went wrong.' );
$title = __( 'An error occurred.' );
$response_code = 403;
if ( 'log-out' === $action ) {

View File

@ -810,7 +810,7 @@ function wp_default_scripts( $scripts ) {
'wpAjax',
array(
'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
'broken' => __( 'Something went wrong.' ),
'broken' => __( 'An error occurred while processing your request. Please try again later.' ),
)
);
@ -1292,7 +1292,7 @@ function wp_default_scripts( $scripts ) {
'close' => __( 'Close' ),
'action' => __( 'Action' ),
'discardChanges' => __( 'Discard changes' ),
'cheatin' => __( 'Something went wrong.' ),
'cheatin' => __( 'An error occurred. Please try again later.' ),
'notAllowedHeading' => __( 'You need a higher level of permission.' ),
'notAllowed' => __( 'Sorry, you are not allowed to customize this site.' ),
'previewIframeTitle' => __( 'Site Preview' ),

View File

@ -39,7 +39,15 @@ if ( ! defined( 'WP_MAIL_INTERVAL' ) ) {
$last_checked = get_transient( 'mailserver_last_checked' );
if ( $last_checked ) {
wp_die( __( 'Slow down cowboy, no need to check for new mails so often!' ) );
wp_die(
sprintf(
// translators: %s human readable rate limit.
__( 'Email checks are rate limited to once every %s.' ),
human_time_diff( time() - WP_MAIL_INTERVAL, time() )
),
__( 'Slow down, no need to check for new mails so often!' ),
429
);
}
set_transient( 'mailserver_last_checked', true, WP_MAIL_INTERVAL );