Making WordPress.org

Ticket #5083: trademark-changes.diff

File trademark-changes.diff, 6.5 KB (added by Ipstenu, 4 years ago)
  • trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

     
    114114                }
    115115
    116116                // Make sure it doesn't use a TRADEMARK protected slug.
    117                 if ( $this->has_trademarked_slug() ) {
     117                if ( false !== $this->has_trademarked_slug() ) {
    118118                        $error = __( 'Error: The plugin includes a trademarked name.', 'wporg-plugins' );
    119119
    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                                $message = sprintf(
     122                                        /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */
     123                                        __( '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 this case, we have been required to prohibit the use of the term at all. To proceed with your submission, you must 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' ),
     124                                        '<code>' . $this->plugin_slug . '</code>',
     125                                        trim( $this->has_trademarked_slug(), '-' ),
     126                                        '<code>Plugin Name:</code>',
     127                                        '<code>plugins@wordpress.org</code>'
     128                                );
     129                        } else {
     130                                $message = sprintf(
     131                                        /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */
     132                                        __( '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. 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' ),
     133                                        '<code>' . $this->plugin_slug . '</code>',
     134                                        trim( $this->has_trademarked_slug(), '-' ),
     135                                        '<code>Plugin Name:</code>',
     136                                        '<code>plugins@wordpress.org</code>'
     137                                );
     138                        }
     139
     140
     141                        return new \WP_Error( 'trademarked_name', $error . ' ' . $message );
    128142                }
    129143
    130144                $plugin_post = Plugin_Directory::get_plugin_post( $this->plugin_slug );
     
    376390        public function has_trademarked_slug() {
    377391                $trademarked_slugs = array(
    378392                        'adobe-',
     393                        'adsense-',
    379394                        'advanced-custom-fields-',
     395                        'adwords-',
    380396                        'amazon-',
     397                        'android-',
     398                        'apple-',
     399                        'bing-',
    381400                        'contact-form-7-',
    382401                        'divi-',
    383402                        'easy-digital-downloads-',
     
    389408                        'gravity-forms-',
    390409                        'gutenberg',
    391410                        'instagram',
    392                         'insta',
    393411                        'macintosh-',
    394412                        'microsoft-',
    395413                        'ninja-forms-',
     414                        'paypal-',
    396415                        'pinterest-',
     416                        'stripe-',
    397417                        'twitter-',
    398418                        'tweet',
    399419                        'whatsapp',
    400420                        'whats-app',
    401421                        'woocommerce-',
     422                        'woo-',
    402423                        'wordpress',
    403424                        'yoast',
    404425                        'youtube-',
     
    408429
    409430                foreach ( $trademarked_slugs as $trademark ) {
    410431                        if ( false !== strpos( $this->plugin_slug, $trademark ) ) {
    411                                 $has_trademarked_slug = trim( $trademark, '-' );
     432                                $has_trademarked_slug = $trademark;
    412433                                break;
    413434                        }
    414435                }
     
    457478
    458479                echo '<h4>' . sprintf( __( 'Results of Automated Plugin Scanning: %s', 'wporg-plugins' ), vsprintf( '<span class="%1$s">%2$s</span>', $verdict ) ) . '</h4>';
    459480                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 manually before approval.', 'wporg-plugins' ) . '</p></div>';
     481                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>';
    461482
    462483                return $result;
    463484        }
     
    503524                        __(
    504525'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.
    505526
    506 Your plugin has been given the initial slug of %2$s based on your display name of %1$s. This is subject to change based on the results of your review.
     527Your 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.
    507528
    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.
     529If 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.
    509530
    510531If 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.
    511532