WordPress.org

Make WordPress Core

Ticket #14999: 14999.4.diff

File 14999.4.diff, 3.1 KB (added by ryan, 3 years ago)

Refresh of .3.diff

  • wp-admin/includes/class-wp-upgrader.php

     
    5252                $this->strings['installing_package'] = __('Installing the latest version…'); 
    5353                $this->strings['folder_exists'] = __('Destination folder already exists.'); 
    5454                $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.'); 
    5656 
    5757                $this->strings['maintenance_start'] = __('Enabling Maintenance mode…'); 
    5858                $this->strings['maintenance_end'] = __('Disabling Maintenance mode…'); 
     
    193193                if ( 1 == count($source_files) && $wp_filesystem->is_dir( trailingslashit($source) . $source_files[0] . '/') ) //Only one folder? Then we want its contents. 
    194194                        $source = trailingslashit($source) . trailingslashit($source_files[0]); 
    195195                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? 
    197197                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. 
    198198                        $source = trailingslashit($source); 
    199199 
     
    562562                } 
    563563 
    564564                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 within the archive.') ); 
    566566 
    567567                return $source; 
    568568        } 
     
    836836                        return $source; 
    837837 
    838838                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.') ); 
    840840 
    841841                $info = get_theme_data( $working_directory . 'style.css' ); 
    842842                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.") ); 
    844844 
    845845                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.') ); 
    847847 
    848848                return $source; 
    849849        }