Changeset 19246
- Timestamp:
- 11/10/2011 07:41:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-upgrader.php
r19115 r19246 53 53 $this->strings['folder_exists'] = __('Destination folder already exists.'); 54 54 $this->strings['mkdir_failed'] = __('Could not create directory.'); 55 $this->strings['incompatible_archive'] = __('The package is corrupt or not in the correct format.');55 $this->strings['incompatible_archive'] = __('The package could not be installed.'); 56 56 57 57 $this->strings['maintenance_start'] = __('Enabling Maintenance mode…'); … … 194 194 $source = trailingslashit($source) . trailingslashit($source_files[0]); 195 195 elseif ( count($source_files) == 0 ) 196 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive']); //There are no files?196 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __( 'The plugin contains no files.' ) ); //There are no files? 197 197 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. 198 198 $source = trailingslashit($source); … … 563 563 564 564 if ( ! $plugins_found ) 565 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] );565 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('No valid plugins were found.') ); 566 566 567 567 return $source; … … 837 837 838 838 if ( ! file_exists( $working_directory . 'style.css' ) ) // A proper archive should have a style.css file in the single subdirectory 839 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] );839 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the <code>style.css</code> stylesheet.') ); 840 840 841 841 $info = get_theme_data( $working_directory . 'style.css' ); 842 842 if ( empty($info['Name']) ) 843 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] );843 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __("The <code>style.css</code> stylesheet doesn't contain a valid theme header.") ); 844 844 845 845 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. 846 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'] );846 return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __('The theme is missing the <code>index.php</code> file.') ); 847 847 848 848 return $source;
Note: See TracChangeset
for help on using the changeset viewer.