Make WordPress Core

Opened 10 years ago

Last modified 7 years ago

#28376 new enhancement

Improve error message seen by user in update.php

Reported by: podz's profile podz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.9.1
Component: Upgrade/Install Keywords: needs-patch
Focuses: ui, administration Cc:

Description

Line 117 of update.php


$response = wp_remote_post( $url, $options );
	if ( $ssl && is_wp_error( $response ) ) {
		trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
		$response = wp_remote_post( $http_url, $options );
	}

The message "Something may be wrong with WordPress.org or this server's configuration. If you continue to have problems, please try the support forums" could be better. Right now if wordpress.org is up (which code can check?) then the problem is with their host. If they post to the Support forums there is no easy answer there.

While there is a solution to this mentioned in #27091 that solution is not suitable for most users.

I would suggest a longer timeout and a message that they could copy to their webhost to assist the host if a connection is being blocked.

Change History (11)

#1 @SergeyBiryukov
10 years ago

  • Component changed from General to Upgrade/Install
  • Focuses administration added

#2 follow-up: @afercia
9 years ago

  • Focuses ui added
  • Keywords needs-patch added

Maybe worth considering also to improve the visual part. To my understanding this error is displayed as Warning only if WP_DEBUG is set to true otherwise is a Notice and very unlikely you can see it. By the way you can't even read the message since it's partially covered by the admin menu. Is there any technical reason why trigger_error is used? Would it be possible to use a WP notice instead? Also, the file name and line number reported seem not necessary.

In the screenshot below, in 3.7 it was at least possible to actually read the message. Now it's partially hidden by the admin menu and at the bottom how it would look as a notice.

https://cldup.com/KwAk18e78o.png

This ticket was mentioned in Slack in #design by afercia. View the logs.


9 years ago

#4 @melchoyce
9 years ago

Putting it into a red notice makes the most sense to me. We might want to throw the second half of it ("WordPress could not establish...") into a new paragraph and italicize? Feels confusing having them in the same paragraph.

#5 follow-up: @afercia
9 years ago

Hm didn't focus on the message content but yeah feels a bit confusing, also because it first says to try the Support Forums then it says to contact the server admin so, what should I do actually? :)
@SergeyBiryukov hi, any thoughts about the technical part namely why it's using trigger_error()?

#6 @hugobaeta
9 years ago

Yes! this makes me so happy to see! Thank you for mocking that up @afercia - that solution is so much better! I agree with @melchoyce. We could improve it further by doing that.

#7 in reply to: ↑ 5 ; follow-up: @SergeyBiryukov
9 years ago

Replying to afercia:

@SergeyBiryukov hi, any thoughts about the technical part namely why it's using trigger_error()?

See comment:8:ticket:19196.

#8 in reply to: ↑ 7 @afercia
9 years ago

Replying to SergeyBiryukov:

See comment:8:ticket:19196.

Hm but in this case this is not a PHP error. It's a WP/API/network error displayed via trigger_error and thus it looks like a PHP error.

#9 in reply to: ↑ 2 @SergeyBiryukov
9 years ago

Replying to afercia:

By the way you can't even read the message since it's partially covered by the admin menu.

Related: #24545

#10 @afercia
9 years ago

Related: #35155.

#11 @SergeyBiryukov
7 years ago

#42418 was marked as a duplicate.

Note: See TracTickets for help on using tickets.