Changeset 9613
- Timestamp:
- 03/20/2020 07:15:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
r9287 r9613 115 115 116 116 // Make sure it doesn't use a TRADEMARK protected slug. 117 if ( $this->has_trademarked_slug() ) {117 if ( false !== $this->has_trademarked_slug() ) { 118 118 $error = __( 'Error: The plugin includes a trademarked name.', 'wporg-plugins' ); 119 119 120 return new \WP_Error( 'trademarked_name', $error . ' ' . sprintf( 121 /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */ 122 __( 'Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used. Per the demands of trademark owners and in order to protect developers, we disallow the use of certain terms in ways that are infringing or misleading. In many cases, renaming your plugin to end with "for-%2$s" instead will resolve this issue. To do this, please change the %3$s line in your main plugin file and readme and upload the plugin again. If you feel this is in error, please email us at %4$s and explain why.', 'wporg-plugins' ), 123 '<code>' . $this->plugin_slug . '</code>', 124 $this->has_trademarked_slug(), 125 '<code>Plugin Name:</code>', 126 '<code>plugins@wordpress.org</code>' 127 ) ); 120 if ( $this->has_trademarked_slug() === trim( $this->has_trademarked_slug(), '-' ) ) { 121 // Trademarks that do NOT end in "-" indicate slug cannot contain term at all. 122 $message = sprintf( 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' ), 125 '<code>' . $this->plugin_slug . '</code>', 126 trim( $this->has_trademarked_slug(), '-' ), 127 '<code>Plugin Name:</code>', 128 '<code>plugins@wordpress.org</code>' 129 ); 130 } else { 131 // Trademarks ending in "-" indicate slug cannot BEGIN with that term. 132 $message = sprintf( 133 /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */ 134 __( 'Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used. Per the demands of trademark owners we disallow the use of certain terms in ways that are infringing or misleading. In order to proceed with this submission, you must change the %3$s line in your main plugin file and readme to end with "-%2$s" instead. 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' ), 135 '<code>' . $this->plugin_slug . '</code>', 136 trim( $this->has_trademarked_slug(), '-' ), 137 '<code>Plugin Name:</code>', 138 '<code>plugins@wordpress.org</code>' 139 ); 140 } 141 142 return new \WP_Error( 'trademarked_name', $error . ' ' . $message ); 128 143 } 129 144 … … 377 392 $trademarked_slugs = array( 378 393 'adobe-', 394 'adsense-', 379 395 'advanced-custom-fields-', 396 'adwords-', 380 397 'amazon-', 398 'android-', 399 'apple-', 400 'bing-', 381 401 'contact-form-7-', 382 402 'divi-', 383 403 'easy-digital-downloads-', 384 404 'elementor-', 405 'envato-', 385 406 'facebook', 386 407 'feedburner', … … 390 411 'gutenberg', 391 412 'instagram', 392 'insta',393 413 'macintosh-', 394 414 'microsoft-', 395 415 'ninja-forms-', 416 'paypal-', 396 417 'pinterest-', 418 'stripe-', 397 419 'twitter-', 398 420 'tweet', … … 400 422 'whats-app', 401 423 'woocommerce-', 424 'woo-', 402 425 'wordpress', 403 426 'yoast', … … 408 431 409 432 foreach ( $trademarked_slugs as $trademark ) { 410 if ( false !== strpos( $this->plugin_slug, $trademark ) ) { 411 $has_trademarked_slug = trim( $trademark, '-' ); 433 if ( '-' === $trademark[-1] ) { 434 // Trademarks ending in "-" indicate slug cannot begin with that term. 435 if ( 0 === strpos( $this->plugin_slug, $trademark ) ) { 436 $has_trademarked_slug = $trademark; 437 break; 438 } 439 } elseif ( false !== strpos( $this->plugin_slug, $trademark ) ) { 440 // Otherwise, the term cannot appear anywhere in slug. 441 $has_trademarked_slug = $trademark; 412 442 break; 413 443 } … … 458 488 echo '<h4>' . sprintf( __( 'Results of Automated Plugin Scanning: %s', 'wporg-plugins' ), vsprintf( '<span class="%1$s">%2$s</span>', $verdict ) ) . '</h4>'; 459 489 echo '<ul class="tc-result">' . __( 'Result', 'wporg-plugins' ) . '</ul>'; 460 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 manuallybefore approval.', 'wporg-plugins' ) . '</p></div>';490 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 be approved, only that it is sufficient to be reviewed. All submitted plugins are checked manually to ensure they meet security and guideline standards before approval.', 'wporg-plugins' ) . '</p></div>'; 461 491 462 492 return $result; … … 504 534 '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. 505 535 506 Your plugin has been given the initial slugof %2$s based on your display name of %1$s. This is subject to change based on the results of your review.507 508 If you need to change the plugin slug, please reply to this email immediately and let us know what the correct slug should be. We will be unable to change your plugin slug once your review is completed.536 Your plugin has been given the initial permalink (aka slug) of %2$s based on your display name of %1$s. This is subject to change based on the results of your review. 537 538 If you need to change the plugin permalink, please reply to this email immediately and let us know what the correct slug should be. We will be unable to change your plugin slug once your review is completed. 509 539 510 540 If there are any other 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.
Note: See TracChangeset
for help on using the changeset viewer.