From e7524d0ba7d219d1dd27766ed8b1e7cb06e19c89 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 13 Apr 2014 19:01:21 +0000 Subject: [PATCH] Theme install: Set a timeout and error message for API responses. props ocean90. fixes #27708. git-svn-id: https://develop.svn.wordpress.org/trunk@28105 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/theme.js | 1 + src/wp-admin/theme-install.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 79fe3c8d86..6f4e378b4f 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -325,6 +325,7 @@ themes.Collection = Backbone.Collection.extend({ return $.ajax({ url: 'https://api.wordpress.org/themes/info/1.1/?callback=?', dataType: 'jsonp', + timeout: 15000, // 15 seconds // Request data data: { diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 6df165d545..77efdeb7cf 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -56,7 +56,7 @@ wp_localize_script( 'theme', '_wpThemeSettings', array( 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) 'upload' => __( 'Upload Theme' ), 'back' => __( 'Back' ), - 'error' => ( 'There was a problem trying to load the themes. Please, try again.' ), // @todo improve + 'error' => sprintf( __( 'An unexpected error occurred and we can᾿t reach WordPress.org. If you continue to have problems, please try the support forums.' ), __( 'https://wordpress.org/support/' ) ) ), 'installedThemes' => array_keys( $installed_themes ), 'browse' => array(