Making WordPress.org


Ignore:
Timestamp:
04/27/2023 01:44:34 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Upload: Expand the current queue length warning to suggest how long the initial review queue is in days.

This is not a guarantee of the date that a plugin will be reviewed on, but provides some notion of how long "400 waiting review" might take.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

    r12508 r12565  
    7676
    7777            else :
    78                 $plugins = wp_count_posts( 'plugin', 'readable' );
     78                $plugins       = wp_count_posts( 'plugin', 'readable' );
     79                $oldest_plugin = get_posts( [ 'post_type' => 'plugin', 'post_status' => 'new', 'order' => 'ASC', 'orderby' => 'post_date_gmt', 'numberposts' => 1 ] );
     80                $queue_length  = floor( ( time() - strtotime( $oldest_plugin[0]->post_date_gmt ?? 'now' ) ) / DAY_IN_SECONDS );
    7981                ?>
    8082
     
    9395                                'wporg-plugins'
    9496                            ) ),
    95                             '<strong>' . $plugins->new . '</strong>'
     97                            '<strong>' . number_format_i18n( $plugins->new ) . '</strong>'
     98                        );
     99                    }
     100
     101                    // If the queue is currently beyond 10 days, display a warning to that effect.
     102                    if ( $queue_length > 10 ) {
     103                        echo '</p><p>';
     104                        esc_html_e( 'The review queue is currently longer than normal, we apologize for the delays and ask for patience.', 'wporg-plugins' );
     105
     106                        echo '</p><p>';
     107                        printf(
     108                            /* translators: %s: Number of days. Only displayed if > 10 */
     109                            esc_html( _n(
     110                                'The current wait for an initial review is at least %s day.',
     111                                'The current wait for an initial review is at least %s days.',
     112                                $queue_length,
     113                                'wporg-plugins'
     114                            ) ),
     115                            '<strong>' . number_format_i18n( $queue_length ) . '</strong>'
    96116                        );
    97117                    }
Note: See TracChangeset for help on using the changeset viewer.