I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.
Props ramiy, SergeyBiryukov. Fixes #38880. git-svn-id: https://develop.svn.wordpress.org/trunk@39325 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
942302eb63
commit
7faf699c69
@ -155,16 +155,38 @@ function plugins_api( $action, $args = array() ) {
|
|||||||
$request = wp_remote_post( $url, $http_args );
|
$request = wp_remote_post( $url, $http_args );
|
||||||
|
|
||||||
if ( $ssl && is_wp_error( $request ) ) {
|
if ( $ssl && is_wp_error( $request ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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
|
||||||
|
);
|
||||||
$request = wp_remote_post( $http_url, $http_args );
|
$request = wp_remote_post( $http_url, $http_args );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_wp_error($request) ) {
|
if ( is_wp_error($request) ) {
|
||||||
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
|
$res = new WP_Error( 'plugins_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
$request->get_error_message()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
|
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
|
||||||
if ( ! is_object( $res ) && ! is_array( $res ) )
|
if ( ! is_object( $res ) && ! is_array( $res ) ) {
|
||||||
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
|
$res = new WP_Error( 'plugins_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
wp_remote_retrieve_body( $request )
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} elseif ( !is_wp_error($res) ) {
|
} elseif ( !is_wp_error($res) ) {
|
||||||
$res->external = true;
|
$res->external = true;
|
||||||
|
@ -462,17 +462,39 @@ function themes_api( $action, $args = array() ) {
|
|||||||
|
|
||||||
if ( $ssl && is_wp_error( $request ) ) {
|
if ( $ssl && is_wp_error( $request ) ) {
|
||||||
if ( ! wp_doing_ajax() ) {
|
if ( ! wp_doing_ajax() ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$request = wp_remote_post( $http_url, $http_args );
|
$request = wp_remote_post( $http_url, $http_args );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_wp_error($request) ) {
|
if ( is_wp_error($request) ) {
|
||||||
$res = new WP_Error('themes_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
|
$res = new WP_Error( 'themes_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
$request->get_error_message()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
|
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
|
||||||
if ( ! is_object( $res ) && ! is_array( $res ) )
|
if ( ! is_object( $res ) && ! is_array( $res ) ) {
|
||||||
$res = new WP_Error('themes_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
|
$res = new WP_Error( 'themes_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
wp_remote_retrieve_body( $request )
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,17 +56,38 @@ function translations_api( $type, $args = null ) {
|
|||||||
$request = wp_remote_post( $url, $options );
|
$request = wp_remote_post( $url, $options );
|
||||||
|
|
||||||
if ( $ssl && is_wp_error( $request ) ) {
|
if ( $ssl && is_wp_error( $request ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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
|
||||||
|
);
|
||||||
|
|
||||||
$request = wp_remote_post( $http_url, $options );
|
$request = wp_remote_post( $http_url, $options );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_wp_error( $request ) ) {
|
if ( is_wp_error( $request ) ) {
|
||||||
$res = new WP_Error( 'translations_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
|
$res = new WP_Error( 'translations_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
$request->get_error_message()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$res = json_decode( wp_remote_retrieve_body( $request ), true );
|
$res = json_decode( wp_remote_retrieve_body( $request ), true );
|
||||||
if ( ! is_object( $res ) && ! is_array( $res ) ) {
|
if ( ! is_object( $res ) && ! is_array( $res ) ) {
|
||||||
$res = new WP_Error( 'translations_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
|
$res = new WP_Error( 'translations_api_failed',
|
||||||
|
sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
|
wp_remote_retrieve_body( $request )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,14 @@ function get_core_checksums( $version, $locale ) {
|
|||||||
|
|
||||||
$response = wp_remote_get( $url, $options );
|
$response = wp_remote_get( $url, $options );
|
||||||
if ( $ssl && is_wp_error( $response ) ) {
|
if ( $ssl && is_wp_error( $response ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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_get( $http_url, $options );
|
$response = wp_remote_get( $http_url, $options );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,11 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
|
|||||||
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
|
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
|
||||||
'upload' => __( 'Upload Theme' ),
|
'upload' => __( 'Upload Theme' ),
|
||||||
'back' => __( 'Back' ),
|
'back' => __( 'Back' ),
|
||||||
'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
|
'error' => sprintf(
|
||||||
|
/* translators: %s: support forums URL */
|
||||||
|
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
|
||||||
|
__( 'https://wordpress.org/support/' )
|
||||||
|
),
|
||||||
'themesFound' => __( 'Number of Themes found: %d' ),
|
'themesFound' => __( 'Number of Themes found: %d' ),
|
||||||
'noThemesFound' => __( 'No themes found. Try a different search.' ),
|
'noThemesFound' => __( 'No themes found. Try a different search.' ),
|
||||||
'collapseSidebar' => __( 'Collapse Sidebar' ),
|
'collapseSidebar' => __( 'Collapse Sidebar' ),
|
||||||
|
@ -120,7 +120,14 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
|
|||||||
|
|
||||||
$response = wp_remote_post( $url, $options );
|
$response = wp_remote_post( $url, $options );
|
||||||
if ( $ssl && is_wp_error( $response ) ) {
|
if ( $ssl && is_wp_error( $response ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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 );
|
$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 );
|
$raw_response = wp_remote_post( $url, $options );
|
||||||
if ( $ssl && is_wp_error( $raw_response ) ) {
|
if ( $ssl && is_wp_error( $raw_response ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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 );
|
$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 );
|
$raw_response = wp_remote_post( $url, $options );
|
||||||
if ( $ssl && is_wp_error( $raw_response ) ) {
|
if ( $ssl && is_wp_error( $raw_response ) ) {
|
||||||
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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’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 );
|
$raw_response = wp_remote_post( $http_url, $options );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user