Changeset 12992
- Timestamp:
- 12/01/2023 05:05:31 AM (2 years 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
r12523 r12992 70 70 * Array of stats. 71 71 * 72 * @type int $plugin_approve The number of plugins approved within the defined time interval. 73 * @type int $plugin_delist The number of plugins delisted within the defined time interval. 74 * @type int $plugin_new The number of plugins submitted within the defined time interval. 75 * @type int $plugin_reject The number of plugins rejected within the defined time interval. 76 * @type int $in_queue The number of plugins currently in the queue (new or pending). 77 * @type int $in_queue_new The number of new plugins currently in the queue. 78 * @type int $in_queue_pending The number of pending plugins currently in the queue. 79 * @type int $in_queue_from_time_window The number of plugins currently in the queue submitted during the specified time window. 80 * @type int $in_queue_old The number of plugins currently in the queue that are older than "recently". 81 * @type int $helpscout_queue_total_conversations The number of ongoing Help Scout conversations. 82 * @type int $helpscout_queue_new_conversations The number of new Help Scout conversations. 83 * @type int $helpscout_queue_customers The number of unique Plugin authors contacted. 84 * @type int $helpscout_queue_conversations_per_day The number of Help Scout conversations per day. 85 * @type int $helpscout_queue_busiest_day The busiest day in the Help Scout queue. 86 * @type int $helpscout_queue_messages_received The number of emails received in HelpScout. 87 * @type int $helpscout_queue_replies_sent The number of replies sent to emails. 88 * @type int $helpscout_queue_emails_created The number of new outgoing conversations created. 72 * @type int $plugin_approve The number of plugins approved within the defined time interval. 73 * @type int $plugin_delist The number of plugins delisted within the defined time interval. 74 * @type array $plugin_delist_reasons The number of plugins delisted within the defined time interval, broken down by reason. 75 * @type int $plugin_new The number of plugins submitted within the defined time interval. 76 * @type int $plugin_reject The number of plugins rejected within the defined time interval. 77 * @type int $in_queue The number of plugins currently in the queue (new or pending). 78 * @type int $in_queue_new The number of new plugins currently in the queue. 79 * @type int $in_queue_pending The number of pending plugins currently in the queue. 80 * @type array $in_queue_pending_why The number of pending plugins currently in the queue, broken down by whom we're waiting on. 81 * @type int $in_queue_from_time_window The number of plugins currently in the queue submitted during the specified time window. 82 * @type int $in_queue_old The number of plugins currently in the queue that are older than "recently". 83 * @type int $helpscout_queue_total_conversations The number of ongoing Help Scout conversations. 84 * @type int $helpscout_queue_new_conversations The number of new Help Scout conversations. 85 * @type int $helpscout_queue_customers The number of unique Plugin authors contacted. 86 * @type int $helpscout_queue_conversations_per_day The number of Help Scout conversations per day. 87 * @type int $helpscout_queue_busiest_day The busiest day in the Help Scout queue. 88 * @type int $helpscout_queue_messages_received The number of emails received in HelpScout. 89 * @type int $helpscout_queue_replies_sent The number of replies sent to emails. 90 * @type int $helpscout_queue_emails_created The number of new outgoing conversations created. 89 91 * } 90 92 */ … … 127 129 ) ), 'count', 'reason' ); 128 130 131 $stats[ 'plugin_delist_reasons' ] = array_map( 'intval', $stats[ 'plugin_delist_reasons' ] ); 132 129 133 $stats[ 'plugin_new' ] = (int) $wpdb->get_var( $wpdb->prepare( 130 134 "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = '_submitted_date' AND meta_value >= %d AND meta_value < %d", … … 143 147 // -------------- 144 148 // # of plugins currently in the queue that are new (have not been processed/replied to yet) 145 $stats['in_queue_new'] = $wpdb->get_var(149 $stats['in_queue_new'] = (int) $wpdb->get_var( 146 150 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = 'new'" 147 151 ); 148 152 149 153 // # of plugins currently in the queue that are pending (have been initially replied to) 150 $stats['in_queue_pending'] = $wpdb->get_var(154 $stats['in_queue_pending'] = (int) $wpdb->get_var( 151 155 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = 'pending'" 152 156 ); 153 157 158 // # Break down the plugins in the queue, based on if we're still waiting on a reply. 159 $stats['in_queue_pending_why'] = $wpdb->get_row( $wpdb->prepare( 160 'SELECT 161 SUM( IF( active = 0, 1, 0 ) ) AS `author`, 162 SUM( IF( active > 0, 1, 0 ) ) AS `reviewer` 163 FROM ( 164 SELECT 165 p.post_name, 166 SUM( IF( emails.status = "closed", 1, 0 ) ) AS `closed`, 167 SUM( IF( emails.status = "active", 1, 0 ) ) AS `active` 168 FROM %i p 169 LEFT JOIN %i meta ON meta.meta_key = "plugins" AND meta.meta_value = p.post_name 170 LEFT JOIN %i emails ON meta.helpscout_id = emails.id 171 WHERE p.post_status = "pending" 172 GROUP BY p.ID 173 ) subquery', 174 $wpdb->posts, 175 "{$wpdb->base_prefix}helpscout_meta", 176 "{$wpdb->base_prefix}helpscout", 177 ), ARRAY_A ); 178 179 $stats['in_queue_pending_why'] = array_map( 'intval', $stats['in_queue_pending_why'] ); 180 154 181 // # of plugins currently in the queue (new + pending) 155 182 $stats['in_queue'] = $stats['in_queue_new'] + $stats['in_queue_pending']; 156 183 157 184 // # of plugins currently in the queue submitted during the specified time window 158 $stats['in_queue_from_time_window'] = $wpdb->get_var( $wpdb->prepare(185 $stats['in_queue_from_time_window'] = (int) $wpdb->get_var( $wpdb->prepare( 159 186 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( 'new','pending' ) AND post_date < %s AND post_date > DATE_SUB( %s, INTERVAL %d DAY )", 160 187 $args['date'], … … 164 191 165 192 // # of plugins currently in the queue that are older than "recently" 166 $stats['in_queue_old'] = $wpdb->get_var( $wpdb->prepare(193 $stats['in_queue_old'] = (int) $wpdb->get_var( $wpdb->prepare( 167 194 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( 'new','pending' ) AND post_date < DATE_SUB( %s, INTERVAL %d DAY )", 168 195 $args['date'], … … 396 423 ?> 397 424 </li> 425 <li> 426 <?php 427 /* translators: %d: number of pending plugins */ 428 printf( 429 __( '→ (pending; waiting on author)* : %d', 'wporg-plugins' ), 430 esc_html( $stats['in_queue_pending_why']['author'] ) 431 ); 432 ?> 433 </li> 434 <li> 435 <?php 436 /* translators: %d: number of pending plugins */ 437 printf( 438 __( '→ (pending; waiting on reviewer)* : %d', 'wporg-plugins' ), 439 esc_html( $stats['in_queue_pending_why']['reviewer'] ) 440 ); 441 ?> 442 </li> 398 443 </ul> 399 444
Note: See TracChangeset
for help on using the changeset viewer.