From 872428d60d41321334f1b0a316d6d7d26daa92a2 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 10 Nov 2011 19:41:44 +0000 Subject: [PATCH] More specific error strings for failed theme and plugin package uploads. Props dd32. fixes #14999 git-svn-id: http://svn.automattic.com/wordpress/trunk@19246 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-upgrader.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index dda56d8e57..e61e0ef5e4 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -52,7 +52,7 @@ class WP_Upgrader { $this->strings['installing_package'] = __('Installing the latest version…'); $this->strings['folder_exists'] = __('Destination folder already exists.'); $this->strings['mkdir_failed'] = __('Could not create directory.'); - $this->strings['incompatible_archive'] = __('The package is corrupt or not in the correct format.'); + $this->strings['incompatible_archive'] = __('The package could not be installed.'); $this->strings['maintenance_start'] = __('Enabling Maintenance mode…'); $this->strings['maintenance_end'] = __('Disabling Maintenance mode…'); @@ -193,7 +193,7 @@ class WP_Upgrader { if ( 1 == count($source_files) && $wp_filesystem->is_dir( trailingslashit($source) . $source_files[0] . '/') ) //Only one folder? Then we want its contents. $source = trailingslashit($source) . trailingslashit($source_files[0]); elseif ( count($source_files) == 0 ) - return new WP_Error('incompatible_archive', $this->strings['incompatible_archive']); //There are no files? + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __( 'The plugin contains no files.' ) ); //There are no files? else //Its only a single file, The upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename. $source = trailingslashit($source); @@ -562,7 +562,7 @@ class Plugin_Upgrader extends WP_Upgrader { } if ( ! $plugins_found ) - return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] ); + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('No valid plugins were found.') ); return $source; } @@ -836,14 +836,14 @@ class Theme_Upgrader extends WP_Upgrader { return $source; if ( ! file_exists( $working_directory . 'style.css' ) ) // A proper archive should have a style.css file in the single subdirectory - return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] ); + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the style.css stylesheet.') ); $info = get_theme_data( $working_directory . 'style.css' ); if ( empty($info['Name']) ) - return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] ); + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __("The style.css stylesheet doesn't contain a valid theme header.") ); if ( empty($info['Template']) && ! file_exists( $working_directory . 'index.php' ) ) // If no template is set, it must have at least an index.php to be legit. - return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] ); + return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the index.php file.') ); return $source; }