WordPress.org

Making WordPress.org

Ticket #2700: 2700.diff

File 2700.diff, 7.8 KB (added by Ipstenu, 5 years ago)
  • 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: comment 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' ),
     
    8787
    8888                // Make sure it doesn't use a slug deemed not to be used by the public.
    8989                if ( $this->has_reserved_slug() ) {
     90                        $error = __( 'Error: Use of a restricted plugin name.', 'wporg-plugins' );
     91                       
    9092                        /* translators: %s: plugin slug */
    91                         return sprintf( __( 'Sorry, the plugin name %s is reserved for use by WordPress. Please change the name of your plugin and upload it again.', 'wporg-plugins' ),
     93                        return $error . ' ' . sprintf( __( 'Sorry, the plugin name %s is reserved for use by WordPress. Please change the name of your plugin and upload it again.', 'wporg-plugins' ),
    9294                                '<code>' . $this->plugin_slug . '</code>'
    9395                        );
    9496                }
     
    9799
    98100                // Is there already a plugin by a different author?
    99101                if ( $plugin_post instanceof \WP_Post && $plugin_post->post_author != get_current_user_id() ) {
     102                        $error = __( 'Error: This plugin already exists.', 'wporg-plugins' );
     103                       
    100104                        /* translators: %s: plugin slug */
    101                         return sprintf( __( 'There is already a plugin called %s by a different author. Please change the name of your plugin in the plugin header file and upload it again.', 'wporg-plugins' ),
     105                        return $error . ' ' . sprintf( __( 'There is already a plugin with the name %s in our directory. Please change the name of your plugin in the plugin headers and upload it again.', 'wporg-plugins' ),
    102106                                '<code>' . $this->plugin_slug . '</code>'
    103107                        );
    104108                }
    105109
    106110                if ( ! $this->plugin['Description'] ) {
    107                         $error = __( 'The plugin has no description.', 'wporg-plugins' );
     111                        $error = __( 'Error: The plugin has no description.', 'wporg-plugins' );
    108112
    109113                        /* translators: 1: comment header line, 2: Codex URL */
    110114                        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' ),
     
    114118                }
    115119
    116120                if ( ! $this->plugin['Version'] ) {
    117                         $error = __( 'The plugin has no version.', 'wporg-plugins' );
     121                        $error = __( 'Error: The plugin has no version.', 'wporg-plugins' );
    118122
    119123                        /* translators: 1: comment header line, 2: Codex URL */
    120124                        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' ),
     
    124128                }
    125129
    126130                if ( preg_match( '|[^\d\.]|', $this->plugin['Version'] ) ) {
     131                        $error = __( 'Error: Versions are expected to be numbers.', 'wporg-plugins' );
     132                       
    127133                        /* translators: %s: Version header */
    128                         return 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' ),
     134                        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' ),
    129135                                '<code>Version:</code>'
    130136                        );
    131137                }
     
    132138
    133139                // Prevent duplicate URLs.
    134140                if ( ! empty( $this->plugin['PluginURI'] ) && ! empty( $this->plugin['AuthorURI'] ) && $this->plugin['PluginURI'] == $this->plugin['AuthorURI'] ) {
    135                         return __( 'Duplicate plugin and author URLs. 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 aren&rsquo;t required to provide both, so pick the one that best applies to your URL.', 'wporg-plugins' );
     141                        $error = __( 'Error: Your plugin and author URIs are the same.', 'wporg-plugins' );
     142                       
     143                        return $error . ' ' . __( 'A plugin URI 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 aren&rsquo;t required to provide both, however if you do they cannot be the same. Remember, every plugin should have a unique plugin URI.', 'wporg-plugins' );
    136144                }
    137145
    138146                $readme = $this->find_readme_file();
    139147                if ( empty( $readme ) ) {
     148                        $error = __( 'Error: Missing readme.', 'wporg-plugins' );
     149                       
    140150                        /* translators: 1: readme.txt, 2: readme.md */
    141                         return sprintf( __( 'The zip file must include a file named %1$s or %2$s.', 'wporg-plugins' ),
     151                        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' ),
    142152                                '<code>readme.txt</code>',
    143153                                '<code>readme.md</code>'
    144154                        );
     
    149159                $result = $this->check_plugin();
    150160
    151161                if ( ! $result ) {
     162                        $error = __( 'Error: Failed plugin check.', 'wporg-plugins' );
     163                       
    152164                        /* translators: 1: Plugin Check Plugin URL, 2: make.wordpress.org/plugins */
    153                         return sprintf( __( 'Your plugin has failed the plugin check. 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' ),
     165                        return $error . ' ' . sprintf( __( 'Your plugin has failed the automated plugin check. 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' ),
    154166                                '//wordpress.org/plugins/plugin-check/',
    155167                                '<a href="https://make.wordpress.org/plugins">https://make.wordpress.org/plugins</a>'
    156168                        );
     
    223235
    224236                // Success!
    225237                /* translators: 1: plugin name */
    226                 return sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We&rsquo;ve sent you an email verifying that we&rsquo;ve received it.', 'wporg-plugins' ),
     238                return sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We&rsquo;ve sent you an email verifying our receipt. If you have questions or concerns, please reply to that email and we will respond as soon as possible.', 'wporg-plugins' ),
    227239                        esc_html( $this->plugin['Name'] )
    228240                );
    229241        }
     
    249261                        'developers',
    250262                        'admin',
    251263                        'wp-admin',
     264                        'wordpress',
    252265                );
    253266
    254267                return in_array( $this->plugin_slug, $reserved_slugs );
     
    333346                );
    334347
    335348                /* translators: 1: plugin name, 2: Trac ticket URL */
    336                 $email_content = sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. If your plugin is selected to be part of the directory we\'ll send a follow up email.
     349                $email_content = sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We will send you another email following a review of your submission. If you made a mistake (like uploading the wrong zip) please REPLY to this email immediately and let us know.
     350               
     351Remember to read the developer guidelines: https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/
    337352
     353Please make sure to follow our official blog: https://make.wordpress.org/plugins
     354
    338355--
    339356The WordPress Plugin Directory Team
    340357https://make.wordpress.org/plugins', 'wporg-plugins' ),