Making WordPress.org

Ticket #2700: 2700.2.diff

File 2700.2.diff, 7.9 KB (added by SergeyBiryukov, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

     
    7373                // Let's check some plugin headers, shall we?
    7474                // Catches both empty Plugin Name & when no valid files could be found.
    7575                if ( empty( $this->plugin['Name'] ) ) {
    76                         $error = __( 'The plugin has no name.', 'wporg-plugins' );
     76                        $error = __( 'Error: The plugin has no name.', 'wporg-plugins' );
    7777
    7878                        /* translators: 1: plugin header line, 2: Codex URL */
    7979                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
     
    8888                $this->plugin_slug = sanitize_title_with_dashes( $this->plugin_slug );
    8989
    9090                if ( ! $this->plugin_slug ) {
    91                         $error = __( 'The plugin has an unsupported name.', 'wporg-plugins' );
     91                        $error = __( 'Error: The plugin has an unsupported name.', 'wporg-plugins' );
    9292
    9393                        /* translators: %s: 'Plugin Name:' */
    9494                        return $error . ' ' . sprintf( __( 'Plugin names can only contain latin letters (A-z), numbers, spaces, and hyphens. Please change the %s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     
    9999
    100100                // Make sure it doesn't use a slug deemed not to be used by the public.
    101101                if ( $this->has_reserved_slug() ) {
    102                         $error = __( 'The plugin has a reserved name.', 'wporg-plugins' );
     102                        $error = __( 'Error: The plugin has a reserved name.', 'wporg-plugins' );
    103103                       
    104104                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    105105                        return $error . ' ' . sprintf( __( 'Your chosen plugin name - %1$s - has been reserved for use by WordPress. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     
    112112
    113113                // Is there already a plugin with the same slug by a different author?
    114114                if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) {
    115                         $error = __( 'The plugin already exists.', 'wporg-plugins' );
     115                        $error = __( 'Error: The plugin already exists.', 'wporg-plugins' );
    116116                       
    117117                        /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    118118                        return $error . ' ' . sprintf( __( 'There is already a plugin called %1$s by a different author. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     
    123123
    124124                // Is there already a plugin with the same slug by the same author?
    125125                if ( $plugin_post ) {
    126                         $error = __( 'The plugin has already been submitted.', 'wporg-plugins' );
     126                        $error = __( 'Error: The plugin has already been submitted.', 'wporg-plugins' );
    127127                       
    128128                        /* translators: 1: plugin slug, 2: plugins@wordpress.org */
    129129                        return $error . ' ' . sprintf( __( 'You have already submitted a plugin called %1$s. Please be patient and wait for a review. If you have made a mistake, please email <a href="mailto:%2$s">%2$s</a> and let us know.', 'wporg-plugins' ),
     
    133133                }
    134134
    135135                if ( ! $this->plugin['Description'] ) {
    136                         $error = __( 'The plugin has no description.', 'wporg-plugins' );
     136                        $error = __( 'Error: The plugin has no description.', 'wporg-plugins' );
    137137
    138138                        /* translators: 1: plugin header line, 2: Codex URL */
    139139                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
     
    143143                }
    144144
    145145                if ( ! $this->plugin['Version'] ) {
    146                         $error = __( 'The plugin has no version.', 'wporg-plugins' );
     146                        $error = __( 'Error: The plugin has no version.', 'wporg-plugins' );
    147147
    148148                        /* translators: 1: plugin header line, 2: Codex URL */
    149149                        return $error . ' ' . sprintf( __( 'Add a %1$s line to your main plugin file and upload the plugin again. <a href="%2$s">Plugin Headers</a>', 'wporg-plugins' ),
     
    153153                }
    154154
    155155                if ( preg_match( '|[^\d\.]|', $this->plugin['Version'] ) ) {
    156                         $error = __( 'The plugin has an invalid version.', 'wporg-plugins' );
     156                        $error = __( 'Error: Plugin versions are expected to be numbers.', 'wporg-plugins' );
    157157                       
    158158                        /* translators: %s: 'Version:' */
    159                         return $error . ' ' . sprintf( __( 'Version strings can only contain numeric and period characters (like 1.2). Please fix your %s line in your main plugin file and upload the plugin again.', 'wporg-plugins' ),
     159                        return $error . ' ' . sprintf( __( 'Version strings can only contain numeric and period characters (like 1.2). Please fix the %s line in your main plugin file and upload the plugin again.', 'wporg-plugins' ),
    160160                                '<code>Version:</code>'
    161161                        );
    162162                }
     
    163163
    164164                // Prevent duplicate URLs.
    165165                if ( ! empty( $this->plugin['PluginURI'] ) && ! empty( $this->plugin['AuthorURI'] ) && $this->plugin['PluginURI'] == $this->plugin['AuthorURI'] ) {
    166                         $error = __( 'The plugin has duplicate plugin and author URLs.', 'wporg-plugins' );
     166                        $error = __( 'Error: Your plugin and author URIs are the same.', 'wporg-plugins' );
    167167                       
    168168                        return $error . ' ' . __( 'A plugin URL is a page/site that provides details about this specific plugin. An author URL is a page/site that provides information about the author of the plugin. You are not required to provide both, so pick the one that best applies to your URL.', 'wporg-plugins' );
    169169                }
     
    170170
    171171                $readme = $this->find_readme_file();
    172172                if ( empty( $readme ) ) {
    173                         $error = __( 'The plugin is missing a readme.', 'wporg-plugins' );
     173                        $error = __( 'Error: The plugin has no readme.', 'wporg-plugins' );
    174174                       
    175175                        /* translators: 1: readme.txt, 2: readme.md */
    176                         return $error . ' ' . sprintf( __( 'The zip file must include a file named %1$s or %2$s.', 'wporg-plugins' ),
     176                        return $error . ' ' . sprintf( __( 'The zip file must include a file named %1$s or %2$s. We recommend using %1s as it will allow you to fully utilize our directory.', 'wporg-plugins' ),
    177177                                '<code>readme.txt</code>',
    178178                                '<code>readme.md</code>'
    179179                        );
     
    185185                $result = $this->check_plugin();
    186186
    187187                if ( ! $result ) {
    188                         $error = __( 'The plugin has failed the automated checks.', 'wporg-plugins' );
     188                        $error = __( 'Error: The plugin has failed the automated checks.', 'wporg-plugins' );
    189189                       
    190190                        /* translators: 1: Plugin Check Plugin URL, 2: make.wordpress.org/plugins */
    191                         return $error . ' ' . sprintf( __( 'Please correct the problems with it and upload it again. You can also use the <a href="%1$s">Plugin Check Plugin</a> to test your plugin before uploading. If you have any questions about this please post them to %2$s.', 'wporg-plugins' ),
     191                        return $error . ' ' . sprintf( __( 'Please correct the problems with the plugin and upload it again. You can also use the <a href="%1$s">Plugin Check Plugin</a> to test your plugin before uploading. If you have any questions about this please post them to %2$s.', 'wporg-plugins' ),
    192192                                '//wordpress.org/plugins/plugin-check/',
    193193                                '<a href="https://make.wordpress.org/plugins">https://make.wordpress.org/plugins</a>'
    194194                        );
     
    299299                        'developers',
    300300                        'admin',
    301301                        'wp-admin',
     302                        'wordpress',
    302303                );
    303304
    304305                return in_array( $this->plugin_slug, $reserved_slugs );
     
    389390
    390391If there is a problem with this submission, such as an incorrect display name or slug, please reply to this email and let us know. In most cases, we can correct errors as long as the plugin has not yet been approved. Please do not submit your plugin multiple times in an attempt to correct the issue, just email us.
    391392
     393Remember to read the developer guidelines: https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/
     394
     395Please make sure to follow our official blog: https://make.wordpress.org/plugins/
     396
    392397--
    393398The WordPress Plugin Directory Team
    394399https://make.wordpress.org/plugins', 'wporg-plugins' ),