Ticket #5178: 5178.diff
File 5178.diff, 4.6 KB (added by , 5 years ago) |
---|
-
trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
121 121 // Trademarks that do NOT end in "-" indicate slug cannot contain term at all. 122 122 $message = sprintf( 123 123 /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */ 124 __( 'Your chosen plugin name - %1$s - contains the prohibited term "%2$s" and cannot be used. Per the demands of trademark owners we have been required to prevent the use of the term at all. To proceed with this submission you must remove "%2$s" from the %3$s line in both your main plugin file and readme entirely. Once you\'ve finished, you may upload the plugin again. If you feel this is in error, please email us at %4$s and explain why.', 'wporg-plugins' ),124 __( 'Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used at all in your plugin permalink. To proceed with this submission you must remove "%2$s" from the %3$s line in both your main plugin file and readme entirely. Once you\'ve finished, you may upload the plugin again. If you feel this is in error, please email us at %4$s and explain why.', 'wporg-plugins' ), 125 125 '<code>' . $this->plugin_slug . '</code>', 126 126 trim( $this->has_trademarked_slug(), '-' ), 127 127 '<code>Plugin Name:</code>', … … 208 208 209 209 return new \WP_Error( 'invalid_version', $error . ' ' . sprintf( 210 210 /* translators: %s: 'Version:' */ 211 __( 'Version strings canonly contain numeric and period characters (i.e. 1.2). Please correct the %s line in your main plugin file and upload the plugin again.', 'wporg-plugins' ),211 __( 'Version strings may only contain numeric and period characters (i.e. 1.2). Please correct the %s line in your main plugin file and upload the plugin again.', 'wporg-plugins' ), 212 212 '<code>Version:</code>' 213 213 ) ); 214 214 } … … 232 232 233 233 return new \WP_Error( 'already_exists_in_the_wild', $error . ' ' . sprintf( 234 234 /* translators: 1: plugin slug, 2: 'Plugin Name:' */ 235 __( 'There is already a plugin with the name %1$s known to WordPress.org. You must rename your plugin by changing the %2$s line in your main plugin file and in your readme. Once you have done so, you may upload it again.', 'wporg-plugins' ),235 __( 'There is already a plugin with the name %1$s known to exist. This generally means the permalink %2$s is already in use outside of WordPress.org and has a significant user base. You must rename your plugin by changing the %3$s line in your main plugin file and in your readme. Once you have done so, you may upload it again. If you feel this is incorrect, email <a href="mailto:%4$s">%4$s</a> and explain why so that we may help you.', 'wporg-plugins' ), 236 236 '<code>' . $this->plugin['Name'] . '</code>', 237 '<code>Plugin Name:</code>' 237 '<code>' . $this->plugin_slug . '</code>', 238 '<code>Plugin Name:</code>', 239 'plugins@wordpress.org' 238 240 ) ); 239 241 } 240 242 } … … 431 433 'elementor-', 432 434 'envato-', 433 435 'facebook', 436 'fb-', 434 437 'feedburner', 435 438 'github-', 436 439 'google-', 437 440 'gravity-forms-', 438 441 'gutenberg', 442 'ig-', 439 443 'instagram', 444 'jetpack-', 440 445 'macintosh-', 441 446 'microsoft-', 442 447 'ninja-forms-', … … 445 450 'stripe-', 446 451 'twitter-', 447 452 'tweet', 453 'wa-', 448 454 'whatsapp', 449 455 'whats-app', 450 'woocommerce -',456 'woocommerce', 451 457 'woo-', 452 458 'wordpress', 453 459 'yoast', … … 454 460 'youtube-', 455 461 ); 456 462 463 // Domains from which exceptions would be accepted. 464 $trademark_exceptions = array( 465 'yoast.com' => array( 'yoast' ), 466 'automattic.com' => array( 'wordpress', 'woo', 'woocommerce' ), 467 ); 468 457 469 $has_trademarked_slug = false; 458 470 459 471 foreach ( $trademarked_slugs as $trademark ) { … … 470 482 } 471 483 } 472 484 485 // Get the user email domain. 486 $user_email_domain = explode( '@', wp_get_current_user()->user_email ); 487 488 // If email domain is on our list of possible exceptions, we have an extra check. 489 if ( array_key_exists( $user_email_domain[1], $trademark_exceptions ) ) { 490 // If $has_trademarked_slug is in the array for that domain, they can use the term. 491 if ( in_array( $has_trademarked_slug, $trademark_exceptions[ $user_email_domain[1] ] ) ) { 492 $has_trademarked_slug = false; 493 } 494 } 495 473 496 return $has_trademarked_slug; 474 497 } 475 498