WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/17/2017 08:21:23 PM (3 years ago)
Author:
coffee2code
Message:

Plugin Directory, Stats Report: Display 'N/A' instead of '0' for status transition stats that aren't currently tracked.

Prevents '0' from being seen as a meaningful number when it isn't.

Props Ipstenu.
See #2744.

File:
1 edited

Legend:

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

    r5334 r5354  
    102102        }
    103103
     104        // Temporary until the above is updated to work with the new directory:
     105        foreach ( array( 'plugin_approve', 'plugin_delist', 'plugin_reject' ) as $unused_stat ) {
     106            if ( ! $stats[ $unused_stat ] ) $stats[ $unused_stat ] = __( 'N/A', 'wporg-plugins' );
     107        }
     108
    104109        // --------------
    105110        // Plugin Queue
     
    238243        <ul style="font-family:Courier New;">
    239244            <li><?php printf( __( 'Plugins requested : %d', 'wporg-plugins' ), $stats['plugin_new'] ); ?></li>
    240             <li><?php printf( __( 'Plugins rejected : %d', 'wporg-plugins' ),  $stats['plugin_reject'] ); ?></li>
    241             <li><?php printf( __( 'Plugins closed : %d', 'wporg-plugins' ),    $stats['plugin_delist'] ); ?></li>
    242             <li><?php printf( __( 'Plugins approved : %d', 'wporg-plugins' ),  $stats['plugin_approve'] ); ?></li>
     245            <li><?php printf( __( 'Plugins rejected : %s', 'wporg-plugins' ),  $stats['plugin_reject'] ); ?></li>
     246            <li><?php printf( __( 'Plugins closed : %s', 'wporg-plugins' ),    $stats['plugin_delist'] ); ?></li>
     247            <li><?php printf( __( 'Plugins approved : %s', 'wporg-plugins' ),  $stats['plugin_approve'] ); ?></li>
    243248        </ul>
    244249
Note: See TracChangeset for help on using the changeset viewer.