<!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>[3009] sites/trunk/wordpress.org/public_html/wp-content: Plugin Directory: Add a Review Widget to the theme, and all the other required things for Widgets.</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/3009">3009</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/3009","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>2016-04-26 07:33:28 +0000 (Tue, 26 Apr 2016)</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: Add a Review Widget to the theme, and all the other required things for Widgets.
This adds a namespace to the theme and begins to reduce the duplication of template functionality between wp-admin and the theme.

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

<h3>Modified Paths</h3>
<ul>
<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_htmlwpcontentpluginsplugindirectoryclassplugindirectoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclasstemplatephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfilterbarphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/filter-bar.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfooterphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/footer.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsheaderphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/header.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginspagephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/page.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsplugincardphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/plugin-card.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginssinglepluginphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/single-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsstylecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/style.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginstemplatetagsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-tags.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsviewintrophp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/view-intro.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorywidgetsclassmetadataphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-metadata.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorywidgetsclassratingsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-ratings.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<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 2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php   2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> namespace WordPressdotorg\Plugin_Directory\Admin\List_Table;
</span><span class="cx" style="display: block; padding: 0 10px"> use \WordPressdotorg\Plugin_Directory\Tools;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+use \WordPressdotorg\Plugin_Directory\Template;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> _get_list_table( 'WP_Posts_List_Table' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,9 +159,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param \WP_Post $post The current WP_Post object.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function column_rating( $post ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( function_exists( 'wporg_get_dashicons_stars' ) ) {
-                       echo wporg_get_dashicons_stars( get_post_meta( $post->ID, 'rating', true ) );
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         echo Template::dashicons_stars( get_post_meta( $post->ID, 'rating', true ) );
</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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,14 +168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param \WP_Post $post The current WP_Post object.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function column_installs( $post ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $active_installs = get_post_meta( $post->ID, 'active_installs', true );
-               if ( $active_installs >= 1000000 ) {
-                       _e( '1+ million', 'wporg-plugins' );
-               } elseif ( $active_installs <= 10 ) {
-                       _e( 'Less than 10', 'wporg-plugins' );
-               } else {
-                       printf( "%s+", number_format_i18n( $active_installs ) );
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         echo Template::active_installs( false, $post );
</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_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      2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php        2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,6 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        private function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'init', array( $this, 'init' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'init', array( $this, 'register_shortcodes' ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                add_action( 'widgets_init', array( $this, 'register_widgets' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 add_filter( 'post_type_link', array( $this, 'package_link' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'pre_insert_term', array( $this, 'pre_insert_term_prevent' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'pre_get_posts', array( $this, 'use_plugins_in_query' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'map_meta_cap', array( __NAMESPACE__ . '\Capabilities', 'map_meta_cap' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Shim in postmeta support for data which doesn't yet live in postmeta
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_filter( 'get_post_metadata', array( $this, 'filter_shim_postmeta' ), 10, 4 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add_filter( 'get_post_metadata', array( $this, 'filter_shim_postmeta' ), 10, 3 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Load the API routes
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'rest_api_init', array( __NAMESPACE__ . '\API\Base', 'load_routes' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -195,6 +196,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        //      add_shortcode( 'wporg-plugins-developer',   array( __NAMESPACE__ . '\Shortcodes\Developer',   'display' ) );
</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">+        public function register_widgets() {
+               register_widget( __NAMESPACE__ . '\Widgets\Metadata' );
+               register_widget( __NAMESPACE__ . '\Widgets\Ratings' );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Upon plugin activation, set up the current site for acting
</span><span class="cx" style="display: block; padding: 0 10px">         * as the plugin directory.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,15 +428,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *                                     or an array of values.
</span><span class="cx" style="display: block; padding: 0 10px">         * @param int               $object_id Object ID.
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string            $meta_key  Meta key.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @param bool              $single    Whether to return only the first value of the specified $meta_key.
</del><span class="cx" style="display: block; padding: 0 10px">          */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public function filter_shim_postmeta( $value, $object_id, $meta_key, $single ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function filter_shim_postmeta( $value, $object_id, $meta_key ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 switch ( $meta_key ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'downloads':
</span><span class="cx" style="display: block; padding: 0 10px">                                $post = get_post( $object_id );
</span><span class="cx" style="display: block; padding: 0 10px">                                $count = Template::get_downloads_count( $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">-                                return $single ? $count : array( $count );                              
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         return array( $count );                         
</ins><span class="cx" style="display: block; padding: 0 10px">                                 break;
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'rating':
</span><span class="cx" style="display: block; padding: 0 10px">                                $post = get_post( $object_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,8 +445,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                                $rating = wporg_get_rating_avg( 'plugin', $post->post_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">-                                return $single ? $rating : array( $rating );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         return array( $rating );
</ins><span class="cx" style="display: block; padding: 0 10px">                                 break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        case 'ratings':
+                               $post = get_post( $object_id );
+                               if ( ! function_exists( 'wporg_get_rating_counts' ) ) {
+                                       break;
+                               }
+                               $ratings = wporg_get_rating_counts( 'plugin', $post->post_name );
+
+                               return array( $ratings );
+                               break;
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">                return $value;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclasstemplatephp"></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-template.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-template.php      2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php        2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,15 +9,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> class Template {
</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">-         * @param \WP_Post|int $post Optional.
-        * @return int
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * Returns a string representing the number of active installs for an item.
+        *
+        * @param bool $full whether to include "actuve installs" suffix. Default: true.
+        * @return string "1+ million" or "1+ milllion active installs" depending on $full.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        static function get_active_installs_count( $post = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static function active_installs( $full = true, $post = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $post = get_post( $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">-                return (int) get_post_meta( $post->ID, 'active_installs', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $count = get_post_meta( $post->ID, 'active_installs', true );
+       
+               if ( $count <= 10 ) {
+                       $text = __( 'Less than 10', 'wporg-plugins' );
+               } elseif ( $count >= 1000000 ) {
+                       $text = __( '1+ million', 'wporg-plugins' );
+               } else {
+                       $text = number_format_i18n( $count ) . '+';
+               }
+               return $full ? sprintf( __( '%s active installs', 'wporg-plugins' ), $text ) : $text;
</ins><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">+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * @param \WP_Post|int $post Optional.
</span><span class="cx" style="display: block; padding: 0 10px">         * @return int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -275,4 +287,50 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $asset['revision']
</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">+
+       /**
+        * A helper method to create dashicon stars.
+        *
+        * @type int|array {
+        *    If numeric arg passed, assumed to be 'rating'.
+        *
+        *    @type int    $rating   The rating to display.
+        *    @type string $template The HTML template to use for each star.
+        *                           %1$s is the class, %2$s is the rating.
+        * }
+        * @return string The Rating HTML.
+        */
+       static function dashicons_stars( $args = array() ) {
+               $defaults = array(
+                       'rating' => 0,
+                       'template' => '<span class="%1$s"></span>'
+               );
+               $r = wp_parse_args( ( is_numeric( $args ) ? array( 'rating' => $args ) : $args ), $defaults );
+
+               $rating = round( $r['rating'] / 0.5 ) * 0.5;
+               $template = $r['template'];
+               $title_template = __( '%s out of 5 stars', 'wporg-plugins' );
+               $title = sprintf( $title_template, $rating );
+
+               $output = '<div class="wporg-ratings" title="' . esc_attr( $title ) . '" data-title-template="' . esc_attr( $title_template ) . '" data-rating="' . esc_attr( $rating ) . '" style="color:#ffb900;">';
+               $counter = round( $rating * 2 );
+               for  ( $i = 1; $i <= 5; $i++ ) {
+                       switch ($counter) {
+                       case 0:
+                               $output .= sprintf( $template, 'dashicons dashicons-star-empty', $i );
+                               break;
+                       case 1:
+                               $output .= sprintf( $template, 'dashicons dashicons-star-half', $i );
+                               $counter--;
+                               break;
+                       default:
+                               $output .= sprintf( $template, 'dashicons dashicons-star-filled', $i );
+                               $counter -= 2;
+                               break;
+                       }
+               }
+               $output .= '</div>';
+               return $output;
+       }
+       
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorywidgetsclassmetadataphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-metadata.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/widgets/class-metadata.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-metadata.php        2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,40 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Widgets;
+use WordPressdotorg\Plugin_Directory\Template;
+use WordPressdotorg\Plugin_Directory\Theme;
+
+/**
+ * A Widget to display the basic metadata about a plugin.
+ *
+ * @package WordPressdotorg\Plugin_Directory\Widgets
+ */
+class Metadata extends \WP_Widget {
+
+       public function __construct() {
+               $widget_ops = array( 
+                       'classname' => 'plugin-metadata',
+                       'description' => 'Displays the basic metadata about a plugin.',
+               );
+               parent::__construct( 'plugin_metadata', 'Plugin Metadata', $widget_ops );
+       }
+
+       /**
+        * Outputs the content of the widget
+        *
+        * @param array $args
+        * @param array $instance
+        */
+       public function widget( $args, $instance ) {
+               echo $args['before_widget'];
+               ?>
+               <strong>Version:</strong> <?php echo Theme\wporg_plugins_the_version(); ?><br>
+               <strong>Requires:</strong> <?php printf( __('%s or higher', 'wporg-plugins' ), Theme\wporg_plugins_template_requires() ); ?><br>
+               <strong>Compatible up to:</strong> <?php echo Theme\wporg_plugins_template_compatible_up_to(); ?><br>
+               <strong>Last Updated: </strong> <?php echo Theme\wporg_plugins_template_last_updated(); ?><br>
+               <strong>Active Installs:</strong> <?php echo Template::active_installs( false ); ?><br>
+               <meta itemprop="dateModified" content="<?php the_time('Y-m-d'); ?>" />
+               <?php
+               echo $args['after_widget'];
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-metadata.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorywidgetsclassratingsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-ratings.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/widgets/class-ratings.php                               (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-ratings.php 2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,143 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Widgets;
+
+use WordPressdotorg\Plugin_Directory\Template;
+
+/**
+ * A Widget to display a plugins rating, and allow rating.
+ *
+ * @package WordPressdotorg\Plugin_Directory\Widgets
+ */
+class Ratings extends \WP_Widget {
+
+       public function __construct() {
+               $widget_ops = array( 
+                       'classname' => 'plugin-ratings',
+                       'description' => 'Displays the plugin ratings.',
+               );
+               parent::__construct( 'plugin_ratings', 'Plugin Ratings', $widget_ops );
+       }
+
+       /**
+        * Outputs the content of the widget
+        *
+        * @param array $args
+        * @param array $instance
+        */
+       public function widget( $args, $instance ) {
+               echo $args['before_widget'];
+
+               $post = get_post();
+
+               $rating = get_post_meta( $post->ID, 'rating', true );
+               $ratings = get_post_meta( $post->ID, 'ratings', true );
+               $num_ratings = array_sum( $ratings );
+
+               $user_rating = 0;
+               if ( is_user_logged_in() ) {
+                       $user_rating = wporg_get_user_rating( 'plugin', $post->post_name, get_current_user_id() );
+                       if ( ! $user_rating ) {
+                               $user_rating = 0;
+                       }
+               }
+
+               ?>
+
+               <meta itemprop="ratingCount" content="<?php echo esc_attr( $num_ratings ) ?>"/>
+               <h4><?php _e( 'Ratings', 'wporg-plugins' ); ?></h4>
+
+               <?php if ( $rating ) { ?>
+                       <div class="rating">
+                               <?php echo Template::dashicons_stars( $rating ); ?>
+                               <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-plugins' ), '<span itemprop="ratingValue">' . $rating . '</span>' ); ?></p>
+                       </div>
+               <?php } else { ?>
+                       <div class="rating">
+                               <div class="ratings"><?php _e( 'This plugin has not been rated yet.', 'wporg-plugins' ); ?></div>
+                       </div>
+               <?php } ?>
+
+               <?php if ( $ratings ) { ?>
+               <ul class="ratings-list">
+                       <?php foreach ( range( 5, 1 ) as $stars ) :
+                               $rating_bar_width = $num_ratings ? 100 * $ratings[$stars] / $num_ratings : 0;
+                       ?>
+                       <li class="counter-container">
+                               <a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $post->post_name; ?>?filter=<?php echo $stars; ?>" title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $stars, 'wporg-plugins' ), $stars ) ); ?>">
+                                       <span class="counter-label"><?php printf( _n( '%d star', '%d stars', $stars, 'wporg-plugin' ), $stars ); ?></span>
+                                       <span class="counter-back">
+                                               <span class="counter-bar" style="width: <?php echo $rating_bar_width; ?>%;"></span>
+                                       </span>
+                                       <span class="counter-count"><?php echo $ratings[$stars]; ?></span>
+                               </a>
+                       </li>
+                       <?php endforeach; ?>
+               </ul>
+               <?php
+               }
+
+               if ( is_user_logged_in() ) {
+                       echo '<div class="user-rating">';
+                       echo Template::dashicons_stars( array(
+                               'rating' => $user_rating,
+                               'template' => '<a class="%1$s" href="https://wordpress.org/support/view/plugin-reviews/' . $post->post_name . '?rate=%2$d#postform"></a>'
+                       ) );
+                       echo '</div>';
+                       ?>
+                       <script>
+                       jQuery(document).ready( function($) {
+                               var $rating = $( '.user-rating div' ),
+                                       $stars = $rating.find( '.dashicons' ),
+                                       current_rating = $rating.data('rating'),
+                                       rating_clear_timer = 0;
+
+                               $stars.mouseover( function() {
+                                       var $this = $(this),
+                                               $prev_items = $this.prevAll(),
+                                               $next_items = $this.nextAll(),
+                                               rating = $prev_items.length + 1;
+
+                                       if ( rating_clear_timer ) {
+                                               rating_clear_timer = clearTimeout( rating_clear_timer );
+                                       }
+
+                                       if ( rating == current_rating ) {
+                                               return;
+                                       }
+
+                                       $this.removeClass( 'dashicons-star-empty' ).addClass( 'dashicons-star-filled' );
+                                       $prev_items.removeClass( 'dashicons-star-empty' ).addClass( 'dashicons-star-filled' );
+                                       $next_items.removeClass( 'dashicons-star-filled' ).addClass( 'dashicons-star-empty' );
+
+                                       $rating.prop( 'title', $rating.data( 'title-template' ).replace( '%s', rating ).replace( '%d', rating ) );
+                                       current_rating = rating;
+                               } );
+                               $rating.mouseout( function() {
+                                       var clear_callback = function() {
+                                               var rating = $rating.data('rating');
+                                               if ( rating == current_rating ) {
+                                                       return;
+                                               }
+                                               if ( rating ) {
+                                                       $( $stars.get( rating-1 ) ).mouseover();
+                                               } else {
+                                                       $stars.removeClass( 'dashicons-star-filled' ).addClass( 'dashicons-star-empty' );
+                                               }
+                                       };
+
+                                       if ( ! rating_clear_timer ) {
+                                               rating_clear_timer = setTimeout( clear_callback, 2000 );
+                                       }
+                               } );
+                       } );
+                       </script>
+                       <?php
+                       
+                       echo '</div>';
+               }
+
+               echo $args['after_widget'];
+       }
+
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-ratings.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfilterbarphp"></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/themes/pub/wporg-plugins/filter-bar.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/themes/pub/wporg-plugins/filter-bar.php  2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/filter-bar.php    2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,3 +1,7 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Theme;
+
+?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="wrapper">
</span><span class="cx" style="display: block; padding: 0 10px">        <div class="col-12 filter-bar">
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="wp-filter">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfooterphp"></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/themes/pub/wporg-plugins/footer.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/themes/pub/wporg-plugins/footer.php      2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/footer.php        2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,10 +1,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * The template for displaying the footer.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @package wporg-plugins
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-?>
-</div>
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php require WPORGPATH . 'footer.php';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+echo '</div>';
+
+require WPORGPATH . 'footer.php';
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsfunctionsphp"></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/themes/pub/wporg-plugins/functions.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/themes/pub/wporg-plugins/functions.php   2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php     2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
</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">  * WP.org Themes' functions and definitions.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,11 +18,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
</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_sidebar( array(
+               'name'          => 'Single Plugin View Sidebar',
+               'id'            => 'single-plugin-sidebar',
+               'before_widget' => '<div id="%1$s" class="widget %2$s">',
+               'after_widget'  => '</div>',
+       ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px">         // No need for canonical lookups
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        //remove_action( 'template_redirect', 'redirect_canonical' );
-       remove_action( 'template_redirect', 'wp_old_slug_redirect' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ remove_action( 'template_redirect', __NAMESPACE__ . '\wp_old_slug_redirect' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'after_setup_theme', 'wporg_plugins_setup' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'after_setup_theme', __NAMESPACE__ . '\wporg_plugins_setup' );
</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">  * Enqueue scripts and styles.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,10 +51,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        // No Jetpack styles needed.
</span><span class="cx" style="display: block; padding: 0 10px">        add_filter( 'jetpack_implode_frontend_css', '__return_false' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'wp_enqueue_scripts', 'wporg_plugins_scripts' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\wporg_plugins_scripts' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_plugins_body_class( $classes ) {
</span><span class="cx" style="display: block; padding: 0 10px">        $classes[] = 'plugins-directory';
</span><span class="cx" style="display: block; padding: 0 10px">        return $classes;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_filter( 'body_class', 'wporg_plugins_body_class' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'body_class', __NAMESPACE__ . '\wporg_plugins_body_class' );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsheaderphp"></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/themes/pub/wporg-plugins/header.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/themes/pub/wporg-plugins/header.php      2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/header.php        2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * The header for our theme.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,4 +38,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div id="pagebody">
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<div id="pagebody">
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsindexphp"></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/themes/pub/wporg-plugins/index.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/themes/pub/wporg-plugins/index.php       2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/index.php 2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,9 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php get_header(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Theme;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_header();
+?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php get_template_part( 'filter-bar' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrapper">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginspagephp"></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/themes/pub/wporg-plugins/page.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/themes/pub/wporg-plugins/page.php        2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/page.php  2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,9 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php get_header(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Theme;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_header();
+?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php the_post(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <?php get_template_part( 'filter-bar' ); ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsplugincardphp"></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/themes/pub/wporg-plugins/plugin-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/themes/pub/wporg-plugins/plugin-card.php 2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/plugin-card.php   2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,3 +1,8 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Theme;
+use WordPressdotorg\Plugin_Directory\Template;
+
+?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="plugin-card">
</span><span class="cx" style="display: block; padding: 0 10px">         <div class="plugin-card-top">
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,3 +7,3 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 <a href="<?php the_permalink(); ?>" class="plugin-icon">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php echo WordPressdotorg\Plugin_Directory\Template::get_plugin_icon( $post->post_name, 'html' ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <?php echo Template::get_plugin_icon( $post->post_name, 'html' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                  </a>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,17 +20,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <div class="plugin-card-bottom">
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="vers column-rating">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php
-                               if ( function_exists( 'wporg_get_dashicons_stars' ) ) {
-                                       echo wporg_get_dashicons_stars( get_post_meta( $post->ID, 'rating', true ) );
-                               }
-                       ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <?php echo Template::dashicons_stars( get_post_meta( $post->ID, 'rating', true ) ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="column-updated">
</span><span class="cx" style="display: block; padding: 0 10px">                        <strong><?php _e( 'Last Updated:', 'wporg-plugins' ); ?></strong> <?php echo wporg_plugins_template_last_updated(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">                </div>
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="column-installs">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php echo worg_plugins_template_active_installs( true ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <?php echo Template::active_installs(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="column-compatibility">
</span><span class="cx" style="display: block; padding: 0 10px">                        <strong><?php _e( 'Compatible up to:', 'wporg-plugins' ); ?></strong> <?php echo wporg_plugins_template_compatible_up_to(); ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginssinglepluginphp"></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/themes/pub/wporg-plugins/single-plugin.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/themes/pub/wporg-plugins/single-plugin.php       2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/single-plugin.php 2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,7 +1,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
+use WordPressdotorg\Plugin_Directory\Template;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> the_post();
</span><span class="cx" style="display: block; padding: 0 10px"> get_header();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$plugin_banners = WordPressdotorg\Plugin_Directory\Template::get_plugin_banner( $post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$plugin_banners = Template::get_plugin_banner( $post );
</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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,7 +48,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        <div class="head head-big">
</span><span class="cx" style="display: block; padding: 0 10px">                                                <ul id="sections">
</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">-                                                        foreach ( WordPressdotorg\Plugin_Directory\Template::get_plugin_sections() as $section ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 foreach ( Template::get_plugin_sections() as $section ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                                 $current = ( $section['slug'] == get_query_var( 'content_page' ) || ( 'description' == $section['slug'] && ! get_query_var( 'content_page' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">                                                                printf(
</span><span class="cx" style="display: block; padding: 0 10px">                                                                        '<li class="%s"><a itemprop="url" href="%s">%s</a></li>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,14 +68,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        <div class="" style="width: 212px; float: right;">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <p>
-                                       <strong>Version:</strong> <?php echo wporg_plugins_the_version(); ?><br>
-                                       <strong>Requires:</strong> <?php printf( __('%s or higher', 'wporg-plugins' ), wporg_plugins_template_requires() ); ?><br>
-                                       <strong>Compatible up to:</strong> <?php echo wporg_plugins_template_compatible_up_to(); ?><br>
-                                       <strong>Last Updated: </strong> <?php echo wporg_plugins_template_last_updated(); ?><br>
-                                       <strong>Active Installs:</strong> <?php echo worg_plugins_template_active_installs( false ); ?><br>
-                                       <meta itemprop="dateModified" content="<?php the_time('Y-m-d'); ?>" />
-                               </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <?php dynamic_sidebar('single-plugin-sidebar'); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                         </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                </div>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsstylecss"></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/themes/pub/wporg-plugins/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/style.css       2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/style.css 2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1447,3 +1447,69 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .dots, .next, .prev {
</span><span class="cx" style="display: block; padding: 0 10px">        background-color: inherit;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+.widget {
+       margin-bottom: 1em;
+
+}
+
+/* Ratings */
+.widget.plugin-ratings {
+       margin: 0 0 1.5em;
+       min-height: 26px;
+}
+
+.rtl .dashicons-star-half:before {
+       -webkit-transform: rotateY(180deg);
+       -ms-transform: rotateY(180deg);
+       transform: rotateY(180deg);
+}
+
+.widget.plugin-ratings a.dashicons {
+       color: inherit;
+}
+
+.widget.plugin-ratings .description {
+       color: #aa9;
+       display: inline-block;
+       font-style: italic;
+       margin: 0 5px;
+       vertical-align: text-bottom;
+}
+.widget.plugin-ratings ul.ratings-list {
+       list-style-type: none;
+       padding: 0;
+       margin: 0 !important;
+}
+.widget.plugin-ratings .counter-container,
+.widget.plugin-ratings .counter-container a {
+       display: inline-block;
+       width: 100%;
+}
+.widget.plugin-ratings .counter-label,
+.widget.plugin-ratings .counter-count {
+       line-height: 1.75;
+}
+.widget.plugin-ratings .counter-label {
+       float: left;
+       margin-right: 5px;
+       min-width: 55px;
+}
+.widget.plugin-ratings .counter-back,
+.widget.plugin-ratings .counter-bar {
+       float: left;
+       height: 17px;
+}
+.widget.plugin-ratings .counter-back {
+       background-color: #ececec;
+       width: 64%;
+       width: -webkit-calc(100% - 88px);
+       width: calc(100% - 88px);
+}
+.widget.plugin-ratings .counter-bar {
+       background-color: #ffc733;
+}
+.widget.plugin-ratings .counter-count {
+       float: left;
+       margin-left: 5px;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginstemplatetagsphp"></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/themes/pub/wporg-plugins/template-tags.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/themes/pub/wporg-plugins/template-tags.php       2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-tags.php 2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
+use WordPressdotorg\Plugin_Directory\Template;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> // Various Template tags
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,23 +31,9 @@
</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"> function wporg_plugins_download_link() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $filename = sprintf( "%s.%s.zip", get_post()->post_name, wporg_plugins_the_version() );
-       return esc_url( "https://downloads.wordpress.org/plugin/{$filename}" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return esc_url( sprintf( "https://downloads.wordpress.org/plugin/%s.%s.zip", get_post()->post_name, wporg_plugins_the_version() ) );
</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">-function worg_plugins_template_active_installs( $full = true ) {
-       $count = WordPressdotorg\Plugin_Directory\Template::get_active_installs_count();
-
-       if ( $count <= 10 ) {
-               $text = __( 'Less than 10', 'wporg-plugins' );
-       } elseif ( $count >= 1000000 ) {
-               $text = __( '1+ million', 'wporg-plugins' );
-       } else {
-               $text = number_format_i18n( $count ) . '+';
-       }
-       return $full ? sprintf( __( '%s active installs', 'wporg-plugins' ), $text ) : $text;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> function wporg_plugins_template_authors() {
</span><span class="cx" style="display: block; padding: 0 10px">        $authors = get_post_meta( get_the_id(), 'contributors', true );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgpluginsviewintrophp"></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/themes/pub/wporg-plugins/view-intro.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/themes/pub/wporg-plugins/view-intro.php  2016-04-26 07:29:01 UTC (rev 3008)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/view-intro.php    2016-04-26 07:33:28 UTC (rev 3009)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,11 +1,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+namespace WordPressdotorg\Plugin_Directory\Theme;
+use WordPressdotorg\Plugin_Directory\Template;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_front_page() && ( ! get_query_var( 'browse' ) || 'featured' == get_query_var( 'browse' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                printf(
</span><span class="cx" style="display: block; padding: 0 10px">                        /* translators: 1: Plugins count 2: Download count */
</span><span class="cx" style="display: block; padding: 0 10px">                        '<p class="intro">' . __( 'Plugins extend and expand the functionality of WordPress. %1$s plugins with %2$s total downloads are at your fingertips.', 'wporg-plugins' ) . '</p>',
</span><span class="cx" style="display: block; padding: 0 10px">                        '<strong>' . number_format_i18n( wp_count_posts( 'plugin' )->publish ) . '</strong>',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        '<strong>' . number_format_i18n( WordPressdotorg\Plugin_Directory\Template::get_total_downloads() ) . '</strong>'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 '<strong>' . number_format_i18n( Template::get_total_downloads() ) . '</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"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,4 +18,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                __( 'Your favorite plugins are listed here. They also appear on <a href="%s">your profile</a>.', 'wporg-plugins' ),
</span><span class="cx" style="display: block; padding: 0 10px">                'https://profiles.wordpress.org/' . wp_get_current_user()->user_nicename
</span><span class="cx" style="display: block; padding: 0 10px">        ) . '</p>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins></span></pre>
</div>
</div>

</body>
</html>