Ticket #2700: 2700.diff
File 2700.diff, 7.8 KB (added by , 8 years ago) |
---|
-
wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
73 73 // Let's check some plugin headers, shall we? 74 74 // Catches both empty Plugin Name & when no valid files could be found. 75 75 if ( empty( $this->plugin['Name'] ) ) { 76 $error = __( ' The plugin has no name.', 'wporg-plugins' );76 $error = __( 'Error: The plugin has no name.', 'wporg-plugins' ); 77 77 78 78 /* translators: 1: comment header line, 2: Codex URL */ 79 79 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' ), … … 87 87 88 88 // Make sure it doesn't use a slug deemed not to be used by the public. 89 89 if ( $this->has_reserved_slug() ) { 90 $error = __( 'Error: Use of a restricted plugin name.', 'wporg-plugins' ); 91 90 92 /* 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' ), 92 94 '<code>' . $this->plugin_slug . '</code>' 93 95 ); 94 96 } … … 97 99 98 100 // Is there already a plugin by a different author? 99 101 if ( $plugin_post instanceof \WP_Post && $plugin_post->post_author != get_current_user_id() ) { 102 $error = __( 'Error: This plugin already exists.', 'wporg-plugins' ); 103 100 104 /* 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 fileand 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' ), 102 106 '<code>' . $this->plugin_slug . '</code>' 103 107 ); 104 108 } 105 109 106 110 if ( ! $this->plugin['Description'] ) { 107 $error = __( ' The plugin has no description.', 'wporg-plugins' );111 $error = __( 'Error: The plugin has no description.', 'wporg-plugins' ); 108 112 109 113 /* translators: 1: comment header line, 2: Codex URL */ 110 114 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' ), … … 114 118 } 115 119 116 120 if ( ! $this->plugin['Version'] ) { 117 $error = __( ' The plugin has no version.', 'wporg-plugins' );121 $error = __( 'Error: The plugin has no version.', 'wporg-plugins' ); 118 122 119 123 /* translators: 1: comment header line, 2: Codex URL */ 120 124 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' ), … … 124 128 } 125 129 126 130 if ( preg_match( '|[^\d\.]|', $this->plugin['Version'] ) ) { 131 $error = __( 'Error: Versions are expected to be numbers.', 'wporg-plugins' ); 132 127 133 /* 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' ), 129 135 '<code>Version:</code>' 130 136 ); 131 137 } … … 132 138 133 139 // Prevent duplicate URLs. 134 140 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’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’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' ); 136 144 } 137 145 138 146 $readme = $this->find_readme_file(); 139 147 if ( empty( $readme ) ) { 148 $error = __( 'Error: Missing readme.', 'wporg-plugins' ); 149 140 150 /* 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' ), 142 152 '<code>readme.txt</code>', 143 153 '<code>readme.md</code>' 144 154 ); … … 149 159 $result = $this->check_plugin(); 150 160 151 161 if ( ! $result ) { 162 $error = __( 'Error: Failed plugin check.', 'wporg-plugins' ); 163 152 164 /* translators: 1: Plugin Check Plugin URL, 2: make.wordpress.org/plugins */ 153 return sprintf( __( 'Your plugin has failed theplugin 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' ), 154 166 '//wordpress.org/plugins/plugin-check/', 155 167 '<a href="https://make.wordpress.org/plugins">https://make.wordpress.org/plugins</a>' 156 168 ); … … 223 235 224 236 // Success! 225 237 /* translators: 1: plugin name */ 226 return sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We’ve sent you an email verifying that we’ve received it.', 'wporg-plugins' ),238 return sprintf( __( 'Thank you for uploading %1$s to the WordPress Plugin Directory. We’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' ), 227 239 esc_html( $this->plugin['Name'] ) 228 240 ); 229 241 } … … 249 261 'developers', 250 262 'admin', 251 263 'wp-admin', 264 'wordpress', 252 265 ); 253 266 254 267 return in_array( $this->plugin_slug, $reserved_slugs ); … … 333 346 ); 334 347 335 348 /* 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 351 Remember to read the developer guidelines: https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ 337 352 353 Please make sure to follow our official blog: https://make.wordpress.org/plugins 354 338 355 -- 339 356 The WordPress Plugin Directory Team 340 357 https://make.wordpress.org/plugins', 'wporg-plugins' ),