Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (7 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

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

    r5919 r6287  
    4242     * Returns the stats.
    4343     *
    44      * @param array  $args {
    45      *     Optional. Array of override arguments
     44     * @param array $args {
     45     *    Optional. Array of override arguments
    4646     *
    4747     *     @type string $date       The date (in Y-m-d format) for the end of the stats time interval (non-inclusive). Default today.
     
    8888        // Plugin Status Changes
    8989        // --------------
    90 
    9190        $states = array( 'plugin_approve', 'plugin_delist', 'plugin_new', 'plugin_reject' );
    9291        foreach ( $states as $state ) {
    9392            // The stats table used by bbPress1 (and could still be used, but isn't yet).
    9493            // Won't provide meaningful results for time intervals that include days after the switch to WP.
    95             $stats[ $state ] = $wpdb->get_var( $wpdb->prepare (
     94            $stats[ $state ] = $wpdb->get_var( $wpdb->prepare(
    9695                "SELECT SUM(views) FROM stats_extras WHERE name = 'plugin' AND date < %s AND date > DATE_SUB( %s, INTERVAL %d DAY ) AND value = %s",
    9796                $args['date'],
     
    104103        // Temporary until the above is updated to work with the new directory:
    105104        foreach ( array( 'plugin_approve', 'plugin_delist', 'plugin_reject' ) as $unused_stat ) {
    106             if ( ! $stats[ $unused_stat ] ) $stats[ $unused_stat ] = __( 'N/A', 'wporg-plugins' );
     105            if ( ! $stats[ $unused_stat ] ) {
     106                $stats[ $unused_stat ] = __( 'N/A', 'wporg-plugins' );
     107            }
    107108        }
    108109
     
    110111        // Plugin Queue
    111112        // --------------
    112 
    113113        // # of plugins currently in the queue that are new (have not been processed/replied to yet)
    114114        $stats['in_queue_new'] = $wpdb->get_var(
     
    142142        // SupportPress Queue
    143143        // --------------
    144 
    145144        // # of currently open threads
    146145        $stats['supportpress_queue_total_open'] = $wpdb->get_var(
     
    194193        }
    195194
    196         $args['num_days'] = empty( $_POST['days'] ) ? '' : absint( $_POST['days'] );
     195        $args['num_days']   = empty( $_POST['days'] ) ? '' : absint( $_POST['days'] );
    197196        $args['recentdays'] = empty( $_POST['recentdays'] ) ? '' : absint( $_POST['recentdays'] );
    198197
     
    212211        <tr><th scope="row"><label for="date"><?php _e( 'Date', 'wporg-plugins' ); ?></label></th><td>
    213212        <input name="date" type="text" id="date" value="<?php echo esc_attr( $args['date'] ); ?>" class="text">
    214         <p><?php
     213        <p>
     214        <?php
    215215            /* translators: %s: today's date */
    216             printf( __( 'The day up to which stats are to be gathered. In YYYY-MM-DD format. Defaults to today (%s).', 'wporg-plugins' ),
     216            printf(
     217                __( 'The day up to which stats are to be gathered. In YYYY-MM-DD format. Defaults to today (%s).', 'wporg-plugins' ),
    217218                $date
    218219            );
    219         ?></p>
     220        ?>
     221        </p>
    220222        </td></tr>
    221223
    222224        <tr><th scope="row"><label for="days"><?php _e( 'Number of days', 'wporg-plugins' ); ?></label></th><td>
    223225        <input name="days" type="text" id="days" value="<?php echo esc_attr( $args['num_days'] ); ?>" class="small-text">
    224         <p><?php
     226        <p>
     227        <?php
    225228            /* translators: %d: 7 */
    226             printf( __( 'The number of days before "Date" to include in stats. Default is %d.', 'wporg-plugins' ),
     229            printf(
     230                __( 'The number of days before "Date" to include in stats. Default is %d.', 'wporg-plugins' ),
    227231                7
    228232            );
    229         ?></p>
     233        ?>
     234        </p>
    230235        </td></tr>
    231236
    232237        <tr><th scope="row"><label for="recentdays"><?php _e( '"Recent" number of days', 'wporg-plugins' ); ?></label></th><td>
    233238        <input name="recentdays" type="text" id="recentdays" value="<?php echo esc_attr( $args['recentdays'] ); ?>" class="small-text">
    234         <p><?php
     239        <p>
     240        <?php
    235241            /* translators: %d: 7 */
    236             printf( __( 'The number of days before today to consider as being "recent" (stats marked with **). Default is %d.', 'wporg-plugins' ),
     242            printf(
     243                __( 'The number of days before today to consider as being "recent" (stats marked with **). Default is %d.', 'wporg-plugins' ),
    237244                7
    238245            );
    239         ?></p>
     246        ?>
     247        </p>
    240248        </td></tr>
    241249
     
    246254        <h2><?php _e( 'Stats', 'wporg-plugins' ); ?></h2>
    247255
    248         <p><?php
     256        <p>
     257        <?php
    249258            /* translators: 1: number of days, 2: selected date, 3: number of most recent days */
    250             printf( __( 'Displaying stats for the %1$d days preceding %2$s (and other stats for the %3$d most recent days).', 'wporg-plugins' ),
     259            printf(
     260                __( 'Displaying stats for the %1$d days preceding %2$s (and other stats for the %3$d most recent days).', 'wporg-plugins' ),
    251261                $stats['num_days'],
    252262                $stats['date'],
    253263                $stats['recentdays']
    254264            );
    255         ?></p>
     265        ?>
     266        </p>
    256267
    257268        <h3><?php _e( 'Plugin Status Change Stats', 'wporg-plugins' ); ?></h3>
    258269
    259270        <ul style="font-family:Courier New;">
    260             <li><?php
     271            <li>
     272            <?php
    261273                /* translators: %d: number of requested plugins */
    262                 printf( __( 'Plugins requested : %d', 'wporg-plugins' ),
     274                printf(
     275                    __( 'Plugins requested : %d', 'wporg-plugins' ),
    263276                    $stats['plugin_new']
    264277                );
    265             ?></li>
    266             <li><?php
     278            ?>
     279            </li>
     280            <li>
     281            <?php
    267282                /* translators: %s: number of rejected plugins */
    268                 printf( __( 'Plugins rejected : %s', 'wporg-plugins' ),
     283                printf(
     284                    __( 'Plugins rejected : %s', 'wporg-plugins' ),
    269285                    $stats['plugin_reject']
    270286                );
    271             ?></li>
    272             <li><?php
     287            ?>
     288            </li>
     289            <li>
     290            <?php
    273291                /* translators: %s: number of closed plugins */
    274                 printf( __( 'Plugins closed : %s', 'wporg-plugins' ),
     292                printf(
     293                    __( 'Plugins closed : %s', 'wporg-plugins' ),
    275294                    $stats['plugin_delist']
    276295                );
    277             ?></li>
    278             <li><?php
     296            ?>
     297            </li>
     298            <li>
     299            <?php
    279300                /* translators: %s: number of approved plugins */
    280                 printf( __( 'Plugins approved : %s', 'wporg-plugins' ),
     301                printf(
     302                    __( 'Plugins approved : %s', 'wporg-plugins' ),
    281303                    $stats['plugin_approve']
    282304                );
    283             ?></li>
     305            ?>
     306            </li>
    284307        </ul>
    285308
     
    287310
    288311        <ul style="font-family:Courier New;">
    289             <li><?php
     312            <li>
     313            <?php
    290314                /* translators: %d: number of plugins in the queue */
    291                 printf( __( 'Plugins in the queue (new and pending)* : %d', 'wporg-plugins' ),
     315                printf(
     316                    __( 'Plugins in the queue (new and pending)* : %d', 'wporg-plugins' ),
    292317                    $stats['in_queue']
    293318                );
    294             ?></li>
    295             <li><?php
     319            ?>
     320            </li>
     321            <li>
     322            <?php
    296323                /* translators: 1: number of most recent days, 2: number of older plugins in the queue */
    297                 printf( __( '&rarr; (older than %1$d days ago)** : %2$d', 'wporg-plugins' ),
     324                printf(
     325                    __( '&rarr; (older than %1$d days ago)** : %2$d', 'wporg-plugins' ),
    298326                    $stats['recentdays'],
    299327                    $stats['in_queue_old']
    300328                );
    301             ?></li>
    302             <li><?php
     329            ?>
     330            </li>
     331            <li>
     332            <?php
    303333                /* translators: 1: start date, 2: end date, 3: number of plugins in the queue within defined time window */
    304                 printf( __( '&rarr; (%1$s - %2$s) : %3$d', 'wporg-plugins' ),
     334                printf(
     335                    __( '&rarr; (%1$s - %2$s) : %3$d', 'wporg-plugins' ),
    305336                    $start_date,
    306337                    $stats['date'],
    307338                    $stats['in_queue_from_time_window']
    308339                );
    309             ?></li>
    310             <li><?php
     340            ?>
     341            </li>
     342            <li>
     343            <?php
    311344                /* translators: %d: number of new plugins */
    312                 printf( __( '&rarr; (new; not processed or replied to yet)* : %d', 'wporg-plugins' ),
     345                printf(
     346                    __( '&rarr; (new; not processed or replied to yet)* : %d', 'wporg-plugins' ),
    313347                    $stats['in_queue_new']
    314348                );
    315             ?></li>
    316             <li><?php
     349            ?>
     350            </li>
     351            <li>
     352            <?php
    317353                /* translators: %d: number of pending plugins */
    318                 printf( __( '&rarr; (pending; replied to)* : %d', 'wporg-plugins' ),
     354                printf(
     355                    __( '&rarr; (pending; replied to)* : %d', 'wporg-plugins' ),
    319356                    $stats['in_queue_pending']
    320357                );
    321             ?></li>
     358            ?>
     359            </li>
    322360        </ul>
    323361
     
    325363
    326364        <ul style="font-family:Courier New;">
    327             <li><?php
     365            <li>
     366            <?php
    328367                /* translators: %d: number of open tickets */
    329                 printf( __( 'Total open tickets* : %d', 'wporg-plugins' ),
     368                printf(
     369                    __( 'Total open tickets* : %d', 'wporg-plugins' ),
    330370                    $stats['supportpress_queue_total_open']
    331371                );
    332             ?></li>
    333             <li><?php
     372            ?>
     373            </li>
     374            <li>
     375            <?php
    334376                /* translators: 1: number of most recent days, 2: number of plugins with no activity */
    335                 printf( __( ' &rarr; (with no activity in last %1$d days)** : %2$d', 'wporg-plugins' ),
     377                printf(
     378                    __( ' &rarr; (with no activity in last %1$d days)** : %2$d', 'wporg-plugins' ),
    336379                    $stats['recentdays'],
    337380                    $stats['supportpress_queue_total_open_old']
    338381                );
    339             ?></li>
    340             <li><?php
     382            ?>
     383            </li>
     384            <li>
     385            <?php
    341386                /* translators: %d: number of most recent days */
    342                 printf( __( 'Within defined %d day time window:', 'wporg-plugins' ),
     387                printf(
     388                    __( 'Within defined %d day time window:', 'wporg-plugins' ),
    343389                    $stats['num_days']
    344390                );
    345                 ?><ul style="margin-left:20px;margin-top:0.5em;">
    346                     <li><?php
     391                ?>
     392                <ul style="margin-left:20px;margin-top:0.5em;">
     393                    <li>
     394                    <?php
    347395                        /* translators: %d: total number of plugins within defined time window */
    348                         printf( __( 'Total : %d', 'wporg-plugins' ),
     396                        printf(
     397                            __( 'Total : %d', 'wporg-plugins' ),
    349398                            $stats['supportpress_queue_interval_all']
    350399                        );
    351                     ?></li>
    352                     <li><?php
     400                    ?>
     401                    </li>
     402                    <li>
     403                    <?php
    353404                        /* translators: %d: number of closed plugins within defined time window */
    354                         printf( __( 'Closed : %d', 'wporg-plugins' ),
     405                        printf(
     406                            __( 'Closed : %d', 'wporg-plugins' ),
    355407                            $stats['supportpress_queue_interval_closed']
    356408                        );
    357                     ?></li>
    358                     <li><?php
     409                    ?>
     410                    </li>
     411                    <li>
     412                    <?php
    359413                        /* translators: %d: number of open plugins within defined time window */
    360                         printf( __( 'Open : %d', 'wporg-plugins' ),
     414                        printf(
     415                            __( 'Open : %d', 'wporg-plugins' ),
    361416                            $stats['supportpress_queue_interval_open']
    362417                        );
    363                     ?></li>
     418                    ?>
     419                    </li>
    364420                </ul>
    365421            </li>
Note: See TracChangeset for help on using the changeset viewer.