Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#31023 closed enhancement (duplicate)

avoid logging update requests error when WP_HTTP_BLOCK_EXTERNAL is set

Reported by: dpik's profile dpik Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

When WP_HTTP_BLOCK_EXTERNAL is set, error log is growing fast.

wp-includes/update.php unconditionally reports an error when the request failed:

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 );

if user blocked external requests, I think it should not be logged.

I suggest we check if url is blocked before making the request and silently return if we can't. See diff file implementing this.

Attachments (1)

31023.diff (2.3 KB) - added by dpik 10 years ago.
wp-includes/update.php patch

Download all attachments as: .zip

Change History (4)

@dpik
10 years ago

wp-includes/update.php patch

#1 @dpik
10 years ago

  • Keywords has-patch added

#2 @jesin
10 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #29719.

#3 @DrewAPicture
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.