<!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>[9861] sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub: Add the Generic SEO Fixes plugin.</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/9861">9861</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/9861","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>2020-05-13 05:00:13 +0000 (Wed, 13 May 2020)</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'>Add the Generic SEO Fixes plugin.

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

<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseoarchiverelnextprevphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/archive-rel-next-prev.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseocanonicalredirectsphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical-redirects.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseocanonicalphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseohreflangphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/hreflang.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseoredirectsphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/redirects.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseorobotsphp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/robots.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseowporgseophp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/wporg-seo.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseophp">sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentmupluginspubwporgseoarchiverelnextprevphp"></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/mu-plugins/pub/wporg-seo/archive-rel-next-prev.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/mu-plugins/pub/wporg-seo/archive-rel-next-prev.php                               (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/archive-rel-next-prev.php 2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,56 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Archive_Rel_Next_Prev;
+use function WordPressdotorg\SEO\Canonical\get_canonical_url;
+
+/**
+ * Prints <link rel="prev|next"> tags for archives.
+ */
+function output_rel_prev_next_links() {
+       global $paged, $wp_query, $wp_rewrite;
+
+       $current_url = get_canonical_url();
+       if ( ! $current_url ) {
+               return;
+       }
+
+       $max_page = $wp_query->max_num_pages;
+       // Filters the maximum number of pages for a URL, when it's handled outside of WP_Query (ala bbPress).
+       $max_page = apply_filters( 'wporg_rel_next_pages', $max_page );
+       if ( ! $paged ) {
+               $paged = 1;
+       }
+
+       $nextpage = intval( $paged ) + 1;
+       $prevpage = intval( $paged ) - 1;
+
+       $current_url = remove_query_arg( 'paged', $current_url );
+       $current_url = preg_replace( "#/{$wp_rewrite->pagination_base}/\d+/?($|\?)#", '$1', $current_url );
+
+       // Support Canonical URLs with query parameters.
+       $current_url_query = '';
+       if ( false !== stripos( $current_url, '?' ) ) {
+               [ $current_url, $current_url_query ] = explode( '?', $current_url, 2 );
+               if ( $current_url_query ) {
+                       $current_url_query = '?' . $current_url_query;
+               }
+       }
+
+       // Just assume rewrites are in use everywhere.
+       $next_url = rtrim( $current_url, '/' ) . "/{$wp_rewrite->pagination_base}/{$nextpage}/" . $current_url_query;
+       $prev_url = rtrim( $current_url, '/' ) . ( $prevpage > 1 ? "/{$wp_rewrite->pagination_base}/{$prevpage}/" : '/' ) . $current_url_query;
+
+       if ( $prevpage >= 1 ) {
+               printf(
+                       '<link rel="prev" href="%s">' . "\n",
+                       esc_url( $prev_url )
+               );
+       }
+
+       if ( $nextpage <= $max_page ) {
+               printf(
+                       '<link rel="next" href="%s">' . "\n",
+                       esc_url( $next_url )
+               );
+       }
+}
+add_action( 'wp_head', __NAMESPACE__ . '\output_rel_prev_next_links' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/archive-rel-next-prev.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_htmlwpcontentmupluginspubwporgseocanonicalredirectsphp"></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/mu-plugins/pub/wporg-seo/canonical-redirects.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/mu-plugins/pub/wporg-seo/canonical-redirects.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical-redirects.php   2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,2 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Redirects;
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical-redirects.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_htmlwpcontentmupluginspubwporgseocanonicalphp"></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/mu-plugins/pub/wporg-seo/canonical.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/mu-plugins/pub/wporg-seo/canonical.php                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical.php     2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,167 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Canonical;
+/**
+ * Adds canonical-related functionality.
+ * @see https://core.trac.wordpress.org/ticket/18660
+ */
+
+/**
+ * Outputs a <link rel="canonical"> on most pages.
+ */
+function rel_canonical_link() {
+       if ( $url = get_canonical_url() ) {
+               printf(
+                       '<link rel="canonical" href="%s">' . "\n",
+                       esc_url( $url )
+               );
+       }
+}
+add_action( 'wp_head', __NAMESPACE__ . '\rel_canonical_link' );
+add_action( 'login_head',  __NAMESPACE__ . '\rel_canonical_link' );
+
+/**
+ * Outputs a Canonical Link header on needed pages.
+ */
+function rel_canonical_header() {
+       $url = get_canonical_url();
+       if ( ! $url || headers_sent() ) {
+               return;
+       }
+
+       $canonical = false;
+
+       if ( is_feed() && ! is_404() && is_archive() && ! is_comment_feed() ) {
+               // $url will NOT contain /feed/ so we can't output this on is_comment_feed()
+               $canonical = true;
+       }
+
+       if ( $canonical ) {
+               header( sprintf(
+                       'Link: <%s>; rel="canonical"',
+                       esc_url( $url )
+               ) );
+       }
+}
+add_action( 'template_redirect', __NAMESPACE__ . '\rel_canonical_header', 1000 );
+
+remove_action( 'wp_head', 'rel_canonical' );
+
+/**
+ * Get the current Canonical URL.
+ */
+function get_canonical_url() {
+       global $wp, $wp_query, $wp_rewrite;
+
+       $queried_object = get_queried_object();
+       $url = false;
+
+       if ( is_tax() || is_tag() || is_category() ) {
+               $url = get_term_link( $queried_object );
+
+               // Detect multi-term queries.
+               // Create a copy and remove the 'relation' param if present.
+               $tax_queries = $wp_query->tax_query->queries;
+               unset( $tax_queries['relation'] );
+
+               $term_queries    = count( $tax_queries );
+               $term_query_zero = count( $tax_queries[0]['terms'] );
+               if ( $term_queries > 1 || $term_query_zero > 1 ) {
+                       // Multiple terms are being queried for.
+                       $terms = wp_list_pluck( $tax_queries, 'terms' );
+                       $terms = call_user_func_array( 'array_merge', $terms );
+
+                       // Determine how many taxonomies are involved in this query.
+                       $taxonomies = array_unique( wp_list_pluck( $tax_queries, 'taxonomy' ) );
+
+                       if ( count( $taxonomies ) > 1 ) {
+                               // Multiple-taxonomy query. No canonical produced.
+                               // TODO: Edgecase: on a site where a taxonomy query is added via pre_get_posts this will result in no canonical produced.
+                               $url = false;
+                       } elseif ( $term_queries > 1 && 1 === $term_query_zero ) {
+                               // AND +
+                               $glue = '+';
+                       } elseif ( $term_query_zero > 1 && 1 === $term_queries && 'AND' === $wp_query->tax_query->relation ) {
+                               if ( 'AND' === $tax_queries[0]['operator'] ) {
+                                       // AND +
+                                       $glue = '+';
+                               } else {
+                                       // Union ,
+                                       $glue = ',';
+                               }
+                       } else {
+                               $url = false;
+                       }
+
+                       if ( $url ) {
+                               $url = str_replace(
+                                       '/' . $queried_object->slug . '/',
+                                       '/' . implode( $glue, $terms ) . '/',
+                                       $url
+                               );
+                       }
+               }
+       } elseif ( is_singular() ) {
+               $url = get_permalink( $queried_object );
+       } elseif ( is_search() ) {
+               $url = home_url( 'search/' . urlencode( get_query_var( 's' ) ) . '/' );
+       } elseif ( is_author() ) {
+               // On WordPress.org get_author_posts_url() returns profile.wordpress.org links. Build it manually.
+               $url = home_url( 'author/' . $queried_object->user_nicename . '/' );
+       } elseif ( is_post_type_archive() ) {
+               $url = get_post_type_archive_link( $queried_object->name );
+       } elseif ( is_home() ) {
+               $url = get_post_type_archive_link( 'post' );
+       } elseif ( is_front_page() ) {
+               $url = home_url( '/' );
+       } elseif ( is_date() ) {
+               if ( is_day() ) {
+                       $url = get_day_link( get_query_var('year'), get_query_var('monthnum'), get_query_var('day') );
+               } elseif ( is_month() ) {
+                       $url = get_month_link( get_query_var('year'), get_query_var('monthnum') );
+               } elseif ( is_year() ) {
+                       $url = get_year_link( get_query_var('year') );
+               }
+       }
+
+       // Filter to override the above logics.
+       $url = apply_filters( 'wporg_canonical_base_url', $url );
+
+       // Certain routes, such as `get_term_link()` can return WP_Error objects.
+       if ( is_wp_error( $url ) ) {
+               $url = false;
+       }
+
+       // Ensure trailing slashed paths.
+       if ( $url ) {
+               // Slash before ?.. and/or #...
+               $url = preg_replace( '!^([^?#]*?)([^/])((\?.*)?(#.*)?)$!', '$1$2/$3', $url );
+       }
+
+       if ( $url && is_paged() && (int) get_query_var( 'paged' ) > 1 ) {
+               if ( false !== stripos( $url, '?' ) ) {
+                       // We're not actually sure 100% here if the current url supports rewrite rules.
+                       $url = add_query_arg( 'paged', (int) get_query_var( 'paged' ), $url );
+               } else {
+                       $url = rtrim( $url, '/' ) . '/' . $wp_rewrite->pagination_base . '/' . (int) get_query_var( 'paged' ) . '/';
+               }
+       }
+
+       // Add order/orderby to Archives.
+       if ( is_archive() || is_search() || is_home() ) {
+               // Check $wp since `get_query_var()` will return default values too.
+               if ( !empty( $wp->query_vars[ 'order'] ) ) {
+                       $url = add_query_arg( 'order', get_query_var( 'order' ), $url );
+               }
+               if ( !empty( $wp->query_vars[ 'orderby'] ) ) {
+                       $url = add_query_arg( 'orderby', strtolower( get_query_var( 'orderby' ) ), $url );
+               }
+       }
+
+       $url = apply_filters( 'wporg_canonical_url', $url );
+
+       // Force canonical links to be lowercase.
+       // See https://meta.trac.wordpress.org/ticket/4414
+       $url = mb_strtolower( $url, 'UTF-8' );
+
+       return $url;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/canonical.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_htmlwpcontentmupluginspubwporgseohreflangphp"></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/mu-plugins/pub/wporg-seo/hreflang.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/mu-plugins/pub/wporg-seo/hreflang.php                            (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/hreflang.php      2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,2 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Hreflang;
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/hreflang.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_htmlwpcontentmupluginspubwporgseoredirectsphp"></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/mu-plugins/pub/wporg-seo/redirects.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/mu-plugins/pub/wporg-seo/redirects.php                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/redirects.php     2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,25 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Redirects;
+
+/**
+ * Custom Canonical redirect for Facebook and Twitter referrers.
+ */
+function facebook_twitter_referers() {
+       // Only run on pages with canonical enabled.
+       if ( ! has_action( 'template_redirect', 'redirect_canonical' ) ) {
+               return;
+       }
+
+       $url = false;
+       if ( isset( $_GET['fbclid'] ) ) {
+               $url = remove_query_arg( 'fbclid' ) . '#utm_medium=referral&utm_source=facebook.com&utm_content=social';
+       } elseif ( isset( $_GET['__twitter_impression'] ) ) {
+               $url = remove_query_arg( '__twitter_impression' ) . '#utm_medium=referral&utm_source=twitter.com&utm_content=social';
+       }
+
+       if ( $url ) {
+               wp_safe_redirect( $url, 301 );
+               exit;
+       }
+}
+add_action( 'template_redirect', __NAMESPACE__ . '\facebook_twitter_referers', 9 ); // Before redirect_canonical();
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/redirects.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_htmlwpcontentmupluginspubwporgseorobotsphp"></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/mu-plugins/pub/wporg-seo/robots.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/mu-plugins/pub/wporg-seo/robots.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/robots.php        2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,59 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO\Robots;
+
+/**
+ * Output a <meta name="robots"> tag when appropriate.
+ */
+function meta_robots() {
+       global $wp_query;
+
+       $noindex = false;
+
+       if ( is_search() || is_author() || is_date() ) {
+               $noindex = true;
+       } elseif ( is_singular() && 'publish' !== get_post_status() ) {
+               $noindex = true;
+       } elseif ( is_attachment() ) {
+               $noindex = true;
+       } elseif ( ( is_tax() || is_tag() || is_category() ) && $wp_query->found_posts <= 3 ) {
+               $noindex = true;
+       }
+
+       // Allow sites to alter this
+       $noindex = apply_filters( 'wporg_noindex_request', $noindex );
+
+       if ( $noindex ) {
+               // Allow sites to override the value.
+               if ( is_bool( $noindex ) ) {
+                       $noindex = 'noindex,follow';
+               }
+
+               echo '<meta name="robots" content="' . $noindex . '" />' . "\n";
+       }
+}
+add_action( 'wp_head', __NAMESPACE__ . '\meta_robots', 10, 1 );
+
+/**
+ * Add an X-Robots-Tag header when appropriate.
+ */
+function add_X_robots_tag() {
+       $noindex = false;
+
+       // Search and Taxonomy feeds should be noindexed.
+       if ( is_feed() && ( is_tax() || is_tag() || is_category() || is_search() ) ) {
+               $noindex = true;
+       }
+
+       // Allow sites to alter this
+       $noindex = apply_filters( 'wporg_noindex_request', $noindex );
+
+       if ( $noindex && ! headers_sent() ) {
+               // Allow sites to override the value.
+               if ( is_bool( $noindex ) ) {
+                       $noindex = 'noindex,follow';
+               }
+
+               header( 'X-Robots-Tag: ' . $noindex );
+       }
+}
+add_action( 'template_redirect', __NAMESPACE__ . '\add_X_robots_tag', 1000 );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/robots.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_htmlwpcontentmupluginspubwporgseowporgseophp"></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/mu-plugins/pub/wporg-seo/wporg-seo.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/mu-plugins/pub/wporg-seo/wporg-seo.php                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/wporg-seo.php     2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,12 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\SEO;
+/**
+ * Plugin Name: WordPress.org Generic SEO fixes.
+ */
+
+include __DIR__ . '/robots.php';
+include __DIR__ . '/redirects.php';
+include __DIR__ . '/canonical.php';
+include __DIR__ . '/archive-rel-next-prev.php';
+// include __DIR__ . '/hreflang.php';
+// include __DIR__ . '/canonical-redirects.php';
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo/wporg-seo.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_htmlwpcontentmupluginspubwporgseophp"></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/mu-plugins/pub/wporg-seo.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/mu-plugins/pub/wporg-seo.php                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo.php       2020-05-13 05:00:13 UTC (rev 9861)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,6 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: WordPress.org Generic SEO fixes.
+ */
+
+include __DIR__ . '/wporg-seo/wporg-seo.php';
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-seo.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></div>

</body>
</html>