<!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>[2621] sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory: Plugins Directory: Formatting update.</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/2621">2621</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/2621","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>obenland</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-02-25 22:49:24 +0000 (Thu, 25 Feb 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'>Plugins Directory: Formatting update.
* Updates phpdocs throughout the plugin.
* Breaks out classes into their own files.
* Some minor namespace-related tweaks.
See <a href="http://meta.trac.wordpress.org/ticket/1584">#1584</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclasscommittersphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclassautoloaderphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-autoloader.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_htmlwpcontentpluginsplugindirectoryclassplugingeopatternphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern.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_htmlwpcontentpluginsplugindirectoryclasstoolsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryplugindirectoryphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/plugin-directory.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryreadmeparserReadmeParserphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme-parser/ReadmeParser.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryreadmeparsercompatphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme-parser/compat.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryshortcodesclassscreenshotsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-screenshots.php</a></li>
</ul>
<h3>Added 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_htmlwpcontentpluginsplugindirectoryclassplugingeopatternsvgphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svg.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclassplugingeopatternsvgtextphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svgtext.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclassadmincustomizationsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-admin-customizations.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclassadmincustomizationsphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-admin-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-admin-customizations.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-admin-customizations.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,34 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-namespace WordPressdotorg\Plugin_Directory\Admin;
-
-/**
- * All functionality related to the Administration interface.
- *
- * @package WordPressdotorg_Plugin_Directory
- */
-class Admin_Customizations {
- /**
- * Fetch the instance of the Plugin_Directory class.
- */
- public static function instance() {
- static $instance = null;
- return ! is_null( $instance ) ? $instance : $instance = new Admin_Customizations();
- }
-
- private function __construct() {
- add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ) );
- }
-
- /**
- * Register the Admin metaboxes for the plugin management screens.
- */
- public function register_admin_metaboxes() {
- add_meta_box(
- 'plugin-committers',
- __( 'Plugin Committers', 'wporg-plugins' ),
- array( __NAMESPACE__ . '\\Metabox\\Committers', 'display' ),
- 'plugin'
- );
- }
-
-}
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclasscustomizationsphpfromrev2612sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminclassadmincustomizationsphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php (from rev 2612, sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-admin-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 (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,38 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory\Admin;
+
+/**
+ * All functionality related to the Administration interface.
+ *
+ * @package WordPressdotorg\Plugin_Directory\Admin
+ */
+class Customizations {
+
+ /**
+ * Fetch the instance of the Plugin_Directory class.
+ */
+ public static function instance() {
+ static $instance = null;
+
+ return ! is_null( $instance ) ? $instance : $instance = new Customizations();
+ }
+
+ /**
+ *
+ */
+ private function __construct() {
+ add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ) );
+ }
+
+ /**
+ * Register the Admin metaboxes for the plugin management screens.
+ */
+ public function register_admin_metaboxes() {
+ add_meta_box(
+ 'plugin-committers',
+ __( 'Plugin Committers', 'wporg-plugins' ),
+ array( __NAMESPACE__ . '\\Metabox\\Committers', 'display' ),
+ 'plugin'
+ );
+ }
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryadminmetaboxclasscommittersphp"></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-committers.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-committers.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,17 +1,24 @@
</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\Metabox;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> use WordPressdotorg\Plugin_Directory\Tools;
</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"> * The Plugin Committers admin metabox.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory\Admin\Metabox
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Committers {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ *
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> static function display() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugin_slug = get_post()->post_name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugin_slug = get_post()->post_name;
</ins><span class="cx" style="display: block; padding: 0 10px"> $existing_committers = Tools::get_plugin_committers( $plugin_slug );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $existing_committers = array_map( function( $user ) { return new \WP_User( $user ); }, $existing_committers );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $existing_committers = array_map( function ( $user ) {
+ return new \WP_User( $user );
+ }, $existing_committers );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $existing_committers as $committer ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclassautoloaderphp"></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-autoloader.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-autoloader.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-autoloader.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * An Autoloader which respects WordPress's filename standards.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory\Autoloader
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Autoloader {
</span><span class="cx" style="display: block; padding: 0 10px"> const NS_SEPARATOR = '\\';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,7 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Strip prefix from the start (ala PSR-4)
</span><span class="cx" style="display: block; padding: 0 10px"> $class = substr( $class, $this->prefix_length + 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $class = strtolower( $class );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $file = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $file = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== ( $last_ns_pos = strripos( $class, self::NS_SEPARATOR ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $namespace = substr( $class, 0, $last_ns_pos );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,7 +42,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require $path;
</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">-
</del><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 register_class_path( $prefix, $path ) {
</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-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The main Plugin Directory class, it handles most of the bootstrap and basic operations of the plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Plugin_Directory {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,9 +13,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function instance( $plugin_file = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> static $instance = null;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return ! is_null( $instance ) ? $instance : $instance = new Plugin_Directory( $plugin_file );
</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">+ /**
+ * @param string $plugin_file
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> private function __construct( $plugin_file ) {
</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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,8 +28,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', array( $this, 'use_plugins_in_query' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_content', array( $this, 'filter_post_content_to_correct_page' ), 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Load all Admin-specific items
- add_action( 'admin_init', array( __NAMESPACE__ . '\\Admin\\Admin_Customizations', 'instance' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Load all Admin-specific items.
+ add_action( 'admin_init', array( __NAMESPACE__ . '\\Admin\\Customizations', 'instance' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_activation_hook( $plugin_file, array( $this, 'activate' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> register_deactivation_hook( $plugin_file, array( $this, 'deactivate' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +98,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // When this plugin is used in the context of a Rosetta site, handle it gracefully
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'wordpress.org' != $_SERVER['HTTP_HOST'] && defined( 'WPORG_PLUGIN_DIRECTORY_BLOGID' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->add_rosetta_network_filters();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'option_home', array( $this, 'rosetta_network_localize_url' ) );
+ add_filter( 'option_siteurl', array( $this, 'rosetta_network_localize_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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,7 +113,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">- * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global \WP_Rewrite $wp_rewrite WordPress rewrite component.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function activate() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_rewrite;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,49 +155,48 @@
</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">+ * Filter the URLs to use the current localized domain name, rather than WordPress.org.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The Plugin Directory is available at multiple URLs (internationalised domains), this method allows
</span><span class="cx" style="display: block; padding: 0 10px"> * for the one blog (a single blog_id) to be presented at multiple URLs yet have correct localised links.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * This method works in conjunction with a filter in sunrise.php, duplicated here for transparency:
+ *
+ * // Make the Plugin Directory available at /plugins/ on all rosetta sites.
+ * function wporg_plugins_on_rosetta_domains( $site, $domain, $path, $segments ) {
+ * // All non-rosetta networks define DOMAIN_CURRENT_SITE in wp-config.php
+ * if ( ! defined( 'DOMAIN_CURRENT_SITE' ) && 'wordpress.org' != $domain && '/plugins/' == substr( $path . '/', 0, 9 ) ) {
+ * $site = get_blog_details( WPORG_PLUGIN_DIRECTORY_BLOGID );
+ * if ( $site ) {
+ * $site = clone $site;
+ * // 6 = The Rosetta network, this causes the site to be loaded as part of the Rosetta network
+ * $site->site_id = 6;
+ * return $site;
+ * }
+ * }
+ *
+ * return $site;
+ * }
+ * add_filter( 'pre_get_site_by_path', 'wporg_plugins_on_rosetta_domains', 10, 4 );
+ *
+ * @param string $url The URL to be localized.
+ * @return string
</ins><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 add_rosetta_network_filters() {
- // Filter the URLs to use the current localised domain name, rather than WordPress.org.
- foreach ( array( 'option_home', 'option_siteurl' ) as $filter ) {
- add_filter( $filter, function( $url ) {
- static $localized_url = null;
- if ( is_null( $localized_url ) ) {
- $localized_url = 'https://' . preg_replace( '![^a-z.-]+!', '', $_SERVER['HTTP_HOST'] );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function rosetta_network_localize_url( $url ) {
+ static $localized_url = null;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return preg_replace( '!^[https]+://wordpress\.org!i', $localized_url, $url );
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_null( $localized_url ) ) {
+ $localized_url = 'https://' . preg_replace( '![^a-z.-]+!', '', $_SERVER['HTTP_HOST'] );
</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">- /*
- // This method works in conjuction with a filter in sunrise.php, duplicated here for transparency:
-
- // Make the Plugin Directory available at /plugins/ on all rosetta sites.
- function wporg_plugins_on_rosetta_domains( $site, $domain, $path, $segments ) {
- // All non-rosetta networks define DOMAIN_CURRENT_SITE in wp-config.php
- if ( ! defined( 'DOMAIN_CURRENT_SITE' ) && 'wordpress.org' != $domain && '/plugins/' == substr( $path . '/', 0, 9 ) ) {
- $site = get_blog_details( WPORG_PLUGIN_DIRECTORY_BLOGID );
- if ( $site ) {
- $site = clone $site;
- // 6 = The Rosetta network, this causes the site to be loaded as part of the Rosetta network
- $site->site_id = 6;
- return $site;
- }
- }
-
- return $site;
- }
- add_filter( 'pre_get_site_by_path', 'wporg_plugins_on_rosetta_domains', 10, 4 );
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return preg_replace( '!^[https]+://wordpress\.org!i', $localized_url, $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><span class="cx" style="display: block; padding: 0 10px"> * Filter the permalink for the Plugins to be /plugin-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">- * @param string $link The generated permalink.
- * @param WP_Post $post The Plugin post object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $link The generated permalink.
+ * @param \WP_Post $post The Plugin post object.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function package_link( $link, $post ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,18 +211,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Checks if the current users is a super admin before allowing terms to be added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $term The term to add or update.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|WP_Error The term to add or update or WP_Error on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|\WP_Error The term to add or update or WP_Error on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function pre_insert_term_prevent( $term ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_super_admin() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $term = new WP_Error( 'not-allowed', __( 'You are not allowed to add terms.', 'wporg-plugins' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $term = new \WP_Error( 'not-allowed', __( 'You are not allowed to add terms.', 'wporg-plugins' ) );
</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"> return $term;
</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">- * @param WP_Query $wp_query The WordPress Query object.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param \WP_Query $wp_query The WordPress Query object.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function use_plugins_in_query( $wp_query ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wp_query->is_main_query() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function split_post_content_into_pages( $content ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_pages = preg_split( "#<!--section=(.+?)-->#", $content, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_pages = preg_split( "#<!--section=(.+?)-->#", $content, - 1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
</ins><span class="cx" style="display: block; padding: 0 10px"> $content_pages = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'screenshots' => '[wporg-plugins-screenshots]',
</span><span class="cx" style="display: block; padding: 0 10px"> 'stats' => '[wporg-plugins-stats]',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,11 +321,11 @@
</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">- * Retrieve the WP_Post object representing a given plugin.
- *
- * @param $plugin_slug string|WP_Post The slug of the plugin to retrieve.
- * @return WP_Post|WP_Error
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Retrieve the WP_Post object representing a given plugin.
+ *
+ * @param $plugin_slug string|\WP_Post The slug of the plugin to retrieve.
+ * @return \WP_Post|\WP_Error
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_plugin_post( $plugin_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $plugin_slug instanceof \WP_Post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $plugin_slug;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,30 +335,29 @@
</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' => 'any'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_status' => 'any',
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $posts ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- $plugin = reset( $posts );
- return $plugin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return reset( $posts );
</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">- * Create a new post entry for a given plugin slug.
- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Create a new post entry for a given plugin slug.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $plugin_info {
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of initial plugin post data, all fields are optional.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type string $title The title of the plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $slug The slug of the plugin.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $status The status of the plugin ( 'publish', 'pending', 'disabled', 'closed' ).
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $author The ID of the plugin author.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $description The short description of the plugin.
</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 WP_Post|WP_Error
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return \WP_Post|\WP_Error
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function create_plugin_post( array $plugin_info ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = !empty( $plugin_info['title'] ) ? $plugin_info['title'] : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $slug = !empty( $plugin_info['slug'] ) ? $plugin_info['slug'] : sanitize_title( $title );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -376,7 +379,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $id;
</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">- $plugin = get_post( $id );
- return $plugin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return get_post( $id );
</ins><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_htmlwpcontentpluginsplugindirectoryclassplugingeopatternsvgphp"></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/class-plugin-geopattern-svg.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-geopattern-svg.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svg.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,76 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory;
+
+/**
+ * The base SVG class does not provide functions for getting dimensions, so..
+ *
+ * @package WordPressdotorg\Plugin_Directory
+ */
+class Plugin_Geopattern_SVG extends \RedeyeVentures\GeoPattern\SVG {
+
+ /**
+ * @var string
+ */
+ protected $viewbox;
+
+ /**
+ * @return int
+ */
+ function getWidth() {
+ return $this->width;
+ }
+
+ /**
+ * @return int
+ */
+ function getHeight() {
+ return $this->height;
+ }
+
+ /**
+ * @return string
+ */
+ protected function getSvgHeader() {
+ if ( $this->viewbox ) {
+ return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{$this->width}\" height=\"{$this->height}\" viewbox=\"{$this->viewbox}\" preserveAspectRatio=\"none\">";
+ } else {
+ return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{$this->width}\" height=\"{$this->height}\">";
+ }
+ }
+
+ /**
+ * @param $text
+ * @param $x
+ * @param $y
+ * @param $text_anchor
+ * @param $style
+ * @param array $args
+ *
+ * @return $this
+ */
+ public function addText( $text, $x, $y, $text_anchor, $style, $args = array() ) {
+ $element = new Plugin_Geopattern_SVGText( $text, $x, $y, $text_anchor, $style, $args );
+ $this->svgString .= $element;
+
+ return $this;
+ }
+
+ /**
+ * @param $svg
+ */
+ public function addNested( $svg ) {
+ if ( method_exists( $svg, 'getString' ) ) {
+ $this->svgString .= $svg->getString();
+ }
+ }
+
+ /**
+ * @param $x
+ * @param $y
+ * @param $w
+ * @param $h
+ */
+ public function setViewBox( $x, $y, $w, $h ) {
+ $this->viewbox = esc_attr( "$x $y $w $h" );
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svg.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_htmlwpcontentpluginsplugindirectoryclassplugingeopatternsvgtextphp"></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/class-plugin-geopattern-svgtext.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-geopattern-svgtext.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svgtext.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,46 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Plugin_Directory;
+
+/**
+ * Nor does it support text.
+ *
+ * @package WordPressdotorg\Plugin_Directory
+ */
+class Plugin_Geopattern_SVGText extends \RedeyeVentures\GeoPattern\SVGElements\Base {
+
+ /**
+ * @var string
+ */
+ protected $tag = 'text';
+
+ /**
+ * @var string
+ */
+ protected $text;
+
+ /**
+ * @param $text
+ * @param $x
+ * @param $y
+ * @param $text_anchor
+ * @param $style
+ * @param array $args
+ */
+ function __construct( $text, $x, $y, $text_anchor, $style, $args = array() ) {
+ $this->elements = array(
+ 'x' => $x,
+ 'y' => $y,
+ 'text-anchor' => $text_anchor,
+ 'style' => $style,
+ );
+ $this->text = esc_html( $text );
+ parent::__construct( $args );
+ }
+
+ /**
+ * @return string
+ */
+ public function getString() {
+ return "<{$this->tag}{$this->elementsToString()}{$this->argsToString()}>{$this->text}</{$this->tag}>";
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern-svgtext.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_htmlwpcontentpluginsplugindirectoryclassplugingeopatternphp"></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-geopattern.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-geopattern.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,48 +6,86 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Generates Geopattern icons for 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">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Plugin_Geopattern extends \RedeyeVentures\GeoPattern\GeoPattern {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var $slug; // Hashed to generate pattern
- var $text; // Text to be overlaid
- var $textcolor = 'black';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Hashed to generate pattern.
+ *
+ * @var string
+ */
+ public $slug;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function __construct($options=array()) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Text to be overlaid.
+ *
+ * @var string
+ */
+ public $text;
+
+ /**
+ * @var string
+ */
+ public $textcolor = 'black';
+
+ /**
+ * @param array $options
+ */
+ function __construct( $options = array() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> parent::__construct( $options );
</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 ( isset( $options['text'] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $options['text'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->text = $options['text'];
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $options['textcolor'] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $options['textcolor'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->textcolor = $options['textcolor'];
</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"> // Replace the base SVG object with our own, so the dimensions are gettable.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->svg = new Plugin_Geopattern_SVG();
</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">+ /**
+ * @param $text
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function setText( $text ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->text = $text;
</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">+ /**
+ * @param $color
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function setTextColor( $color ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->textcolor = $color;
</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">+ /**
+ *
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function generateText() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $size = min( $this->svg->getHeight(), $this->svg->getWidth() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $size = min( $this->svg->getHeight(), $this->svg->getWidth() );
</ins><span class="cx" style="display: block; padding: 0 10px"> $text_height = floor( $size * 0.8 ) . 'px';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->svg->addText( $this->text, '50%', $text_height, 'middle', "font-family: Times New Roman, serif; font-size: {$text_height}; font-weight: normal; fill: {$this->textcolor};" );
</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">+ /**
+ * @param int $width
+ * @param int $height
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function toSVG( $width = 128, $height = 128 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->svg = new Plugin_Geopattern_SVG();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->generateBackground();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Work around a bug in 1.1.0: the hash-based pattern selection doesn't account for the size of the pattern array and can choose a null result.
- $this->setGenerator( $this->patterns[$this->hexVal(20, 1) % count( $this->patterns )] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Work around a bug in 1.1.0:
+ * The hash-based pattern selection doesn't account for the size of the
+ * pattern array and can choose a null result.
+ */
+ $this->setGenerator( $this->patterns[ $this->hexVal( 20, 1 ) % count( $this->patterns ) ] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->generatePattern();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,8 +96,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->text ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $inner = $this->svg;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Outer SVG, containing the text and nested inner SVG.
- // Needed because of aspect ratio problems with the background pattern. The outer is square, inner may be a different shape.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Outer SVG, containing the text and nested inner SVG.
+ *
+ * Needed because of aspect ratio problems with the background pattern.
+ * The outer is square, inner may be a different shape.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->svg = new PluginSVG();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->svg->setWidth( $width );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->svg->setHeight( $height );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,66 +110,5 @@
</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"> return $this->svg->getString();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- }
-
-}
-
-// The base SVG class doesn't provide functions for getting dimensions, so..
-class Plugin_Geopattern_SVG extends \RedeyeVentures\GeoPattern\SVG {
-
- protected $viewbox;
-
- function getWidth() {
- return $this->width;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- function getHeight() {
- return $this->height;
- }
-
- protected function getSvgHeader() {
- if ( $this->viewbox )
- return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{$this->width}\" height=\"{$this->height}\" viewbox=\"{$this->viewbox}\" preserveAspectRatio=\"none\">";
- else
- return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"{$this->width}\" height=\"{$this->height}\">";
- }
-
- public function addText( $text, $x, $y, $text_anchor, $style, $args=array() ) {
- $element = new Plugin_Geopattern_SVGText($text, $x, $y, $text_anchor, $style, $args);
- $this->svgString .= $element;
- return $this;
- }
-
- public function addNested( $svg ) {
- if ( method_exists( $svg, 'getString' ) )
- $this->svgString .= $svg->getString();
- }
-
- public function setViewBox( $x, $y, $w, $h ) {
- $this->viewbox = esc_attr( "$x $y $w $h" );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-// Nor does it support text.
-class Plugin_Geopattern_SVGText extends \RedeyeVentures\GeoPattern\SVGElements\Base {
- protected $tag = 'text';
- protected $text;
-
- function __construct($text, $x, $y, $text_anchor, $style, $args=array()) {
- $this->elements = array(
- 'x' => $x,
- 'y' => $y,
- 'text-anchor' => $text_anchor,
- 'style' => $style,
- );
- $this->text = esc_html( $text );
- parent::__construct($args);
- }
-
- public function getString() {
- return "<{$this->tag}{$this->elementsToString()}{$this->argsToString()}>{$this->text}</{$this->tag}>";
- }
-}
-
</del></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-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Various helpers to retrieve data not stored within WordPress.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,8 +52,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function get_plugin_sections() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugin = get_post();
- $plugin_slug = $plugin->post_name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugin = get_post();
+ $plugin_slug = $plugin->post_name;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $default_sections = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'description',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,9 +70,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_sections = get_post_meta( $plugin->ID, 'sections', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_sections = array_unique( array_merge( $raw_sections, $default_sections ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sections = array();
- $title = '';
- $permalink = get_permalink();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sections = array();
+ $title = $url = '';
+ $permalink = get_permalink();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $raw_sections as $section_slug ) {
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $section_slug ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +144,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the Plugin Icon details for a plugin.
</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|string $plugin An instance of a Plugin post, or the plugin slug.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param \WP_Post|string $plugin An instance of a Plugin post, or the plugin slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function get_plugin_icon( $plugin, $output = 'raw' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,11 +162,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> case '256x256':
</span><span class="cx" style="display: block; padding: 0 10px"> $icon_2x = self::get_asset_url( $plugin_slug, $info );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> case '128x128':
</span><span class="cx" style="display: block; padding: 0 10px"> $icon = self::get_asset_url( $plugin_slug, $info );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> case false && 'icon.svg' == $file:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $icon = self::get_asset_url( $plugin_slug, $info );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $icon = self::get_asset_url( $plugin_slug, $info );
</ins><span class="cx" style="display: block; padding: 0 10px"> $vector = true;
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,7 +192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $output ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'html':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $id = "plugin-icon-{$plugin_slug}";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $id = "plugin-icon-{$plugin_slug}";
</ins><span class="cx" style="display: block; padding: 0 10px"> $html = "<style type='text/css'>";
</span><span class="cx" style="display: block; padding: 0 10px"> $html .= "#{$id} { width:128px; height:128px; background-image: url('{$icon}'); background-size:128px 128px; }";
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $icon_2x ) && ! $generated ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,6 +203,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'raw':
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> return compact( 'icon', 'icon_2x', 'vector', 'generated' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,7 +213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the Plugin Icon details for a plugin.
</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|string $plugin An instance of a Plugin post, or the plugin slug.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param \WP_Post|string $plugin An instance of a Plugin post, or the plugin slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function get_plugin_banner( $plugin, $output = 'raw' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,6 +231,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> case '1544x500':
</span><span class="cx" style="display: block; padding: 0 10px"> $banner_2x = self::get_asset_url( $plugin_slug, $info );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> case '772x250':
</span><span class="cx" style="display: block; padding: 0 10px"> $banner = self::get_asset_url( $plugin_slug, $info );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -245,6 +249,11 @@
</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">+ /**
+ * @param $plugin
+ * @param $asset
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> static function get_asset_url( $plugin, $asset ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $asset['location'] ) && 'plugin' == $asset['location'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Screenshots in the plugin folder - /plugins/plugin-name/screenshot-1.png
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryclasstoolsphp"></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-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/class-tools.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,7 +4,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Various functions used by other processes, will make sense to move to specific 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">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Tools {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,6 +53,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"> $tonesque = new \Tonesque( $file_location );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $tonesque->color();
</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">@@ -71,11 +72,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Grant a user RW access to a plugin.
</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 string $plugin_slug The plugin slug.
- * @param string|WP_User $user The user to grant access to.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $plugin_slug The plugin slug.
+ * @param string|\WP_User $user The user to grant access to.
+ * @return bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function grant_plugin_committer( $plugin_slug, $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $user instanceof \WP_User ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new \WP_User( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,7 +93,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- return (bool)$wpdb->insert(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (bool) $wpdb->insert(
</ins><span class="cx" style="display: block; padding: 0 10px"> PLUGINS_TABLE_PREFIX . 'svn_access',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'path' => "/{$plugin_slug}",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,11 +106,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Revoke a users RW access to a plugin.
</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 string $plugin_slug The plugin slug.
- * @param string|WP_User $user The user to revoke access of.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $plugin_slug The plugin slug.
+ * @param string|\WP_User $user The user to revoke access of.
+ * @return bool
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function revoke_plugin_committer( $plugin_slug, $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $user instanceof \WP_User ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new \WP_User( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,11 +124,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $wpdb->delete(
</span><span class="cx" style="display: block; padding: 0 10px"> PLUGINS_TABLE_PREFIX . 'svn_access',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'path' => "/{$plugin_slug}",
- 'user' => $user->user_login
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'path' => "/{$plugin_slug}",
+ 'user' => $user->user_login,
</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">-
-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryplugindirectoryphp"></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/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/plugin-directory.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/plugin-directory.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,4 @@
</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">-namespace WordPressdotorg\Plugin_Directory;
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Plugin Name: Plugin Directory
</span><span class="cx" style="display: block; padding: 0 10px"> * Plugin URI: http://wordpress.org/plugins/
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +13,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package WordPressdotorg_Plugin_Directory
</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">+namespace WordPressdotorg\Plugin_Directory;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Register an Autoloader for all files
</span><span class="cx" style="display: block; padding: 0 10px"> include __DIR__ . '/class-autoloader.php';
</span><span class="cx" style="display: block; padding: 0 10px"> Autoloader\register_class_path( __NAMESPACE__, __DIR__ );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryreadmeparserReadmeParserphp"></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/readme-parser/ReadmeParser.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/readme-parser/ReadmeParser.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme-parser/ReadmeParser.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $text = str_replace( '&', '&', $text );
</span><span class="cx" style="display: block; padding: 0 10px"> $text = str_replace( ''', "'", $text );
</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 ( '<pre><code>' == $matches[1] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '<pre><code>' == $matches[1] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $text = "\n$text\n";
</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_htmlwpcontentpluginsplugindirectoryreadmeparsercompatphp"></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/readme-parser/compat.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/readme-parser/compat.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme-parser/compat.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</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">- $result = parent::parse_readme_contents( $contents );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $result = parent::parse_readme_contents( $contents );
</ins><span class="cx" style="display: block; padding: 0 10px"> $result->sections = array_map( array( 'WPorg_Readme', 'filter_text' ), $result->sections );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $result->upgrade_notice ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,14 +72,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</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 string $desc
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $description
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected static function trim_short_desc( &$desc ) {
- $desc = self::sanitize_text( $desc );
- parent::trim_short_desc( $desc );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected static function trim_short_desc( &$description ) {
+ $description = self::sanitize_text( $description );
+ parent::trim_short_desc( $description );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $desc;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $description;
</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_htmlwpcontentpluginsplugindirectoryshortcodesclassscreenshotsphp"></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-screenshots.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-screenshots.php 2016-02-25 21:43:32 UTC (rev 2620)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-screenshots.php 2016-02-25 22:49:24 UTC (rev 2621)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,50 +1,49 @@
</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\Shortcodes;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> use WordPressdotorg\Plugin_Directory\Template;
</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"> * The [wporg-plugins-screenshots] shortcode handler to display a plugins screenshots.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @package WordPressdotorg_Plugin_Directory
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @package WordPressdotorg\Plugin_Directory\Shortcodes
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class Screenshots {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> static function display() {
</span><span class="cx" style="display: block; padding: 0 10px"> $plugin = get_post();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // All indexed from 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // All indexed from 1.
</ins><span class="cx" style="display: block; padding: 0 10px"> $screenshot_descriptions = get_post_meta( $plugin->ID, 'screenshots', true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $assets_screenshots = get_post_meta( $plugin->ID, 'assets_screenshots', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $assets_screenshots = get_post_meta( $plugin->ID, 'assets_screenshots', true );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = '';
</del><span class="cx" style="display: block; padding: 0 10px"> foreach ( $screenshot_descriptions as $index => $description ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Find the image that corresponds with the text.
- // The image numbers are stored within the 'resolution' key.
- $found = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /*
+ * Find the image that corresponds with the text.
+ * The image numbers are stored within the 'resolution' key.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $assets_screenshots as $image ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $index == $image['resolution'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $found = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= sprintf(
+ '<li>
+ <a href="%1$s" rel="nofollow">
+ <img class="screenshot" src="%1$s">
+ </a>
+ <p>%2$s</p>
+ </li>',
+ Template::get_asset_url( $plugin->post_name, $image ),
+ $description
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</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 ( ! $found ) {
- continue;
- }
-
- $url = Template::get_asset_url( $plugin->post_name, $image );
-
- $output .= sprintf(
- '<li>
- <a href="%1$s" rel="nofollow">
- <img class="screenshot" src="%1$s">
- </a>
- <p>%2$s</p>
- </li>',
- $url,
- $description
- );
</del><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"> return '<ol class="screenshots">' . $output . '</ol>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>