Changeset 5318
- Timestamp:
- 04/11/2017 06:37:04 AM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r5308 r5318 131 131 132 132 if ( empty( $query->query['post_status'] ) ) { 133 $query->query_vars['post_status'] = array( 'publish', 'future', ' draft', 'pending', 'disabled', 'closed', 'rejected', 'approved' );133 $query->query_vars['post_status'] = array( 'publish', 'future', 'new', 'pending', 'disabled', 'closed', 'rejected', 'approved' ); 134 134 } 135 135 … … 176 176 'post_type' => 'plugin', 177 177 'post__in' => array_map( 'absint', $_REQUEST['post'] ), 178 'post_status' => array( ' draft', 'pending' ),178 'post_status' => array( 'new', 'pending' ), 179 179 'posts_per_page' => count( $_REQUEST['post'] ), 180 180 ) ); … … 238 238 239 239 switch ( $post->post_status ) { 240 case ' draft':240 case 'new': 241 241 $message = __( 'This plugin is newly requested and has not yet been reviewed.', 'wporg-plugins' ); 242 242 $type = 'notice-info'; … … 366 366 ); 367 367 368 if ( ' draft' !== $post->post_status ) {368 if ( 'new' !== $post->post_status && 'pending' != $post->post_status ) { 369 369 add_meta_box( 370 370 'plugin-committers', … … 381 381 382 382 // Remove slug metabox unless the slug is editable for the current user. 383 if ( ! in_array( $post->post_status, array( ' draft', 'pending' ) ) || ! current_user_can( 'plugin_approve', $post ) ) {383 if ( ! in_array( $post->post_status, array( 'new', 'pending' ) ) || ! current_user_can( 'plugin_approve', $post ) ) { 384 384 remove_meta_box( 'slugdiv', 'plugin', 'normal' ); 385 385 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
r5313 r5318 57 57 58 58 // ...or it's a white-listed status for plugin reviewers. 59 if ( current_user_can( 'plugin_review', $postarr['ID'] ) && in_array( $postarr['post_status'], array( ' draft', 'pending' ) ) ) {59 if ( current_user_can( 'plugin_review', $postarr['ID'] ) && in_array( $postarr['post_status'], array( 'new', 'pending' ) ) ) { 60 60 return $data; 61 61 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php
r5037 r5318 80 80 } 81 81 82 if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( ' draft', 'pending' ) ) ) ) {82 if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( 'new', 'pending' ) ) ) ) { 83 83 $actions['plugin_reject'] = __( 'Reject', 'wporg-plugins' ); 84 84 } … … 407 407 } 408 408 409 if ( ! current_user_can( 'plugin_approve' ) && ! in_array( $status_name, array( ' draft', 'pending' ) ) ) {409 if ( ! current_user_can( 'plugin_approve' ) && ! in_array( $status_name, array( 'new', 'pending' ) ) ) { 410 410 continue; 411 411 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
r5274 r5318 149 149 150 150 $plugin_slug = $plugin->post_name; 151 if ( in_array( $plugin->post_status, array( ' draft', 'pending' ) ) ) {151 if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) { 152 152 $extra .= ' (requested ' . human_time_diff( strtotime( $last_updated ) ) . ' ago)'; 153 153 $tooltips[] = 'Requested, remains unapproved.'; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php
r4212 r5318 41 41 } 42 42 43 $statuses = array( ' draft', 'pending' );43 $statuses = array( 'new', 'pending' ); 44 44 if ( current_user_can( 'plugin_approve', $post ) ) { 45 if ( in_array( $post->post_status, array( ' draft', 'pending', 'rejected', 'approved' ) ) ) {45 if ( in_array( $post->post_status, array( 'new', 'draft', 'pending', 'rejected', 'approved' ) ) ) { 46 46 $statuses = array_merge( $statuses, array( 'approved', 'rejected' ) ); 47 47 } else { 48 $statuses = array( 'publish', 'disabled', 'closed' );48 $statuses = array( 'publish', 'disabled', 'closed', 'pending' ); 49 49 } 50 50 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php
r5267 r5318 11 11 $post = get_post(); 12 12 13 $zip_ url = '';13 $zip_files = array(); 14 14 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) { 15 $zip_url = wp_get_attachment_url( $zip_file->ID ); 16 break; 15 $zip_files[ $zip_file->post_date ] = wp_get_attachment_url( $zip_file->ID ); 17 16 } 18 if ( ! $zip_url ) { 19 $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ); 17 uksort( $zip_files, function( $a, $b ) { 18 return strtotime( $a ) < strtotime( $b ); 19 } ); 20 21 if ( $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ) ) { 22 // Back-compat only. 23 $zip_files[ 'User provided URL' ] = $zip_url; 20 24 } 21 25 22 if ($zip_url ) {26 foreach ( $zip_files as $zip_date => $zip_url ) { 23 27 printf( '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>', 24 sprintf( ' <a href="%s">%s</a>', esc_url( $zip_url ), esc_html( $zip_url ) )28 sprintf( '%s <a href="%s">%s</a>', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ) ) 25 29 ); 26 30 } 27 31 28 if ( 'pending' != $post->post_status ) {32 if ( 'pending' != $post->post_status && 'new' != $post->post_status ) { 29 33 echo "<ul> 30 34 <li><a href='https://plugins.trac.wordpress.org/log/{$post->post_name}/'>" . __( 'Development Log', 'wporg-plugins' ) . "</a></li> … … 33 37 </ul>'; 34 38 } 35 if ( $post->post_excerpt && in_array( $post->post_status, array( ' pending', 'approved' ) ) ) {39 if ( $post->post_excerpt && in_array( $post->post_status, array( 'new', 'pending', 'approved' ) ) ) { 36 40 echo '<p>' . strip_tags( $post->post_excerpt ) . '</p>'; 37 41 } … … 41 45 42 46 $type = 'Notice'; 43 if ( $post->post_status == ' draft' || $post->post_status == 'pending' ) {47 if ( $post->post_status == 'new' || $post->post_status == 'pending' ) { 44 48 $type = 'Request'; 45 49 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php
r5312 r5318 108 108 // # of plugins currently in the queue that are drafts (have not been processed/replied to yet) 109 109 $stats['in_queue_draft'] = $wpdb->get_var( 110 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = ' draft'"110 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = 'new'" 111 111 ); 112 112 … … 121 121 // # of plugins currently in the queue submitted during the specified time window 122 122 $stats['in_queue_from_time_window'] = $wpdb->get_var( $wpdb->prepare( 123 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( ' draft','pending' ) AND post_date < %s AND post_date > DATE_SUB( %s, INTERVAL %d DAY )",123 "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 )", 124 124 $args['date'], 125 125 $args['date'], … … 129 129 // # of plugins currently in the queue that are older than "recently" 130 130 $stats['in_queue_old'] = $wpdb->get_var( $wpdb->prepare( 131 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( ' draft','pending' ) AND post_date < DATE_SUB( %s, INTERVAL %d DAY )",131 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( 'new','pending' ) AND post_date < DATE_SUB( %s, INTERVAL %d DAY )", 132 132 $args['date'], 133 133 absint( $args['recentdays'] ) + 1 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r5316 r5318 284 284 ) ); 285 285 286 register_post_status( 'new', array( 287 'label' => _x( 'Pending Initial Review', 'plugin status', 'wporg-plugins' ), 288 'public' => false, 289 'show_in_admin_status_list' => current_user_can( 'plugin_review' ), 290 'label_count' => _n_noop( 'Pending Initial Review <span class="count">(%s)</span>', 'Pending Initial Review <span class="count">(%s)</span>', 'wporg-plugins' ), 291 ) ); 286 292 register_post_status( 'pending', array( 287 293 'label' => _x( 'Pending', 'plugin status', 'wporg-plugins' ), … … 793 799 if ( $viewing_own_author_archive || ( is_user_logged_in() && !empty( $wp_query->query_vars['name'] ) ) ) { 794 800 795 $wp_query->query_vars['post_status'] = array( ' pending', 'approved', 'publish', 'closed', 'disabled' );801 $wp_query->query_vars['post_status'] = array( 'approved', 'publish', 'closed', 'disabled' ); 796 802 797 803 add_filter( 'posts_results', function( $posts, $this_wp_query ) use( $wp_query ) { … … 1193 1199 'post_type' => 'plugin', 1194 1200 'name' => $plugin_slug, 1195 'post_status' => array( 'publish', 'pending', 'disabled', 'closed', ' draft', 'approved' ),1201 'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved' ), 1196 1202 ) ); 1197 1203 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
r5264 r5318 97 97 98 98 // Is there already a plugin by a different author? 99 if ( $plugin_post instanceof \WP_Post&& $plugin_post->post_author != get_current_user_id() ) {99 if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) { 100 100 /* translators: %s: plugin slug */ 101 101 return sprintf( __( 'There is already a plugin called %s by a different author. Please change the name of your plugin in the plugin header file and upload it again.', 'wporg-plugins' ), 102 '<code>' . $this->plugin_slug . '</code>' 103 ); 104 } 105 106 // Check the plugin can accept uploads (New submissions, or pending further review). 107 if ( $plugin_post && ! in_array( $plugin_post->post_status, array( 'new', 'pending' ) ) ) { 108 /* translators: %s: plugin slug */ 109 return sprintf( __( 'There is already a plugin called %s. Please change the name of your plugin in the plugin header file and upload it again.', 'wporg-plugins' ), 102 110 '<code>' . $this->plugin_slug . '</code>' 103 111 ); … … 171 179 'post_title' => $this->plugin['Name'], 172 180 'post_name' => $this->plugin_slug, 173 'post_status' => ' draft',181 'post_status' => 'new', 174 182 'post_content' => $content, 175 183 'post_excerpt' => $this->plugin['Description'], … … 205 213 'usage' => array(), 206 214 '_author_ip' => preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] ), 215 '_submitted_date' => time(), 207 216 ), 208 217 ) ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
r4817 r5318 32 32 <p> 33 33 <?php 34 printf( _n( 'Currently there is %1$s plugin in the review queue.', 'Currently there are %1$s plugins in the review queue, %2$s of which are awaiting their initial review.', ( $plugins-> draft+ $plugins->pending ), 'wporg-plugins' ),35 '<strong>' . ( $plugins-> draft+ $plugins->pending ) . '</strong>',36 '<strong>' . $plugins-> draft. '</strong>'34 printf( _n( 'Currently there is %1$s plugin in the review queue.', 'Currently there are %1$s plugins in the review queue, %2$s of which are awaiting their initial review.', ( $plugins->new + $plugins->pending ), 'wporg-plugins' ), 35 '<strong>' . ( $plugins->new + $plugins->pending ) . '</strong>', 36 '<strong>' . $plugins->new . '</strong>' 37 37 ); 38 38 ?> 39 39 </p> 40 40 </div> 41 <?php42 if ( '/plugins-wp' === parse_url( home_url(), PHP_URL_PATH ) ) {43 echo '<div class="notice notice-error notice-alt">44 <p>Please submit all new plugin requests through the existing form <a href="https://wordpress.org/plugins/add/">available here</a>, You\'re currently viewing the beta version of the upcoming plugin directory, and this form is only for testing purposes.</p>45 </div>';46 }47 ?>48 41 49 42 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.