Theme install: Set a timeout and error message for API responses.

props ocean90.
fixes #27708.

Built from https://develop.svn.wordpress.org/trunk@28105


git-svn-id: http://core.svn.wordpress.org/trunk@27936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-04-13 19:02:14 +00:00
parent 6fc0120e20
commit cd5f8d517c
3 changed files with 3 additions and 2 deletions

View File

@ -325,6 +325,7 @@ themes.Collection = Backbone.Collection.extend({
return $.ajax({ return $.ajax({
url: 'https://api.wordpress.org/themes/info/1.1/?callback=?', url: 'https://api.wordpress.org/themes/info/1.1/?callback=?',
dataType: 'jsonp', dataType: 'jsonp',
timeout: 15000, // 15 seconds
// Request data // Request data
data: { data: {

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ 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' => ( 'There was a problem trying to load the themes. Please, try again.' ), // @todo improve 'error' => sprintf( __( 'An unexpected error occurred and we can&#8127;t reach WordPress.org. If you continue to have problems, please try the <a href="%s">support forums</a>.' ), __( 'https://wordpress.org/support/' ) )
), ),
'installedThemes' => array_keys( $installed_themes ), 'installedThemes' => array_keys( $installed_themes ),
'browse' => array( 'browse' => array(