Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php
- Timestamp:
- 12/19/2017 04:22:37 PM (7 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
r5919 r6287 42 42 * Returns the stats. 43 43 * 44 * @param array 45 * 44 * @param array $args { 45 * Optional. Array of override arguments 46 46 * 47 47 * @type string $date The date (in Y-m-d format) for the end of the stats time interval (non-inclusive). Default today. … … 88 88 // Plugin Status Changes 89 89 // -------------- 90 91 90 $states = array( 'plugin_approve', 'plugin_delist', 'plugin_new', 'plugin_reject' ); 92 91 foreach ( $states as $state ) { 93 92 // The stats table used by bbPress1 (and could still be used, but isn't yet). 94 93 // 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( 96 95 "SELECT SUM(views) FROM stats_extras WHERE name = 'plugin' AND date < %s AND date > DATE_SUB( %s, INTERVAL %d DAY ) AND value = %s", 97 96 $args['date'], … … 104 103 // Temporary until the above is updated to work with the new directory: 105 104 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 } 107 108 } 108 109 … … 110 111 // Plugin Queue 111 112 // -------------- 112 113 113 // # of plugins currently in the queue that are new (have not been processed/replied to yet) 114 114 $stats['in_queue_new'] = $wpdb->get_var( … … 142 142 // SupportPress Queue 143 143 // -------------- 144 145 144 // # of currently open threads 146 145 $stats['supportpress_queue_total_open'] = $wpdb->get_var( … … 194 193 } 195 194 196 $args['num_days'] = empty( $_POST['days'] ) ? '' : absint( $_POST['days'] );195 $args['num_days'] = empty( $_POST['days'] ) ? '' : absint( $_POST['days'] ); 197 196 $args['recentdays'] = empty( $_POST['recentdays'] ) ? '' : absint( $_POST['recentdays'] ); 198 197 … … 212 211 <tr><th scope="row"><label for="date"><?php _e( 'Date', 'wporg-plugins' ); ?></label></th><td> 213 212 <input name="date" type="text" id="date" value="<?php echo esc_attr( $args['date'] ); ?>" class="text"> 214 <p><?php 213 <p> 214 <?php 215 215 /* 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' ), 217 218 $date 218 219 ); 219 ?></p> 220 ?> 221 </p> 220 222 </td></tr> 221 223 222 224 <tr><th scope="row"><label for="days"><?php _e( 'Number of days', 'wporg-plugins' ); ?></label></th><td> 223 225 <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 225 228 /* 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' ), 227 231 7 228 232 ); 229 ?></p> 233 ?> 234 </p> 230 235 </td></tr> 231 236 232 237 <tr><th scope="row"><label for="recentdays"><?php _e( '"Recent" number of days', 'wporg-plugins' ); ?></label></th><td> 233 238 <input name="recentdays" type="text" id="recentdays" value="<?php echo esc_attr( $args['recentdays'] ); ?>" class="small-text"> 234 <p><?php 239 <p> 240 <?php 235 241 /* 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' ), 237 244 7 238 245 ); 239 ?></p> 246 ?> 247 </p> 240 248 </td></tr> 241 249 … … 246 254 <h2><?php _e( 'Stats', 'wporg-plugins' ); ?></h2> 247 255 248 <p><?php 256 <p> 257 <?php 249 258 /* 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' ), 251 261 $stats['num_days'], 252 262 $stats['date'], 253 263 $stats['recentdays'] 254 264 ); 255 ?></p> 265 ?> 266 </p> 256 267 257 268 <h3><?php _e( 'Plugin Status Change Stats', 'wporg-plugins' ); ?></h3> 258 269 259 270 <ul style="font-family:Courier New;"> 260 <li><?php 271 <li> 272 <?php 261 273 /* translators: %d: number of requested plugins */ 262 printf( __( 'Plugins requested : %d', 'wporg-plugins' ), 274 printf( 275 __( 'Plugins requested : %d', 'wporg-plugins' ), 263 276 $stats['plugin_new'] 264 277 ); 265 ?></li> 266 <li><?php 278 ?> 279 </li> 280 <li> 281 <?php 267 282 /* translators: %s: number of rejected plugins */ 268 printf( __( 'Plugins rejected : %s', 'wporg-plugins' ), 283 printf( 284 __( 'Plugins rejected : %s', 'wporg-plugins' ), 269 285 $stats['plugin_reject'] 270 286 ); 271 ?></li> 272 <li><?php 287 ?> 288 </li> 289 <li> 290 <?php 273 291 /* translators: %s: number of closed plugins */ 274 printf( __( 'Plugins closed : %s', 'wporg-plugins' ), 292 printf( 293 __( 'Plugins closed : %s', 'wporg-plugins' ), 275 294 $stats['plugin_delist'] 276 295 ); 277 ?></li> 278 <li><?php 296 ?> 297 </li> 298 <li> 299 <?php 279 300 /* translators: %s: number of approved plugins */ 280 printf( __( 'Plugins approved : %s', 'wporg-plugins' ), 301 printf( 302 __( 'Plugins approved : %s', 'wporg-plugins' ), 281 303 $stats['plugin_approve'] 282 304 ); 283 ?></li> 305 ?> 306 </li> 284 307 </ul> 285 308 … … 287 310 288 311 <ul style="font-family:Courier New;"> 289 <li><?php 312 <li> 313 <?php 290 314 /* 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' ), 292 317 $stats['in_queue'] 293 318 ); 294 ?></li> 295 <li><?php 319 ?> 320 </li> 321 <li> 322 <?php 296 323 /* translators: 1: number of most recent days, 2: number of older plugins in the queue */ 297 printf( __( '→ (older than %1$d days ago)** : %2$d', 'wporg-plugins' ), 324 printf( 325 __( '→ (older than %1$d days ago)** : %2$d', 'wporg-plugins' ), 298 326 $stats['recentdays'], 299 327 $stats['in_queue_old'] 300 328 ); 301 ?></li> 302 <li><?php 329 ?> 330 </li> 331 <li> 332 <?php 303 333 /* translators: 1: start date, 2: end date, 3: number of plugins in the queue within defined time window */ 304 printf( __( '→ (%1$s - %2$s) : %3$d', 'wporg-plugins' ), 334 printf( 335 __( '→ (%1$s - %2$s) : %3$d', 'wporg-plugins' ), 305 336 $start_date, 306 337 $stats['date'], 307 338 $stats['in_queue_from_time_window'] 308 339 ); 309 ?></li> 310 <li><?php 340 ?> 341 </li> 342 <li> 343 <?php 311 344 /* translators: %d: number of new plugins */ 312 printf( __( '→ (new; not processed or replied to yet)* : %d', 'wporg-plugins' ), 345 printf( 346 __( '→ (new; not processed or replied to yet)* : %d', 'wporg-plugins' ), 313 347 $stats['in_queue_new'] 314 348 ); 315 ?></li> 316 <li><?php 349 ?> 350 </li> 351 <li> 352 <?php 317 353 /* translators: %d: number of pending plugins */ 318 printf( __( '→ (pending; replied to)* : %d', 'wporg-plugins' ), 354 printf( 355 __( '→ (pending; replied to)* : %d', 'wporg-plugins' ), 319 356 $stats['in_queue_pending'] 320 357 ); 321 ?></li> 358 ?> 359 </li> 322 360 </ul> 323 361 … … 325 363 326 364 <ul style="font-family:Courier New;"> 327 <li><?php 365 <li> 366 <?php 328 367 /* translators: %d: number of open tickets */ 329 printf( __( 'Total open tickets* : %d', 'wporg-plugins' ), 368 printf( 369 __( 'Total open tickets* : %d', 'wporg-plugins' ), 330 370 $stats['supportpress_queue_total_open'] 331 371 ); 332 ?></li> 333 <li><?php 372 ?> 373 </li> 374 <li> 375 <?php 334 376 /* translators: 1: number of most recent days, 2: number of plugins with no activity */ 335 printf( __( ' → (with no activity in last %1$d days)** : %2$d', 'wporg-plugins' ), 377 printf( 378 __( ' → (with no activity in last %1$d days)** : %2$d', 'wporg-plugins' ), 336 379 $stats['recentdays'], 337 380 $stats['supportpress_queue_total_open_old'] 338 381 ); 339 ?></li> 340 <li><?php 382 ?> 383 </li> 384 <li> 385 <?php 341 386 /* 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' ), 343 389 $stats['num_days'] 344 390 ); 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 347 395 /* translators: %d: total number of plugins within defined time window */ 348 printf( __( 'Total : %d', 'wporg-plugins' ), 396 printf( 397 __( 'Total : %d', 'wporg-plugins' ), 349 398 $stats['supportpress_queue_interval_all'] 350 399 ); 351 ?></li> 352 <li><?php 400 ?> 401 </li> 402 <li> 403 <?php 353 404 /* translators: %d: number of closed plugins within defined time window */ 354 printf( __( 'Closed : %d', 'wporg-plugins' ), 405 printf( 406 __( 'Closed : %d', 'wporg-plugins' ), 355 407 $stats['supportpress_queue_interval_closed'] 356 408 ); 357 ?></li> 358 <li><?php 409 ?> 410 </li> 411 <li> 412 <?php 359 413 /* translators: %d: number of open plugins within defined time window */ 360 printf( __( 'Open : %d', 'wporg-plugins' ), 414 printf( 415 __( 'Open : %d', 'wporg-plugins' ), 361 416 $stats['supportpress_queue_interval_open'] 362 417 ); 363 ?></li> 418 ?> 419 </li> 364 420 </ul> 365 421 </li>
Note: See TracChangeset
for help on using the changeset viewer.