Making WordPress.org

Changeset 9671


Ignore:
Timestamp:
04/01/2020 05:25:12 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Add a note to the Plugin Review Tools flags when installs of a plugin exist.

This should flag something when a plugin reviewer changes the slug or title through the admin interface.

See #4656.

File:
1 edited

Legend:

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

    r9649 r9671  
    177177            }
    178178
     179            // Check Active_Installs, prior to sync?
     180            if ( function_exists( 'wporg_stats_get_plugin_name_install_count' ) ) {
     181       
     182                $title_matches = wporg_stats_get_plugin_name_install_count( $post->post_title );
     183       
     184                if ( $post->post_name == sanitize_title( $post->post_title ) ) {
     185                    $slug_matches = false;
     186                } else {
     187                    $slug = str_replace( '-', ' ', $post->post_name );
     188                    $slug_matches = wporg_stats_get_plugin_name_install_count( $slug );
     189                }
     190       
     191                if ( $title_matches ) {
     192                    array_push( self::$flagged['high'], sprintf(
     193                        'As of %s, %s had %s+ active installs.',
     194                        esc_html( $title_matches->date ),
     195                        esc_html( $post->post_title ),
     196                        number_format( $title_matches->count )
     197                    ) );
     198                }
     199                if ( $slug_matches ) {
     200                    array_push( self::$flagged['high'], sprintf(
     201                        'As of %s, %s had %s+ active installs.',
     202                        esc_html( $slug_matches->date ),
     203                        esc_html( $slug ),
     204                        number_format( $slug_matches->count )
     205                    ) );
     206                }
     207            }
     208
    179209            // User account was registered less than 2 weeks ago (but longer than 3 days) (user is still fairly new).
    180210            $two_weeks_ago  = time() - ( 2 * WEEK_IN_SECONDS );
Note: See TracChangeset for help on using the changeset viewer.