Making WordPress.org

Changeset 5471


Ignore:
Timestamp:
05/03/2017 10:38:30 PM (7 years ago)
Author:
tellyworth
Message:

Plugin directory: clarify error messages during submission process. Props @ipstenu.

Fixes #2788

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r5416 r5471  
    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 = __( 'The plugin has a reserved name.', 'wporg-plugins' );
     91           
    9092            /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    91             return sprintf( __( 'Sorry, the plugin name %1$s is reserved for use by WordPress. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
     93            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' ),
    9294                '<code>' . $this->plugin_slug . '</code>',
    9395                '<code>Plugin Name:</code>'
     
    99101        // Is there already a plugin with the same slug by a different author?
    100102        if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) {
     103            $error = __( 'The plugin already exists.', 'wporg-plugins' );
     104           
    101105            /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    102             return 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' ),
     106            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' ),
    103107                '<code>' . $this->plugin_slug . '</code>',
    104108                '<code>Plugin Name:</code>'
     
    108112        // Is there already a plugin with the same slug by the same author?
    109113        if ( $plugin_post ) {
    110             /* translators: 1: plugin slug, 2: 'Plugin Name:' */
    111             return sprintf( __( 'There is already a plugin called %1$s. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
    112                 '<code>' . $this->plugin_slug . '</code>',
    113                 '<code>Plugin Name:</code>'
     114            $error = __( 'The plugin has already been submitted.', 'wporg-plugins' );
     115           
     116            /* translators: %s: plugin slug */
     117            return $error . ' ' . sprintf( __( 'You have already submitted a plugin called %s. Please be patient and wait for a review. If you have made a mistake, please email plugins@wordpress.org and let us know.', 'wporg-plugins' ),
     118                '<code>' . $this->plugin_slug . '</code>'
    114119            );
    115120        }
     
    136141
    137142        if ( preg_match( '|[^\d\.]|', $this->plugin['Version'] ) ) {
     143            $error = __( 'The plugin has an invalid version.', 'wporg-plugins' );
     144           
    138145            /* translators: %s: 'Version:' */
    139             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' ),
     146            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' ),
    140147                '<code>Version:</code>'
    141148            );
     
    144151        // Prevent duplicate URLs.
    145152        if ( ! empty( $this->plugin['PluginURI'] ) && ! empty( $this->plugin['AuthorURI'] ) && $this->plugin['PluginURI'] == $this->plugin['AuthorURI'] ) {
    146             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' );
     153            $error = __( 'The plugin has duplicate plugin and author URLs.', 'wporg-plugins' );
     154           
     155            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' );
    147156        }
    148157
    149158        $readme = $this->find_readme_file();
    150159        if ( empty( $readme ) ) {
     160            $error = __( 'The plugin is missing a readme.', 'wporg-plugins' );
     161           
    151162            /* translators: 1: readme.txt, 2: readme.md */
    152             return sprintf( __( 'The zip file must include a file named %1$s or %2$s.', 'wporg-plugins' ),
     163            return $error . ' ' . sprintf( __( 'The zip file must include a file named %1$s or %2$s.', 'wporg-plugins' ),
    153164                '<code>readme.txt</code>',
    154165                '<code>readme.md</code>'
     
    158169
    159170        // Pass it through Plugin Check and see how great this plugin really is.
     171        // We're not actually using this right now
    160172        $result = $this->check_plugin();
    161173
    162174        if ( ! $result ) {
     175            $error = __( 'The plugin has failed the automated checks.', 'wporg-plugins' );
     176           
    163177            /* translators: 1: Plugin Check Plugin URL, 2: make.wordpress.org/plugins */
    164             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' ),
     178            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' ),
    165179                '//wordpress.org/plugins/plugin-check/',
    166180                '<a href="https://make.wordpress.org/plugins">https://make.wordpress.org/plugins</a>'
     
    237251        // Success!
    238252        /* translators: 1: plugin name */
    239         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' ),
     253        return sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We&rsquo;ve sent you an email verifying this submission. Please make sure to whitelist our email address - plugins@wordpress.org - to ensure you receive all our communications.', 'wporg-plugins' ),
    240254            esc_html( $this->plugin['Name'] )
    241255        );
     
    347361
    348362        /* translators: 1: plugin name, 2: Trac ticket URL */
    349         $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.
     363        $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. If there is a problem with your plugin submission, such as an incorrect display name or slug, please reply to this email and let us know.
    350364
    351365--
Note: See TracChangeset for help on using the changeset viewer.