From 5b64115fc6d1e50fb1e600c58cd7e878f78264fc Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 9 May 2012 15:55:59 +0000 Subject: [PATCH] Friendlier strings with links to the support forums when experiencing problems talking to api.wordpress.org. fixes #20605 git-svn-id: https://develop.svn.wordpress.org/trunk@20752 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/plugin-install.php | 4 ++-- wp-admin/includes/theme.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 25cd76ca26..fa629a2e45 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -43,11 +43,11 @@ function plugins_api($action, $args = null) { if ( false === $res ) { $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) ); if ( is_wp_error($request) ) { - $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); + $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 support forums.' ), $request->get_error_message() ); } else { $res = maybe_unserialize( wp_remote_retrieve_body( $request ) ); if ( ! is_object( $res ) && ! is_array( $res ) ) - $res = new WP_Error('plugins_api_failed', __('An unknown error occurred during the API request.'), wp_remote_retrieve_body( $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 support forums.' ), wp_remote_retrieve_body( $request ) ); } } elseif ( !is_wp_error($res) ) { $res->external = true; diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 0bc0c02f32..6e5767e52d 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -283,11 +283,11 @@ function themes_api($action, $args = null) { if ( ! $res ) { $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) ); if ( is_wp_error($request) ) { - $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); + $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 support forums.' ), $request->get_error_message() ); } else { $res = maybe_unserialize( wp_remote_retrieve_body( $request ) ); if ( ! is_object( $res ) && ! is_array( $res ) ) - $res = new WP_Error('themes_api_failed', __('An unknown error occurred during the API request.'), wp_remote_retrieve_body( $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 support forums.' ), wp_remote_retrieve_body( $request ) ); } }