Changeset 25763 for trunk/src/wp-admin/includes/class-wp-upgrader.php
- Timestamp:
- 10/11/2013 04:05:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r25755 r25763 214 214 $source = trailingslashit($source) . trailingslashit($source_files[0]); 215 215 elseif ( count($source_files) == 0 ) 216 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'], $this->strings['no_files'] ); //There are no files?216 return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files? 217 217 else //It's only a single file, the upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename. 218 218 $source = trailingslashit($source); … … 263 263 if ( !$wp_filesystem->exists($remote_destination) ) 264 264 if ( !$wp_filesystem->mkdir($remote_destination, FS_CHMOD_DIR) ) 265 return new WP_Error( 'mkdir_failed', $this->strings['mkdir_failed'], $remote_destination);265 return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination ); 266 266 267 267 // Copy new version of item into place. … … 624 624 625 625 if ( ! $plugins_found ) 626 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'], __('No valid plugins were found.') );626 return new WP_Error( 'incompatible_archive_no_plugins', $this->strings['incompatible_archive'], __( 'No valid plugins were found.' ) ); 627 627 628 628 return $source; … … 990 990 // A proper archive should have a style.css file in the single subdirectory 991 991 if ( ! file_exists( $working_directory . 'style.css' ) ) 992 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'], __('The theme is missing the <code>style.css</code> stylesheet.') );992 return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>style.css</code> stylesheet.' ) ); 993 993 994 994 $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) ); 995 995 996 996 if ( empty( $info['Name'] ) ) 997 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'], __("The <code>style.css</code> stylesheet doesn't contain a valid theme header.") );997 return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'], __( "The <code>style.css</code> stylesheet doesn't contain a valid theme header." ) ); 998 998 999 999 // If it's not a child theme, it must have at least an index.php to be legit. 1000 1000 if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) 1001 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'], __('The theme is missing the <code>index.php</code> file.') );1001 return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'], __( 'The theme is missing the <code>index.php</code> file.' ) ); 1002 1002 1003 1003 return $source; … … 1142 1142 if ( ! $wp_filesystem->exists( $remote_destination ) ) 1143 1143 if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) 1144 return new WP_Error( 'mkdir_failed ', $this->strings['mkdir_failed'], $remote_destination );1144 return new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination ); 1145 1145 1146 1146 foreach ( $language_updates as $language_update ) { … … 1201 1201 1202 1202 if ( ! $mo || ! $po ) 1203 return new WP_Error( 'incompatible_archive ', $this->strings['incompatible_archive'],1203 return new WP_Error( 'incompatible_archive_pomo', $this->strings['incompatible_archive'], 1204 1204 __( 'The language pack is missing either the <code>.po</code> or <code>.mo</code> files.' ) ); 1205 1205 … … 1288 1288 if ( !$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) { 1289 1289 $wp_filesystem->delete($working_dir, true); 1290 return new WP_Error( 'copy_failed', $this->strings['copy_failed']);1290 return new WP_Error( 'copy_failed_for_update_core_file', $this->strings['copy_failed'] ); 1291 1291 } 1292 1292 $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE);
Note: See TracChangeset
for help on using the changeset viewer.