Ticket #4664: trademark.diff
File trademark.diff, 11.6 KB (added by , 6 years ago) |
---|
-
trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
13 13 * @package WordPressdotorg\Plugin_Directory\Admin\Metabox 14 14 */ 15 15 class Author_Card { 16 16 17 /** 18 * List of known problematic IPs 19 * 20 * @var array 21 */ 22 public static $iffy_ips = [ 23 '2.240.', 24 '2.241.', 25 '5.102.170.', 26 '5.102.171.', 27 '38.78.', 28 '47.15.', 29 '49.50.124.', 30 '65.33.104.38', 31 '71.41.77.202', 32 '76.73.108.', 33 '80.131.192.168', 34 '87.188.', 35 '91.228.', 36 '91.238.', 37 '94.103.41.', 38 '109.123.', 39 '110.55.1.251', 40 '110.55.4.248', 41 '116.193.162.', 42 '119.235.251.', 43 '159.253.145.183', 44 '173.171.9.190', 45 '173.234.140.18', 46 '188.116.36.', 47 '217.87.', 48 ]; 49 50 /** 17 51 * Displays information about the author of the current plugin. 18 52 * 19 53 * @param int|WP_Post $post_or_user_id The post or the ID of a specific user. … … 250 284 * @return string 251 285 */ 252 286 protected static function link_ip( $ip ) { 253 return sprintf( 254 '<a href="%1$s">%2$s</a>', 287 288 $ip_data = array( 289 'name' => $ip, 290 'tooltip' => '', 291 'iffy' => false, 292 ); 293 294 foreach ( self::$iffy_ips as $check_ip ) { 295 if ( strpos( $ip, $check_ip ) !== false ) { 296 $ip_data['name'] .= '*'; 297 $ip_data['tooltip'] = 'This IP may be problemtic and has been used for abuse before.'; 298 $ip_data['iffy'] = true; 299 } 300 } 301 302 $ip_name = ( true === $warning ) ? $ip . ' *' : $ip; 303 304 $output_ip = sprintf( 305 '<a href="%1$s" title="%2$s">%3$s</a>', 255 306 esc_url( add_query_arg( array( 256 307 'post_type' => 'plugin', 257 308 's' => $ip, 258 309 ), admin_url( 'edit.php' ) ) ), 259 $ip 310 $ip_data['tooltip'], 311 $ip_data['name'] 260 312 ); 313 314 return $output_ip; 261 315 } 262 316 263 317 /** -
trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php
32 32 * @var array 33 33 */ 34 34 public static $reserved_slugs = [ 35 'wordpress', 36 'woocommerce', 35 'apple', 36 'contact-form-7', 37 'facebook', 37 38 'google', 38 'youtube', 39 'instagram', 40 'ios', 41 'jetpack', 42 'jquery', 43 'microsoft', 44 'paypal', 39 45 'twitter', 40 'facebook', 46 'woocommerce', 47 'wordpress', 41 48 'yoast', 42 ' jetpack',49 'youtube', 43 50 ]; 44 51 45 52 /** … … 49 56 */ 50 57 public static $restricted_slugs = [ 51 58 // High-value plugin genres due to their popularity, often abused by spammers. 59 'booking', 60 'bookmark', 61 'cookie', 52 62 'gallery', 53 63 'lightbox', 64 'seo', 54 65 'sitemap', 55 ' bookmark',66 'slide', 56 67 'social', 57 'cookie',58 'slide',59 'seo',60 68 61 69 // Plugins we generally don't allow. 62 70 'autoblog', 63 71 'auto-blog', 64 'booking', 72 'framework', 73 'library', 65 74 'plugin', 66 75 'spinning', 67 'framework',68 76 ]; 69 77 70 78 /** … … 86 94 ]; 87 95 88 96 /** 89 * List of known problematic IPs90 *91 * @var array92 */93 public static $iffy_ips = [94 '2.240.',95 '2.241.',96 '5.102.170.',97 '5.102.171.',98 '38.78.',99 '47.15.',100 '49.50.124.',101 '65.33.104.38',102 '71.41.77.202',103 '76.73.108.',104 '80.131.192.168',105 '87.188.',106 '91.228.',107 '91.238.',108 '94.103.41.',109 '109.123.',110 '110.55.1.251',111 '110.55.4.248',112 '116.193.162.',113 '119.235.251.',114 '159.253.145.183',115 '173.171.9.190',116 '173.234.140.18',117 '188.116.36.',118 '217.87.',119 ];120 121 /**122 97 * Displays links to plugin assets and automated flags. 123 98 */ 124 99 public static function display() { -
trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
95 95 96 96 return new \WP_Error( 'unsupported_name', $error . ' ' . sprintf( 97 97 /* translators: %s: 'Plugin Name:' */ 98 __( 'Plugin names may 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' ),98 __( 'Plugin names may only contain latin letters (A-z), numbers, spaces, and hyphens. Please change the %s line in your main plugin file and readme, then you may upload it again.', 'wporg-plugins' ), 99 99 esc_html( $this->plugin['Name'] ), 100 100 '<code>Plugin Name:</code>' 101 101 ) ); … … 107 107 108 108 return new \WP_Error( 'reserved_name', $error . ' ' . sprintf( 109 109 /* translators: 1: plugin slug, 2: 'Plugin Name:' */ 110 __( 'Your chosen plugin name - %1$s - has been reserved for use by WordPress. Please change the %2$s line in your main plugin file andupload it again.', 'wporg-plugins' ),110 __( 'Your chosen plugin name - %1$s - has been reserved and cannot be used. Please change the %2$s line in your main plugin file and readme, then you may upload it again.', 'wporg-plugins' ), 111 111 '<code>' . $this->plugin_slug . '</code>', 112 112 '<code>Plugin Name:</code>' 113 113 ) ); 114 114 } 115 115 116 // Make sure it doesn't use a TRADEMARK protected slug. 117 if ( $this->has_trademarked_slug() ) { 118 $error = __( 'Error: The plugin has a trademarked name.', 'wporg-plugins' ); 119 120 return new \WP_Error( 'trademarked_name', $error . ' ' . sprintf( 121 /* translators: 1: plugin slug, 2: 'Plugin Name:', 3: plugin email address. */ 122 __( 'Your chosen plugin name - %1$s - has been flagged as trademark infringement and cannot be used. We have been legally compelled to protect specific trademarks and as such prevent the use of specific terms. Please change the %2$s line in your main plugin file and readme, then you may upload it again. If you feel this is in error, please email us at %3$s and explain why.', 'wporg-plugins' ), 123 '<code>' . $this->plugin_slug . '</code>', 124 '<code>Plugin Name:</code>', 125 '<code>plugins@wordpress.org</code>' 126 ) ); 127 } 128 116 129 $plugin_post = Plugin_Directory::get_plugin_post( $this->plugin_slug ); 117 130 118 131 // Is there already a plugin with the same slug by a different author? … … 140 153 ) ); 141 154 } 142 155 156 // Prevent short plugin names (they're generally SEO grabs). 157 if ( strlen( $this->plugin_slug ) < 5 ) { 158 $error = __( 'Error: The plugin slug is too short.', 'wporg-plugins' ); 159 160 return new \WP_Error( 'trademarked_name', $error . ' ' . sprintf( 161 /* translators: 1: plugin slug, 2: 'Plugin Name:' */ 162 __( 'Your chosen plugin name - %1$s - is not permitted becuase it is too short. Please change the %2$s line in your main plugin file and readme and upload it again.', 'wporg-plugins' ), 163 '<code>' . $this->plugin_slug . '</code>', 164 '<code>Plugin Name:</code>' 165 ) ); 166 } 167 143 168 if ( ! $this->plugin['Description'] ) { 144 169 $error = __( 'Error: The plugin has no description.', 'wporg-plugins' ); 145 170 … … 290 315 'plugins@wordpress.org' 291 316 ) . '</p><p>'; 292 317 293 // Warn if the plugin starts with a reserved slug.294 if ( $this->starts_with_reserved_slug() ) {295 $message .= sprintf(296 /* translators: %s: plugin name */297 __( 'Warning: Your plugin will probably need to be renamed. Your chosen plugin name - %s - starts with a term that may belong to another company. When we review your submission we will either correct this for you or request you approve a new name.' ),298 esc_html( $this->plugin['Name'] )299 ) . '</p><p>';300 }301 302 318 $message .= __( 'If there is any error in your submission, please email us as soon as possible. We can correct many issues before approval.', 'wporg-plugins' ) . '</p><p>'; 303 319 304 320 $message .= sprintf( … … 334 350 'admin', 335 351 'wp-admin', 336 352 'wordpress', 353 'jquery', 337 354 ); 338 355 339 356 return in_array( $this->plugin_slug, $reserved_slugs ); … … 340 357 } 341 358 342 359 /** 343 * Whether the uploaded plugin uses a slug commonly abused by non-reps.360 * Whether the uploaded plugin uses a trademark in the slug. 344 361 * 345 362 * @return bool 346 363 */ 347 public function starts_with_reserved_slug() { 348 $abused_slugs = array( 349 'apple', 364 public function has_trademarked_slug() { 365 $return = false; 366 $trademarked_slugs = array( 367 'contact-form-7', 350 368 'facebook', 351 369 'google', 352 'ios', 353 'jetpack', 370 '-gram', 371 'gram-', 372 'instagram', 373 'insta', 354 374 'microsoft', 355 375 'paypal', 356 376 'twitter', 377 'tweet', 378 'whatsapp', 379 'whats-app', 357 380 'woocommerce', 358 381 'wordpress', 359 382 'yoast', 360 383 ); 361 384 362 // Get the slug in an array. 363 $slug = explode( '-', $this->plugin_slug ); 385 foreach ( $trademarked_slugs as $trademark ) { 386 if ( strpos( $this->plugin_slug, $trademark ) ) { 387 $return = true; 388 } 389 } 364 390 365 // If the slug is the same as the first term, flag for abuse. 366 return in_array( $slug[0], $abused_slugs ); 391 return $return; 367 392 } 368 393 369 394 /** … … 406 431 } 407 432 408 433 echo '<h4>' . sprintf( __( 'Results of Automated Plugin Scanning: %s', 'wporg-plugins' ), vsprintf( '<span class="%1$s">%2$s</span>', $verdict ) ) . '</h4>'; 409 echo '<ul class="tc-result">' . 'Result'. '</ul>';434 echo '<ul class="tc-result">' . __( 'Result', 'wporg-plugins' ) . '</ul>'; 410 435 echo '<div class="notice notice-info"><p>' . __( 'Note: While the automated plugin scan is based on the Plugin Review Guidelines, it is not a complete review. A successful result from the scan does not guarantee that the plugin will pass review. All submitted plugins are reviewed manually before approval.', 'wporg-plugins' ) . '</p></div>'; 411 436 412 437 return $result; … … 445 470 $this->plugin['Name'] 446 471 ); 447 472 448 /* translators: 1: plugin name, 2: plugin slug */ 473 /* 474 Please leave the blank lines in place. 475 */ 449 476 $email_content = sprintf( 477 // translators: 1: plugin name, 2: plugin slug. 450 478 __( 451 479 'Thank you for uploading %1$s to the WordPress Plugin Directory. We will review your submission as soon as possible and send you a follow up email with the results. 452 480 453 Your plugin has been given the initial slug of %2$s , however this is subject to change based on the results of your review.481 Your plugin has been given the initial slug of %2$s based on your diplay name of %1$s. This is subject to change based on the results of your review. 454 482 455 If there is any problem with this submission, please replyto this email and let us know right away. In most cases, we can correct errors as long as the plugin has not yet been approved. For situations like an incorrect plugin slug, we are unable to change that post approval. If you do not inform us of any requirements now, we will be unable to honor them later.483 If there are any problems with your submission, please REPLY to this email and let us know right away. In most cases, we can correct errors as long as the plugin has not yet been approved. For situations like an incorrect plugin slug, we are unable to change that post approval. If you do not inform us of any requirements now, we will be unable to honor them later. 456 484 457 485 We recommend you review the following links to understand the review process and our expectations: 458 486 … … 474 502 wp_mail( $user_email, $email_subject, $email_content, 'From: plugins@wordpress.org' ); 475 503 } 476 504 477 // Helper 505 // Helper. 478 506 /** 479 507 * Whitelist zip files to be allowed to be uploaded to the media library. 480 508 *