Changeset 13819
- Timestamp:
- 06/14/2024 03:24:50 AM (7 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r13101 r13819 282 282 $this->version_status = 'live'; 283 283 284 if ( 'themedropbox' !== $author && function_exists( 'bump_stats_extras' ) ) { 285 bump_stats_extras( 'themes', 'upload_from_svn' ); 286 } 287 284 288 return $this->import( array( // return true | WP_Error 285 289 // Since this version is already in SVN, we shouldn't try to import it again. … … 448 452 $this->theme_post = $this->get_theme_post(); 449 453 } 454 $is_new_upload = empty( $this->theme_post ); 455 $is_update = ! $is_new_upload; 450 456 451 457 // Populate author. … … 761 767 // Initiate a GitHub actions run for the theme. 762 768 $this->trigger_e2e_run(); 769 770 // Record stats. 771 if ( function_exists( 'bump_stats_extras' ) ) { 772 bump_stats_extras( 'themes', $is_new_upload ? 'new' : 'update' ); 773 } 763 774 764 775 // Success! -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r13563 r13819 1542 1542 return 200 === wp_remote_retrieve_response_code( $request ); 1543 1543 } 1544 1545 /** 1546 * Record some stats on theme status changes. 1547 * 1548 * @param string $new_status 1549 * @param string $old_status 1550 * @param WP_Post $post 1551 */ 1552 function wporg_themes_status_change_stats( $new_status, $old_status, $post ) { 1553 if ( 1554 'repopackage' !== $post->post_type || 1555 in_array( $new_status, [ 'draft', 'auto-draft' ] ) || 1556 ! function_exists( 'bump_stats_extras' ) 1557 ) { 1558 return; 1559 } 1560 1561 if ( 'suspended' == $old_status && 'publish' == $new_status ) { 1562 $stat = 'reinstated'; 1563 } elseif( 'delist' == $old_status && 'publish' == $new_status ) { 1564 $stat = 'relisted'; 1565 } else { 1566 $stat = $new_status; 1567 } 1568 1569 bump_stats_extras( 'themes', 'status-' . $stat ); 1570 } 1571 add_action( 'transition_post_status', 'wporg_themes_status_change_stats', 10, 3 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/upload.php
r13101 r13819 126 126 $message = $upload->process_upload( $_FILES['zip_file'] ); 127 127 128 if ( ! is_wp_error( $message ) && function_exists( 'bump_stats_extras' ) ) { 129 bump_stats_extras( 'themes', 'upload_by_zip' ); 130 } 131 128 132 return $message; 129 133 }
Note: See TracChangeset
for help on using the changeset viewer.