Making WordPress.org

Ticket #5969: 5969-2.patch

File 5969-2.patch, 7.1 KB (added by Ipstenu, 3 years ago)

strpos

  • trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

     
    115115
    116116                // Make sure it doesn't use a TRADEMARK protected slug.
    117117                if ( false !== $this->has_trademarked_slug() ) {
    118                         $error = __( 'Error: The plugin includes a trademarked name.', 'wporg-plugins' );
     118                        $error = __( 'Error: The plugin name includes a restricted term.', 'wporg-plugins' );
    119119
    120120                        if ( $this->has_trademarked_slug() === trim( $this->has_trademarked_slug(), '-' ) ) {
    121121                                // Trademarks that do NOT end in "-" indicate slug cannot contain term at all.
    122122                                $message = sprintf(
    123123                                        /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */
    124                                         __( 'Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used at all in your plugin permalink nor the display name. 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. Do not attempt to work around this by removing letters (i.e. WordPess) or using numbers (4 instead of A). Those are seen as intentional actions to avoid trademark laws, and are not permitted. If you feel this is in error, such as you legally own the trademarked term, 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 nor the display name. 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. Do not attempt to work around this by removing letters (i.e. WordPess) or using numbers (4 instead of A). Those are seen as intentional actions to avoid our restrictions, and are not permitted. If you feel this is in error, such as you legally own the trademark for a term, please email us at %4$s and explain your situation.', 'wporg-plugins' ),
    125125                                        '<code>' . $this->plugin_slug . '</code>',
    126126                                        trim( $this->has_trademarked_slug(), '-' ),
    127127                                        '<code>Plugin Name:</code>',
     
    131131                                // Trademarks ending in "-" indicate slug cannot BEGIN with that term.
    132132                                $message = sprintf(
    133133                                        /* 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 to begin your permalink or display name. Per the requirements of trademark owners and law, we disallow the use of certain terms in ways that are infringing and/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, such as you legally own the trademarked term, please email us at %4$s and explain why.', 'wporg-plugins' ),
     134                                        __( 'Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used to begin your permalink or display name. We disallow the use of certain terms in ways that are abused, or potentially infringe on and/or are misleading with regards to trademarks. 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, such as you legally own the trademark for the term, please email us at %4$s and explain your situation.', 'wporg-plugins' ),
    135135                                        '<code>' . $this->plugin_slug . '</code>',
    136136                                        trim( $this->has_trademarked_slug(), '-' ),
    137137                                        '<code>Plugin Name:</code>',
     
    365365                        'plugins@wordpress.org'
    366366                ) . '</p><p>';
    367367
    368                 $message .= __( 'If there are any errors in your submission, please email us as soon as possible. We can correct many issues before approval.', 'wporg-plugins' ) . '</p><p>';
     368                $message .= __( 'If there are any errors in your submission, such as having submitted via the wrong account, please don\'t resubmit! Instead, email us as soon as possible (you can reply to the automated email we sent you). We can correct most issues before approval.', 'wporg-plugins' ) . '</p><p>';
    369369
    370370                $message .= sprintf(
    371371                        /* translators: 1: URL to guidelines; 2: URL to FAQs; */
     
    376376
    377377                $message .= __( 'Note: Reviews are currently in English only. We apologize for the inconvenience.', 'wporg-plugins' );
    378378
     379                $message .= '</p>';
     380
    379381                // Success!
    380382                return $message;
    381383        }
     
    444446                        'android-',
    445447                        'apple-',
    446448                        'applenews-',
     449                        'applepay-',
    447450                        'aws-',
     451                        'azon-',
    448452                        'bbpress-',
    449453                        'bing-',
     454                        'booking-com',
    450455                        'bootstrap-',
    451456                        'buddypress-',
    452457                        'contact-form-7-',
     458                        'cloudflare-',
    453459                        'cpanel-',
    454460                        'disqus-',
    455461                        'divi-',
     
    463469                        'fb-messenger',
    464470                        'fedex-',
    465471                        'feedburner',
     472                        'firefox-',
     473                        'fontawesome-',
     474                        'font-awesome-',
    466475                        'ganalytics-',
    467476                        'gberg',
    468477                        'github-',
     
    472481                        'googles-',
    473482                        'gravity-form-',
    474483                        'gravity-forms-',
     484                        'gravityforms-',
     485                        'gtmetrix-',
    475486                        'gutenberg',
    476487                        'guten-',
    477488                        'hubspot-',
     
    479490                        'insta-',
    480491                        'instagram',
    481492                        'internet-explorer-',
     493                        'ios-',
    482494                        'jetpack-',
    483495                        'macintosh-',
     496                        'macos-',
    484497                        'mailchimp-',
    485498                        'microsoft-',
    486499                        'ninja-forms-',
     
    487500                        'oculus',
    488501                        'onlyfans-',
    489502                        'only-fans-',
     503                        'opera-',
    490504                        'paddle-',
    491505                        'paypal-',
    492506                        'pinterest-',
     507                        'plugin',
     508                        'skype-',
    493509                        'stripe-',
    494510                        'tiktok-',
     511                        'tik-tok-',
    495512                        'trustpilot',
     513                        'twitch-',
    496514                        'twitter-',
    497515                        'tweet',
    498516                        'ups-',
     
    502520                        'vva-',
    503521                        'vvoo',
    504522                        'wa-',
     523                        'webpush-vn',
    505524                        'wh4tsapps',
    506525                        'whatsapp',
    507526                        'whats-app',
     
    523542                        'yahoo-',
    524543                        'yoast',
    525544                        'youtube-',
     545                        'you-tube-',
    526546                );
    527547
    528548                // Domains from which exceptions would be accepted.
     
    534554                        'trustpilot.com'        => array( 'trustpilot' ),
    535555                        'microsoft.com'         => array( 'bing-', 'microsoft-' ),
    536556                        'yandex-team.ru'        => array( 'yandex' ),
     557                        'opera.com'             => array( 'opera-' ),
    537558                );
    538559
    539560                // Trademarks that are allowed as 'for-whatever' ONLY.
     
    541562                        'woocommerce',
    542563                );
    543564
     565                // Commonly used 'combo' names (to prevent things like 'woopress').
     566                $portmanteaus = array(
     567                        'woo',
     568                );
     569
    544570                $has_trademarked_slug = false;
    545571
    546572                foreach ( $trademarked_slugs as $trademark ) {
     
    567593                        }
    568594                }
    569595
     596                // Check portmanteaus.
     597                foreach ( $portmanteaus as $portmanteau ) {
     598                        if ( 0 === strpos( $this->plugin_slug, $portmanteau ) ) {
     599                                $has_trademarked_slug = $portmanteau;
     600                                break;
     601                        }
     602                }
     603
    570604                // Get the user email domain.
    571605                list( ,$user_email_domain ) = explode( '@', wp_get_current_user()->user_email, 2 );
    572606