Making WordPress.org

Ticket #4294: 4294.diff

File 4294.diff, 4.6 KB (added by Ipstenu, 6 years ago)
  • trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

     
    1111        public static function get_submitted_plugins() {
    1212                $plugins = get_posts( array(
    1313                        'post_type'      => 'plugin',
    14                         'post_status'    => array( 'new', 'pending' ),
     14                        'post_status'    => array( 'new', 'pending', 'approved' ),
    1515                        'author'         => get_current_user_id(),
    1616                        'orderby'        => 'title',
    1717                        'order'          => 'ASC',
     
    3131                        include_once ABSPATH . 'wp-admin/includes/template.php';
    3232
    3333                        $submitted_plugins = self::get_submitted_plugins();
    34                         $submitted_counts  = (object) array_fill_keys( array( 'new', 'pending' ), 0 );
     34                        $submitted_counts  = (object) array_fill_keys( array( 'new', 'pending', 'approved' ), 0 );
    3535
    3636                        $submitted_counts->total = count( $submitted_plugins );
    3737
     
    4242                                } elseif ( 'pending' === $plugin->post_status ) {
    4343                                        $submitted_plugins[ $key ]->status = __( 'Being Reviewed', 'wporg-plugins' );
    4444                                        $submitted_counts->pending++;
     45                                } elseif ( 'approverd' === $plugin->post_status ) {
     46                                        $submitted_plugins[ $key ]->status = __( 'Approved', 'wporg-plugins' );
     47                                        $submitted_counts->approved++;
    4548                                }
    4649                        }
    4750
     
    100103                                        <div class="plugin-queue-message notice notice-warning notice-alt">
    101104                                                <p>
    102105                                                <?php
    103                                                 if ( 1 === $submitted_counts->total ) {
    104                                                         esc_html_e( 'You already have a plugin in the review queue. Please wait for it to be approved before submitting any more.', 'wporg-plugins' );
    105                                                 } else {
     106                                                if ( 0 !== $submitted_counts->approved ) {
    106107                                                        printf(
    107                                                                 /* translators: 1: Total amount of plugins; 2: Amount of pending plugins. */
     108                                                                /* translators: 1: Amount of approved plugins. 2: URL on how to use SVN */
    108109                                                                esc_html( _n(
    109                                                                         'You have %1$s plugins in the review queue, %2$s is being actively reviewed. Please wait for them to be approved before submitting any more.',
    110                                                                         'You have %1$s plugins in the review queue, %2$s are being actively reviewed. Please wait for them to be approved before submitting any more.',
     110                                                                        'You have %1$s approved plugin that has not yet been used. We require developers to use the hosting we provide. Please upload your plugin via <a href="%2$s">SVN</a>.',
     111                                                                        'You have %1$s plugins that have not yet been used. We require developers to use the hosting we provide. Please upload your plugins via <a href="%2$s">SVN</a>.',
     112                                                                        $submitted_counts->approved,
     113                                                                        'wporg-plugins'
     114                                                                ) ),
     115                                                                '<strong>' . $submitted_counts->approved . '</strong>',
     116                                                                'https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/'
     117                                                        );
     118                                                } elseif ( 0 !== $submitted_counts->pending ) {
     119                                                        printf(
     120                                                                /* translators: 1: Amount of pending plugins. */
     121                                                                esc_html( _n(
     122                                                                        'You have %1$s plugin being actively reviewed. You must complete this review before you can submit another plugin.',
     123                                                                        'You have %1$s plugins being actively reviewed. You must complete their reviews before you can submit another plugin.',
    111124                                                                        $submitted_counts->pending,
    112125                                                                        'wporg-plugins'
    113126                                                                ) ),
    114                                                                 '<strong>' . $submitted_counts->total . '</strong>',
    115127                                                                '<strong>' . $submitted_counts->pending . '</strong>'
    116128                                                        );
     129                                                } elseif ( 0 !== $submitted_counts->new ) {
     130                                                        printf(
     131                                                                /* translators: 1: Amount of new plugins. */
     132                                                                esc_html( _n(
     133                                                                        'You have %1$s plugin that has been recently submitted but not yet reviewed. Please wait for your plugin to be reviewed and approved before submitting another.',
     134                                                                        'You have %1$s plugins already submitted but not yet reviewed. Please wait for them to be reviewed and approved before submitting another plugin.',
     135                                                                        $submitted_counts->new,
     136                                                                        'wporg-plugins'
     137                                                                ) ),
     138                                                                '<strong>' . $submitted_counts->new . '</strong>'
     139                                                        );
    117140                                                }
     141
    118142                                                ?>
    119143                                                </p>
    120144
    121145                                                <ul>
    122146                                                <?php
     147                                                // List of all plugins in progress
    123148                                                foreach ( $submitted_plugins as $plugin ) {
    124149                                                        echo '<li>' . esc_html( $plugin->post_title ) . ' &#8212; ' . $plugin->status . "</li>\n";
    125150                                                }
     
    195220                                        printf( '<script>%s</script>', $upload_script );
    196221                                }
    197222                                ?>
    198                
     223
    199224                        <?php endif; // ! $submitted_counts->total ?>
    200225
    201226                <?php else : ?>