Making WordPress.org


Ignore:
Timestamp:
08/08/2019 10:04:27 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Adjust review tools and upload process to better address issues with reserved plugin names and trademark protected slugs:

  • Display known problematic IPs more prominently in Author Card.
  • Expand the list of reserved slugs and high value slugs.
  • Check for trademark protected slugs.
  • Block short plugin names (less than 5 characters).
  • Clarify that plugin name should be changed in both the main plugin file and readme.

Props Ipstenu.
Fixes #4664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php

    r9089 r9096  
    1414 */
    1515class Author_Card {
     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
    1650        /**
    1751         * Displays information about the author of the current plugin.
    … …  
    251285         */
    252286        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 ( false !== strpos( $ip, $check_ip ) ) {
     296                                $ip_data['name']   .= '*';
     297                                $ip_data['tooltip'] = 'This IP may be problematic and has been used for abuse before.';
     298                                $ip_data['iffy']    = true;
     299                        }
     300                }
     301
     302                $output_ip = sprintf(
     303                        '<a href="%1$s" title="%2$s">%3$s</a>',
    255304                        esc_url( add_query_arg( array(
    256305                                'post_type' => 'plugin',
    257306                                's'         => $ip,
    258307                        ), admin_url( 'edit.php' ) ) ),
    259                         $ip
     308                        $ip_data['tooltip'],
     309                        $ip_data['name']
    260310                );
     311
     312                return $output_ip;
    261313        }
    262314
Note: See TracChangeset for help on using the changeset viewer.