Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unexpected error occurred in update.php #508

Open
PHuhn opened this issue Jun 3, 2023 · 1 comment
Open

An unexpected error occurred in update.php #508

PHuhn opened this issue Jun 3, 2023 · 1 comment

Comments

@PHuhn
Copy link

PHuhn commented Jun 3, 2023

Hey Patrick:

I've been getting the following registered in the DEBUG. logs:

[01-Jun-2023 15:42:54 UTC] PHP Warning:  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/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in C:\inetpub\WP5_GC_2021_01\wp-includes\update.php on line 224
[01-Jun-2023 15:42:54 UTC] PHP Warning:  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/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in C:\inetpub\WP5_GC_2021_01\wp-includes\update.php on line 462
[01-Jun-2023 15:42:54 UTC] PHP Warning:  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/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in C:\inetpub\WP5_GC_2021_01\wp-includes\update.php on line 751

Looking at the code the error is really the same error in code that has been duplicated:

if ( $ssl && is_wp_error( $response ) ) {
  trigger_error(
    sprintf(
      /* translators: %s: Support forums URL. */
      __( '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="%s">support forums</a>.' ),
      __( 'https://wordpress.org/support/forums/' )
    ) . ' ' . __( '(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   // <-- error here line 224
  );
  $response = wp_remote_post( $http_url, $options );
}
...
if ( $ssl && is_wp_error( $raw_response ) ) {
  trigger_error(
    sprintf(
      /* translators: %s: Support forums URL. */
      __( '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="%s">support forums</a>.' ),
      __( 'https://wordpress.org/support/forums/' )
    ) . ' ' . __( '(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   // <-- error here line 462
  );
  $raw_response = wp_remote_post( $http_url, $options );
}
...
if ( $ssl && is_wp_error( $raw_response ) ) {
  trigger_error(
    sprintf(
      /* translators: %s: Support forums URL. */
      __( '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="%s">support forums</a>.' ),
    __( 'https://wordpress.org/support/forums/' )
    ) . ' ' . __( '(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   // <-- error here line 751
  );
  $raw_response = wp_remote_post( $http_url, $options );
}

Unfortunately, I don't have a solution for this one. I'd have to dig deeper into the code. In reality, I don't know how to read that line of code.

@marypeng1020
Copy link

Add parenthesis :
(headers_sent() || WP_DEBUG) ? E_USER_WARNING : E_USER_NOTICE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants