]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/update.php
WordPress 4.7.1-scripts
[autoinstalls/wordpress.git] / wp-includes / update.php
index 59b618c31a1445ab3b79912e2d596d91bc5f0d89..f0b999a4cc5a13a637a0b6de355500371c7d866f 100644 (file)
@@ -120,7 +120,14 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
 
        $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 );
+               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/' )
+                       ) . ' ' . __( '(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 );
        }
 
@@ -303,7 +310,14 @@ function wp_update_plugins( $extra_stats = array() ) {
 
        $raw_response = wp_remote_post( $url, $options );
        if ( $ssl && is_wp_error( $raw_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 );
+               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/' )
+                       ) . ' ' . __( '(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
+               );
                $raw_response = wp_remote_post( $http_url, $options );
        }
 
@@ -476,7 +490,14 @@ function wp_update_themes( $extra_stats = array() ) {
 
        $raw_response = wp_remote_post( $url, $options );
        if ( $ssl && is_wp_error( $raw_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 );
+               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/' )
+                       ) . ' ' . __( '(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
+               );
                $raw_response = wp_remote_post( $http_url, $options );
        }
 
@@ -566,14 +587,21 @@ function wp_get_update_data() {
 
        $counts['total'] = $counts['plugins'] + $counts['themes'] + $counts['wordpress'] + $counts['translations'];
        $titles = array();
-       if ( $counts['wordpress'] )
+       if ( $counts['wordpress'] ) {
+               /* translators: 1: Number of updates available to WordPress */
                $titles['wordpress'] = sprintf( __( '%d WordPress Update'), $counts['wordpress'] );
-       if ( $counts['plugins'] )
+       }
+       if ( $counts['plugins'] ) {
+               /* translators: 1: Number of updates available to plugins */
                $titles['plugins'] = sprintf( _n( '%d Plugin Update', '%d Plugin Updates', $counts['plugins'] ), $counts['plugins'] );
-       if ( $counts['themes'] )
+       }
+       if ( $counts['themes'] ) {
+               /* translators: 1: Number of updates available to themes */
                $titles['themes'] = sprintf( _n( '%d Theme Update', '%d Theme Updates', $counts['themes'] ), $counts['themes'] );
-       if ( $counts['translations'] )
+       }
+       if ( $counts['translations'] ) {
                $titles['translations'] = __( 'Translation Updates' );
+       }
 
        $update_title = $titles ? esc_attr( implode( ', ', $titles ) ) : '';
 
@@ -678,7 +706,7 @@ function wp_clean_update_cache() {
        delete_site_transient( 'update_core' );
 }
 
-if ( ( ! is_main_site() && ! is_network_admin() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
+if ( ( ! is_main_site() && ! is_network_admin() ) || wp_doing_ajax() ) {
        return;
 }