Changeset 13009
- Timestamp:
- 12/05/2023 02:18:57 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php
r13000 r13009 267 267 CASE 268 268 WHEN `comment_content` LIKE concat( 'Assigned to%', comment_author, '%' ) THEN 'Assigned to self.' 269 WHEN `comment_content` LIKE 'Assigned to%' THEN 'Assigned to other .'269 WHEN `comment_content` LIKE 'Assigned to%' THEN 'Assigned to others.' 270 270 ELSE `comment_content` 271 271 END AS `_thing`, … … 277 277 AND `comment_agent` = '' 278 278 AND ( 279 `comment_content` IN( 'Plugin Approved.', 'Plugin Rejected.' )279 `comment_content` IN( 'Plugin Approved.', 'Plugin Rejected.', 'Unassigned.' ) 280 280 OR `comment_content` LIKE 'Assigned TO%' 281 281 OR ( … … 622 622 623 623 <h3>Reviewer Stats</h3> 624 <p><em>NOTE: These are not intended on being made public. Data displayed for the <?php echo esc_html( $user_stats['num_days'] ); ?> ending <?php echo esc_html( $user_stats['date'] ); ?></em></p> 625 626 <?php 627 $data_points = [ 628 'Assigned to self.', 629 'Assigned to other.', 630 'Plugin approved.', 631 'Plugin rejected.', 632 'Plugin closed', 633 'Emails^', 634 ]; 635 $close_types = []; 636 637 // Determine the close reasons in this timeframe. 638 foreach ( $user_stats['data'] as $user => $user_stat ) { 639 foreach ( preg_grep( '/^Plugin closed\./', array_keys( $user_stat ) ) as $reason ) { 640 $close_types[ trim( explode( ':', $reason )[1] ) ] = true; 641 } 642 } 643 $close_types = array_keys( $close_types ); 644 645 ?> 646 <table class="widefat"> 624 <p><em>NOTE: These are not intended on being made public. Data displayed for the <?php echo esc_html( $user_stats['num_days'] ); ?> days ending <?php echo esc_html( $user_stats['date'] ); ?></em></p> 625 626 <table class="widefat review-stats"> 647 627 <thead> 648 628 <tr> 649 <th rowspan="2">Reviewer</th> 650 <th rowspan="2" style="text-align:center">Assigned<br/>(to others)</th> 651 <th colspan="2" style="text-align:center">Plugins</th> 652 <th colspan="<?php echo esc_attr( count( $close_types ) ); ?>" style="text-align:center">Plugins closed</th> 653 <th colspan="2" style="text-align:center">Emails^</th> 629 <th>Reviewer</th> 630 <th>Assigned<br>(to others)</th> 631 <th>Plugins<br>Approved</th> 632 <th>Plugins<br>Rejected</th> 633 <th>Plugins<br>Closed</th> 634 <th>Email<br>Actions^</th> 635 <th>Email<br>Replies^</th> 654 636 </tr> 655 <tr>656 <th>Approved</th>657 <th>Rejected</th>658 <?php foreach ( $close_types as $type ) : ?>659 <th><?php echo esc_html( Template::get_close_reasons()[ $type ] ); ?></th>660 <?php endforeach; ?>661 <th>Actions</th>662 <th>Replies</th>663 </tr>664 665 637 </thead> 666 638 <?php … … 671 643 echo '<tr><th>', esc_html( $user->display_name ?: $user->user_login ), '</th>'; 672 644 673 // Assigned. 674 echo '<td>', number_format_i18n( $user_stat[ 'Assigned to self.' ] ?? 0 ); 645 // Assigned, Unassigned, Assigned to others. 646 echo '<td><span title="Assigned to self">', number_format_i18n( $user_stat[ 'Assigned to self.' ] ?? 0 ), '</span>'; 647 if ( $user_stat[ 'Unassigned.' ] ?? 0 ) { 648 echo '<span title="Unassigned"> -', number_format_i18n( $user_stat[ 'Unassigned.' ] ), '</span>'; 649 } 675 650 if ( $user_stat[ 'Assigned to others.' ] ?? 0 ) { 676 echo ' (', number_format_i18n( $user_stat[ 'Assigned to others.' ] ), ')';651 echo ' <span title="Assigned to others">(', number_format_i18n( $user_stat[ 'Assigned to others.' ] ), ')</span>'; 677 652 } 678 653 echo '</td>'; … … 683 658 684 659 // Plugins Closed. 685 foreach ( $close_types as $close_type ) { 686 echo '<td>', number_format_i18n( $user_stat[ "Plugin closed. Reason: {$close_type}" ] ?? 0 ), '</td>'; 660 $user_closed_breakdown = ''; 661 $user_closed_count = 0; 662 foreach ( $user_stat as $key => $count ) { 663 if ( ! preg_match( '/^Plugin closed\./', $key ) ) { 664 continue; 665 } 666 $reason = trim( explode( ':', $key )[1] ); 667 $user_closed_count += $count; 668 669 $user_closed_breakdown .= sprintf( 670 "%s: %s\n", 671 Template::get_close_reasons()[ $reason ], 672 number_format_i18n( $count ) 673 ); 687 674 } 675 $user_closed_breakdown = trim( $user_closed_breakdown ); 676 677 echo '<td class="breakdown">', '<span title="', esc_attr( $user_closed_breakdown ), '">', number_format_i18n( $user_closed_count ), '</span>'; 678 if ( $user_closed_breakdown ) { 679 echo '<div class="hidden">', nl2br( $user_closed_breakdown ), '</div>'; 680 } 681 echo '</td>'; 688 682 689 683 // Emails. … … 695 689 echo '</table>'; 696 690 691 echo '<script> jQuery(document).ready( function($) { 692 $("table.review-stats").on( "click", ".breakdown", function() { 693 $(this).children().length > 1 && $(this).children().toggleClass("hidden"); 694 } ); 695 } );</script>' 696 697 697 ?> 698 698 <ul style="font-style:italic;"> 699 699 <li><code>^</code> : This is currently of all Helpscout mailboxes, not Plugins specific. Requires your Helpscout email to be the same as your WordPress.org email, or as one of your profiles alternate emails.</li> 700 <li> Email "Actions" include sending emails, replying to emails, marking as spam, moving to different inbox, etc.</li>700 <li><code>^</code> : Email "Actions" include sending emails, replying to emails, marking as spam, moving to different inbox, etc.</li> 701 701 </ul> 702 702
Note: See TracChangeset
for help on using the changeset viewer.