<!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>[11371] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher: SVN Watcher: Some performance improvements for the admin view & reports.</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 { white-space: pre-line; 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/11371">11371</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/11371","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>2021-12-15 02:47:05 +0000 (Wed, 15 Dec 2021)</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'>SVN Watcher: Some performance improvements for the admin view & reports.
This reduces the queries by removing oEmbed processing of commit messages, caching users in bulk, avoiding PHP Notices, documenting some things, skipping the UI if revisions/props aren't imported for a SVN.
See <a href="http://meta.trac.wordpress.org/ticket/5978">#5978</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminlisttablephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/list-table.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminreportspagephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/reports-page.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminuiphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/ui.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchersvnphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/svn.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchertracwatchphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac-watch.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchertracphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminlisttablephp"></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/wporg-trac-watcher/admin/list-table.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/wporg-trac-watcher/admin/list-table.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/list-table.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,6 +125,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ORDER BY user_id IS NULL DESC, LENGTH(prop_name) DESC"
</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">+ // Fill user caches, some commits have a lot of props, yay! :)
+ $unique_user_ids = array_map( 'intval', array_filter( array_unique( wp_list_pluck( $props_list, 'user_id' ) ) ) );
+ if ( $unique_user_ids ) {
+ cache_users( $unique_user_ids );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $this->items as $i => $details ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->items[$i]->props = wp_list_pluck(
</span><span class="cx" style="display: block; padding: 0 10px"> wp_list_filter(
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminreportspagephp"></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/wporg-trac-watcher/admin/reports-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/plugins/wporg-trac-watcher/admin/reports-page.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/reports-page.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Default to the latest version for core.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_core && is_null( $version ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $version = sprintf( '%.1f', WP_CORE_LATEST_RELEASE + 0.1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $version = sprintf( '%.1f', floatval( WP_CORE_LATEST_RELEASE ) + 0.1 );
</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"> $url = add_query_arg( 'version', $version, $url );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,4 +441,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</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">-}
</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>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatcheradminuiphp"></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/wporg-trac-watcher/admin/ui.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/wporg-trac-watcher/admin/ui.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/ui.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,6 +21,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"> foreach ( $svns as $slug => $details ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // No point showing this UI if we're not importing Props.
+ if ( empty( $details['props_table'] ) ) {
+ continue;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $name = sprintf( "%s Props", $details['name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = add_menu_page(
</span><span class="cx" style="display: block; padding: 0 10px"> $name,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +40,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = add_submenu_page(
</span><span class="cx" style="display: block; padding: 0 10px"> 'props-edit-' . $slug,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Reports', 'Reports',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Reports',
+ 'Reports',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'edit_posts',
</span><span class="cx" style="display: block; padding: 0 10px"> 'props-reports-' . $slug,
</span><span class="cx" style="display: block; padding: 0 10px"> function() use ( $details ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,10 +63,8 @@
</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"> // Run the import upon loading the page if it hasn't run recently.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wp_next_scheduled( 'import_revisions_from_svn' ) < time() + 5*MINUTE_IN_SECONDS ) {
- ob_start();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( get_site_transient( 'import_revisions_from_svn' ) < time() - 5*MINUTE_IN_SECONDS ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'import_revisions_from_svn' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ob_end_clean();
</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"> wp_enqueue_script( 'trac-watch', plugins_url( 'admin/trac-watch.js', PLUGIN ), [ 'jquery', 'thickbox' ], filemtime( __DIR__ . '/trac-watch.js' ) );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchersvnphp"></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/wporg-trac-watcher/svn.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/wporg-trac-watcher/svn.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/svn.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,6 +6,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const MAX_REVISIONS = 250;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'import_revisions_from_svn', function() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ set_site_transient( 'import_revisions_from_svn', time() );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( get_svns() as $svn ) {
</span><span class="cx" style="display: block; padding: 0 10px"> import_revisions( $svn );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,9 +39,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $svn_url = $svn['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> $slug = $svn['slug'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $db_table = $svn['rev_table'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $db_table = $svn['rev_table'] ?? false;
</ins><span class="cx" style="display: block; padding: 0 10px"> $props_table = $svn['props_table'] ?? false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If this SVN doesn't have a rev_table defined, it's not being imported currently.
+ if ( ! $db_table ) {
+ return false;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $last_revision = $wpdb->get_var( "SELECT max(id) FROM {$db_table}" );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_numeric( $last_revision ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> trigger_error( "Can't find max row for {$db_table} to import {$svn_url} revisions.", E_USER_WARNING );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,8 +81,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "Importing {$id} \n";
-
</del><span class="cx" style="display: block; padding: 0 10px"> $paths = (array) $change->paths->path;
</span><span class="cx" style="display: block; padding: 0 10px"> $paths = array_filter( $paths, 'is_string' ); // hacky, to remove attributes array, leaving just paths.
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchertracwatchphp"></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/wporg-trac-watcher/trac-watch.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/wporg-trac-watcher/trac-watch.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac-watch.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,6 +2,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> namespace WordPressdotorg\Trac\Watcher;
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Plugin Name: WordPress.org Trac & SVN Watcher.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Description: This plugin imports Trac activity & SVN activity into WordPress.org databases. Trac actions for Profiles, and SVN activity for reporting, profiles, and make.w.org/* reporting.
+ * Version: 1.0
+ * Author: Dion Hulse
</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"> define( 'PLUGIN', __FILE__ );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> UNIQUE KEY `md5_id` (`md5_id`),
</span><span class="cx" style="display: block; padding: 0 10px"> KEY `category` (`category`),
</span><span class="cx" style="display: block; padding: 0 10px"> KEY `username` (`username`)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; // UTF8, but treated as latin1, due to historical profiles reasons.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $revisions_table = "CREATE TABLE IF NOT EXISTS `%s` (
</span><span class="cx" style="display: block; padding: 0 10px"> `id` int(11) unsigned NOT NULL,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +88,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> KEY `revision` (`revision`)
</span><span class="cx" style="display: block; padding: 0 10px"> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
</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; // TODO
</del><span class="cx" style="display: block; padding: 0 10px"> foreach ( SVN\get_svns() as $prefix => $info ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wpdb->query( sprintf( $trac_table, 'trac_' . $prefix ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $info['rev_table'] ) ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgtracwatchertracphp"></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/wporg-trac-watcher/trac.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/wporg-trac-watcher/trac.php 2021-12-14 05:20:19 UTC (rev 11370)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac.php 2021-12-15 02:47:05 UTC (rev 11371)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,17 +7,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function format_trac_markup( $message ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = esc_html( $message );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Convert some Trac markdown to HTML.
</ins><span class="cx" style="display: block; padding: 0 10px"> $message = preg_replace( '!`(.*?)`!i', '<code>$1</code>', $message );
</span><span class="cx" style="display: block; padding: 0 10px"> $message = preg_replace( '!{{{(.*?)}}}!sm', '<code>$1</code>', $message );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $message = preg_replace( '!\[([^] ]+) ([^]]+)\]!i', '<a href="$1">$2</a>', $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Escape shortcodes, but that takes out changesets..
- // $message = str_replace( [ '[', ']'], [ '[[', ']]' ], $message );
-
- // Might need to disable this, or escape more things prior to it.
- $message = apply_filters( 'the_content', $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Mark up the text, using functions we want, rather than `the_content` as it has many filters that don't strictly apply.
+ $message = wptexturize( $message );
+ $message = wpautop( $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> $message = make_clickable( $message );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Link tickets and changesets.
+ if ( function_exists( 'markup_wporg_links' ) ) {
+ $message = markup_wporg_links( $message );
+ }
+
+ // Ensure nothing funny is in the output.
+ $message = wp_kses_post( $message );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $message;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>