Ticket #2700: 2700.2.diff
File 2700.2.diff, 7.9 KB (added by , 8 years ago) |
---|
-
sites/trunk/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: plugin 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' ), … … 88 88 $this->plugin_slug = sanitize_title_with_dashes( $this->plugin_slug ); 89 89 90 90 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' ); 92 92 93 93 /* translators: %s: 'Plugin Name:' */ 94 94 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' ), … … 99 99 100 100 // Make sure it doesn't use a slug deemed not to be used by the public. 101 101 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' ); 103 103 104 104 /* translators: 1: plugin slug, 2: 'Plugin Name:' */ 105 105 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' ), … … 112 112 113 113 // Is there already a plugin with the same slug by a different author? 114 114 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' ); 116 116 117 117 /* translators: 1: plugin slug, 2: 'Plugin Name:' */ 118 118 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' ), … … 123 123 124 124 // Is there already a plugin with the same slug by the same author? 125 125 if ( $plugin_post ) { 126 $error = __( ' The plugin has already been submitted.', 'wporg-plugins' );126 $error = __( 'Error: The plugin has already been submitted.', 'wporg-plugins' ); 127 127 128 128 /* translators: 1: plugin slug, 2: plugins@wordpress.org */ 129 129 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' ), … … 133 133 } 134 134 135 135 if ( ! $this->plugin['Description'] ) { 136 $error = __( ' The plugin has no description.', 'wporg-plugins' );136 $error = __( 'Error: The plugin has no description.', 'wporg-plugins' ); 137 137 138 138 /* translators: 1: plugin header line, 2: Codex URL */ 139 139 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' ), … … 143 143 } 144 144 145 145 if ( ! $this->plugin['Version'] ) { 146 $error = __( ' The plugin has no version.', 'wporg-plugins' );146 $error = __( 'Error: The plugin has no version.', 'wporg-plugins' ); 147 147 148 148 /* translators: 1: plugin header line, 2: Codex URL */ 149 149 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' ), … … 153 153 } 154 154 155 155 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' ); 157 157 158 158 /* 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' ), 160 160 '<code>Version:</code>' 161 161 ); 162 162 } … … 163 163 164 164 // Prevent duplicate URLs. 165 165 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' ); 167 167 168 168 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' ); 169 169 } … … 170 170 171 171 $readme = $this->find_readme_file(); 172 172 if ( empty( $readme ) ) { 173 $error = __( ' The plugin is missing areadme.', 'wporg-plugins' );173 $error = __( 'Error: The plugin has no readme.', 'wporg-plugins' ); 174 174 175 175 /* 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' ), 177 177 '<code>readme.txt</code>', 178 178 '<code>readme.md</code>' 179 179 ); … … 185 185 $result = $this->check_plugin(); 186 186 187 187 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' ); 189 189 190 190 /* translators: 1: Plugin Check Plugin URL, 2: make.wordpress.org/plugins */ 191 return $error . ' ' . sprintf( __( 'Please correct the problems with itand 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' ), 192 192 '//wordpress.org/plugins/plugin-check/', 193 193 '<a href="https://make.wordpress.org/plugins">https://make.wordpress.org/plugins</a>' 194 194 ); … … 299 299 'developers', 300 300 'admin', 301 301 'wp-admin', 302 'wordpress', 302 303 ); 303 304 304 305 return in_array( $this->plugin_slug, $reserved_slugs ); … … 389 390 390 391 If 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. 391 392 393 Remember to read the developer guidelines: https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/ 394 395 Please make sure to follow our official blog: https://make.wordpress.org/plugins/ 396 392 397 -- 393 398 The WordPress Plugin Directory Team 394 399 https://make.wordpress.org/plugins', 'wporg-plugins' ),