<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[5318] sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory: Plugin Directory: Introduce the 'new' post_status to replace 'draft', this will allow a better more well-defined statuses for plugins.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/5318">5318</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/5318","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-04-11 06:37:04 +0000 (Tue, 11 Apr 2017)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Plugin Directory: Introduce the 'new' post_status to replace 'draft', this will allow a better more well-defined statuses for plugins.

See <a href="http://meta.trac.wordpress.org/ticket/2716">#2716</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclasscustomizationsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclassstatustransitionsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminlisttableclasspluginpostsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclassauthorcardphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclasscontrolsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclassreviewtoolsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadmintoolsclassstatsreportphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclassplugindirectoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryshortcodesclassuploadhandlerphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryshortcodesclassuploadphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclasscustomizationsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php  2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php    2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,7 +130,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( empty( $query->query['post_status'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $query->query_vars['post_status'] = array( 'publish', 'future', 'draft', 'pending', 'disabled', 'closed', 'rejected', 'approved' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $query->query_vars['post_status'] = array( 'publish', 'future', 'new', 'pending', 'disabled', 'closed', 'rejected', 'approved' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Make it possible to search for plugins that were submitted from a specific IP.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $plugins  = get_posts( array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_type'      => 'plugin',
</span><span class="cx" style="display: block; padding: 0 10px">                        'post__in'       => array_map( 'absint', $_REQUEST['post'] ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'post_status'    => array( 'draft', 'pending' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'post_status'    => array( 'new', 'pending' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                         'posts_per_page' => count( $_REQUEST['post'] ),
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -237,7 +237,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $is_admin = current_user_can( 'plugin_approve' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                switch ( $post->post_status ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        case 'draft':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 case 'new':
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $message = __( 'This plugin is newly requested and has not yet been reviewed.', 'wporg-plugins' );
</span><span class="cx" style="display: block; padding: 0 10px">                                $type    = 'notice-info';
</span><span class="cx" style="display: block; padding: 0 10px">                                break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,7 +365,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'plugin', 'side', 'high'
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 'draft' !== $post->post_status ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( 'new' !== $post->post_status && 'pending' != $post->post_status ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         add_meta_box(
</span><span class="cx" style="display: block; padding: 0 10px">                                'plugin-committers',
</span><span class="cx" style="display: block; padding: 0 10px">                                __( 'Plugin Committers', 'wporg-plugins' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                remove_meta_box( 'commentstatusdiv', 'plugin', 'normal' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Remove slug metabox unless the slug is editable for the current user.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! in_array( $post->post_status, array( 'draft', 'pending' ) ) || ! current_user_can( 'plugin_approve', $post ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! in_array( $post->post_status, array( 'new', 'pending' ) ) || ! current_user_can( 'plugin_approve', $post ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         remove_meta_box( 'slugdiv', 'plugin', 'normal' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclassstatustransitionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php      2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php        2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // ...or it's a white-listed status for plugin reviewers.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( current_user_can( 'plugin_review', $postarr['ID'] ) && in_array( $postarr['post_status'], array( 'draft', 'pending' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( current_user_can( 'plugin_review', $postarr['ID'] ) && in_array( $postarr['post_status'], array( 'new', 'pending' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         return $data;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminlisttableclasspluginpostsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php 2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php   2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,7 +79,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( 'draft', 'pending' ) ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( current_user_can( 'plugin_reject' ) && ( empty( $_REQUEST['post_status'] ) || in_array( $_REQUEST['post_status'], array( 'new', 'pending' ) ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $actions['plugin_reject'] = __( 'Reject', 'wporg-plugins' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,7 +406,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( ! current_user_can( 'plugin_approve' ) && ! in_array( $status_name, array( 'draft', 'pending' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( ! current_user_can( 'plugin_approve' ) && ! in_array( $status_name, array( 'new', 'pending' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 continue;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclassauthorcardphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php     2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php       2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        $plugin_slug = $plugin->post_name;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( in_array( $plugin->post_status, array( 'draft', 'pending' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 $extra .= ' (requested ' . human_time_diff( strtotime( $last_updated ) ) . ' ago)';
</span><span class="cx" style="display: block; padding: 0 10px">                                                $tooltips[] = 'Requested, remains unapproved.';
</span><span class="cx" style="display: block; padding: 0 10px">                                                $classes[]  = 'profile-plugin-requested';
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclasscontrolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php        2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php  2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,12 +40,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $statuses = array( 'draft', 'pending' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $statuses = array( 'new', 'pending' );
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( current_user_can( 'plugin_approve', $post ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( in_array( $post->post_status, array( 'draft', 'pending', 'rejected', 'approved' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( in_array( $post->post_status, array( 'new', 'draft', 'pending', 'rejected', 'approved' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $statuses = array_merge( $statuses, array( 'approved', 'rejected' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                        } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $statuses = array( 'publish', 'disabled', 'closed' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $statuses = array( 'publish', 'disabled', 'closed', 'pending' );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">                ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclassreviewtoolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php    2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-review-tools.php      2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,29 +10,33 @@
</span><span class="cx" style="display: block; padding: 0 10px">        static function display() {
</span><span class="cx" style="display: block; padding: 0 10px">                $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $zip_url = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $zip_files = array();
</ins><span class="cx" style="display: block; padding: 0 10px">                 foreach ( get_attached_media( 'application/zip', $post ) as $zip_file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $zip_url = wp_get_attachment_url( $zip_file->ID );
-                       break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $zip_files[ $zip_file->post_date ] = wp_get_attachment_url( $zip_file->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $zip_url ) {
-                       $zip_url = get_post_meta( $post->ID, '_submitted_zip', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         uksort( $zip_files, function( $a, $b ) {
+                       return strtotime( $a ) < strtotime( $b );
+               } );
+
+               if ( $zip_url = get_post_meta( $post->ID, '_submitted_zip', true ) ) {
+                       // Back-compat only.
+                       $zip_files[ 'User provided URL' ] = $zip_url;
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $zip_url ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         foreach ( $zip_files as $zip_date => $zip_url ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         printf( '<p>' . __( '<strong>Zip file:</strong> %s', 'wporg-plugins' ) . '</p>',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                sprintf( '<a href="%s">%s</a>', esc_url( $zip_url ), esc_html( $zip_url ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         sprintf( '%s <a href="%s">%s</a>', esc_html( $zip_date ), esc_url( $zip_url ), esc_html( $zip_url ) )
</ins><span class="cx" style="display: block; padding: 0 10px">                         );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 'pending' != $post->post_status ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( 'pending' != $post->post_status && 'new' != $post->post_status ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         echo "<ul>
</span><span class="cx" style="display: block; padding: 0 10px">                                <li><a href='https://plugins.trac.wordpress.org/log/{$post->post_name}/'>" . __( 'Development Log', 'wporg-plugins' ) . "</a></li>
</span><span class="cx" style="display: block; padding: 0 10px">                                <li><a href='https://plugins.svn.wordpress.org/{$post->post_name}/'>" . __( 'Subversion Repository', 'wporg-plugins' ) . "</a></li>
</span><span class="cx" style="display: block; padding: 0 10px">                                <li><a href='https://plugins.trac.wordpress.org/browser/{$post->post_name}/'>" . __( 'Browse in Trac', 'wporg-plugins' ) . '</a></li>
</span><span class="cx" style="display: block; padding: 0 10px">                        </ul>';
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $post->post_excerpt && in_array( $post->post_status, array( 'pending', 'approved' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $post->post_excerpt && in_array( $post->post_status, array( 'new', 'pending', 'approved' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         echo '<p>' . strip_tags( $post->post_excerpt ) . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $author = get_user_by( 'id', $post->post_author );
</span><span class="cx" style="display: block; padding: 0 10px">                        
</span><span class="cx" style="display: block; padding: 0 10px">                        $type   = 'Notice';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( $post->post_status == 'draft' || $post->post_status == 'pending' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( $post->post_status == 'new' || $post->post_status == 'pending' ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $type = 'Request';
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                        
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadmintoolsclassstatsreportphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php      2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-stats-report.php        2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // # of plugins currently in the queue that are drafts (have not been processed/replied to yet)
</span><span class="cx" style="display: block; padding: 0 10px">                $stats['in_queue_draft'] = $wpdb->get_var(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = 'draft'"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` = 'new'"
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // # of plugins currently in the queue that are pending (have been initially replied to)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -120,7 +120,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // # of plugins currently in the queue submitted during the specified time window
</span><span class="cx" style="display: block; padding: 0 10px">                $stats['in_queue_from_time_window'] = $wpdb->get_var( $wpdb->prepare(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        "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 )",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 "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 )",
</ins><span class="cx" style="display: block; padding: 0 10px">                         $args['date'],
</span><span class="cx" style="display: block; padding: 0 10px">                        $args['date'],
</span><span class="cx" style="display: block; padding: 0 10px">                        absint( $args['num_days'] ) + 1
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,7 +128,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // # of plugins currently in the queue that are older than "recently"
</span><span class="cx" style="display: block; padding: 0 10px">                $stats['in_queue_old'] = $wpdb->get_var( $wpdb->prepare(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( 'draft','pending' ) AND post_date < DATE_SUB( %s, INTERVAL %d DAY )",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 "SELECT COUNT(*) FROM $wpdb->posts WHERE `post_type` = 'plugin' AND `post_status` IN ( 'new','pending' ) AND post_date < DATE_SUB( %s, INTERVAL %d DAY )",
</ins><span class="cx" style="display: block; padding: 0 10px">                         $args['date'],
</span><span class="cx" style="display: block; padding: 0 10px">                        absint( $args['recentdays'] ) + 1
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclassplugindirectoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php      2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php        2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,6 +283,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        ),
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                register_post_status( 'new', array(
+                       'label'                     => _x( 'Pending Initial Review', 'plugin status', 'wporg-plugins' ),
+                       'public'                    => false,
+                       'show_in_admin_status_list' => current_user_can( 'plugin_review' ),
+                       'label_count'               => _n_noop( 'Pending Initial Review <span class="count">(%s)</span>', 'Pending Initial Review <span class="count">(%s)</span>', 'wporg-plugins' ),
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 register_post_status( 'pending', array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'label'                     => _x( 'Pending', 'plugin status', 'wporg-plugins' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'public'                    => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -792,7 +798,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                // For singular requests, or self-author profile requests allow restricted post_status items to show on the front-end.
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $viewing_own_author_archive || ( is_user_logged_in() && !empty( $wp_query->query_vars['name'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $wp_query->query_vars['post_status'] = array( 'pending', 'approved', 'publish', 'closed', 'disabled' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $wp_query->query_vars['post_status'] = array( 'approved', 'publish', 'closed', 'disabled' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        add_filter( 'posts_results', function( $posts, $this_wp_query ) use( $wp_query ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( $this_wp_query != $wp_query ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1192,7 +1198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $posts = get_posts( array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_type'   => 'plugin',
</span><span class="cx" style="display: block; padding: 0 10px">                                'name'        => $plugin_slug,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'draft', 'approved' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved' ),
</ins><span class="cx" style="display: block; padding: 0 10px">                         ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! $posts ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryshortcodesclassuploadhandlerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php     2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php       2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,13 +96,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $plugin_post = Plugin_Directory::get_plugin_post( $this->plugin_slug );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Is there already a plugin by a different author?
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $plugin_post instanceof \WP_Post && $plugin_post->post_author != get_current_user_id() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $plugin_post && $plugin_post->post_author != get_current_user_id() ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         /* translators: %s: plugin slug */
</span><span class="cx" style="display: block; padding: 0 10px">                        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' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                '<code>' . $this->plugin_slug . '</code>'
</span><span class="cx" style="display: block; padding: 0 10px">                        );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // Check the plugin can accept uploads (New submissions, or pending further review).
+               if ( $plugin_post && ! in_array( $plugin_post->post_status, array( 'new', 'pending' ) ) ) {
+                       /* translators: %s: plugin slug */
+                       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' ),
+                               '<code>' . $this->plugin_slug . '</code>'
+                       );
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ! $this->plugin['Description'] ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $error = __( 'The plugin has no description.', 'wporg-plugins' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +178,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $plugin_post = Plugin_Directory::create_plugin_post( array(
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_title'   => $this->plugin['Name'],
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_name'    => $this->plugin_slug,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'post_status'  => 'draft',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'post_status'  => 'new',
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'post_content' => $content,
</span><span class="cx" style="display: block; padding: 0 10px">                                'post_excerpt' => $this->plugin['Description'],
</span><span class="cx" style="display: block; padding: 0 10px">                        //      'tax_input'    => wp_unslash( $_POST['tax_input'] ), // for category selection
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,6 +212,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'active_installs'          => 0,
</span><span class="cx" style="display: block; padding: 0 10px">                                        'usage'                    => array(),
</span><span class="cx" style="display: block; padding: 0 10px">                                        '_author_ip'               => preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        '_submitted_date'          => time(),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 ),
</span><span class="cx" style="display: block; padding: 0 10px">                        ) );
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( is_wp_error( $plugin_post ) ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryshortcodesclassuploadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php     2017-04-11 06:32:33 UTC (rev 5317)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php       2017-04-11 06:37:04 UTC (rev 5318)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,20 +31,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                <div class="plugin-queue-message notice notice-info notice-alt">
</span><span class="cx" style="display: block; padding: 0 10px">                                        <p>
</span><span class="cx" style="display: block; padding: 0 10px">                                                <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                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' ),
-                                                       '<strong>' . ( $plugins->draft + $plugins->pending ) . '</strong>',
-                                                       '<strong>' . $plugins->draft . '</strong>'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         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' ),
+                                                       '<strong>' . ( $plugins->new + $plugins->pending ) . '</strong>',
+                                                       '<strong>' . $plugins->new . '</strong>'
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 );
</span><span class="cx" style="display: block; padding: 0 10px">                                                ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                        </p>
</span><span class="cx" style="display: block; padding: 0 10px">                                </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <?php
-                               if ( '/plugins-wp' === parse_url( home_url(), PHP_URL_PATH ) ) {
-                                       echo '<div class="notice notice-error notice-alt">
-                                               <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>
-                                       </div>';
-                               }
-                               ?>
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>