From 3f5992e36b64d95ad08d7e371d660b01b880268b Mon Sep 17 00:00:00 2001
From: lucha <lucha@paranoici.org>
Date: Sat, 7 Jul 2018 19:43:25 +0200
Subject: [PATCH] [auto] plugin: pubsubhubbub 3.0.0

---
 wp-content/plugins/pubsubhubbub/.svnignore    |   1 +
 .../includes/class-pubsubhubbub-admin.php     | 103 ++++++++++
 .../includes/class-pubsubhubbub-publisher.php | 147 ++++++++++++++
 .../includes/class-pubsubhubbub-topics.php    |  63 ++++++
 .../includes/class-pubsubhubbub.php           |  12 ++
 .../pubsubhubbub/includes/deprecated.php      |   4 +-
 .../pubsubhubbub/includes/functions.php       | 118 +++--------
 .../pubsubhubbub/languages/pubsubhubbub.pot   | 144 ++++++++++++--
 .../plugins/pubsubhubbub/pubsubhubbub.php     | 185 +++---------------
 wp-content/plugins/pubsubhubbub/readme.txt    |  40 +++-
 .../pubsubhubbub/templates/settings-page.php  |  52 ++---
 11 files changed, 560 insertions(+), 309 deletions(-)
 create mode 100644 wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-admin.php
 create mode 100644 wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-publisher.php
 create mode 100644 wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-topics.php
 create mode 100644 wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub.php

diff --git a/wp-content/plugins/pubsubhubbub/.svnignore b/wp-content/plugins/pubsubhubbub/.svnignore
index 33a3580e9..563cd8756 100644
--- a/wp-content/plugins/pubsubhubbub/.svnignore
+++ b/wp-content/plugins/pubsubhubbub/.svnignore
@@ -5,6 +5,7 @@
 .travis.yml
 .codeclimate.yml
 .data
+.svnignore
 Gruntfile.js
 LINGUAS
 Makefile
diff --git a/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-admin.php b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-admin.php
new file mode 100644
index 000000000..cd8bee0dd
--- /dev/null
+++ b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-admin.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * The WebSub/PubSubHubbub admin class
+ */
+class Pubsubhubbub_Admin {
+	/**
+	 * Add a link to our settings page in the WP menu
+	 */
+	public static function add_plugin_menu() {
+		$options_page = add_options_page(
+			'WebSub/PubSubHubbub Settings',
+			'WebSub/PubSubHubbub',
+			'administrator',
+			'pubsubhubbub',
+			array(
+				'Pubsubhubbub_Admin',
+				'add_settings_page',
+			)
+		);
+
+		add_action( 'load-' . $options_page, array( 'Pubsubhubbub_Admin', 'add_help_tab' ) );
+	}
+
+	/**
+	 * Write the content for our settings page that allows you to
+	 * define your endpoints
+	 */
+	public static function add_settings_page() {
+		load_template( plugin_dir_path( __FILE__ ) . '../templates/settings-page.php' );
+	}
+
+	/**
+	 * Register PubSubHubbub settings
+	 */
+	public static function register_settings() {
+		register_setting(
+			'pubsubhubbub', 'pubsubhubbub_endpoints', array(
+				'type'         => 'string',
+				'description'  => __( 'The WebSub/PubSubHubbub endpoints', 'pubsubhubbub' ),
+				'show_in_rest' => true,
+				'default'      => '',
+			)
+		);
+	}
+
+	public static function add_help_tab() {
+		get_current_screen()->add_help_tab(
+			array(
+				'id'      => 'overview',
+				'title'   => __( 'Overview', 'pubsubhubbub' ),
+				'content' => '<p>' . __( 'WebSub provides a common mechanism for communication between publishers of any kind of Web content and their subscribers, based on HTTP web hooks. Subscription requests are relayed through hubs, which validate and verify the request. Hubs then distribute new and updated content to subscribers when it becomes available. WebSub was previously known as PubSubHubbub.', 'pubsubhubbub' ) . '</p>',
+			)
+		);
+
+		get_current_screen()->add_help_tab(
+			array(
+				'id'      => 'screencast',
+				'title'   => __( 'Terms', 'pubsubhubbub' ),
+				'content' =>
+					'<p>
+						<strong>' . __( 'Publisher', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'A WebSub Publisher is an implementation that advertises a topic and hub URL on one or more resource URLs.', 'pubsubhubbub' ) .
+					'</p>' .
+					'<p>
+						<strong>' . __( 'Subscriber', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'A WebSub Subscriber is an implementation that discovers the hub and topic URL given a resource URL, subscribes to updates at the hub, and accepts content distribution requests from the hub. The subscriber MAY support authenticated content distribution.', 'pubsubhubbub' ) .
+					'</p>' .
+					'<p>
+						<strong>' . __( 'Hub', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'A WebSub Hub is an implementation that handles subscription requests and distributes the content to subscribers when the corresponding topic URL has been updated. Hubs MUST support subscription requests with a secret and deliver authenticated requests when requested. Hubs MUST deliver the full contents of the topic URL in the request, and MAY reduce the payload to a diff if the content type supports it.', 'pubsubhubbub' ) .
+					'</p>',
+			)
+		);
+
+		get_current_screen()->add_help_tab(
+			array(
+				'id'      => 'indieweb',
+				'title'   => __( 'The IndieWeb', 'pubsubhubbub' ),
+				'content' =>
+					'<p>' . __( 'The IndieWeb is a people-focused alternative to the "corporate web".', 'pubsubhubbub' ) . '</p>' .
+					'<p>
+						<strong>' . __( 'Your content is yours', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'When you post something on the web, it should belong to you, not a corporation. Too many companies have gone out of business and lost all of their users’ data. By joining the IndieWeb, your content stays yours and in your control.', 'pubsubhubbub' ) .
+					'</p>' .
+					'<p>
+						<strong>' . __( 'You are better connected', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'Your articles and status messages can go to all services, not just one, allowing you to engage with everyone. Even replies and likes on other services can come back to your site so they’re all in one place.', 'pubsubhubbub' ) .
+					'</p>' .
+					'<p>
+						<strong>' . __( 'You are in control', 'pubsubhubbub' ) . '</strong><br />' .
+						__( 'You can post anything you want, in any format you want, with no one monitoring you. In addition, you share simple readable links such as example.com/ideas. These links are permanent and will always work.', 'pubsubhubbub' ) .
+					'</p>',
+			)
+		);
+
+		get_current_screen()->set_help_sidebar(
+			'<p><strong>' . __( 'For more information:', 'pubsubhubbub' ) . '</strong></p>' .
+			'<p>' . __( '<a href="https://indieweb.org/WebSub">IndieWeb Wiki page</a>', 'pubsubhubbub' ) . '</p>' .
+			'<p>' . __( '<a href="https://websub.rocks/">Test suite</a>', 'pubsubhubbub' ) . '</p>' .
+			'<p>' . __( '<a href="https://www.w3.org/TR/websub/">W3C Spec</a>', 'pubsubhubbub' ) . '</p>'
+		);
+	}
+}
diff --git a/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-publisher.php b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-publisher.php
new file mode 100644
index 000000000..a93d285ca
--- /dev/null
+++ b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-publisher.php
@@ -0,0 +1,147 @@
+<?php
+/**
+ * The WebSub/PubSubHubbub publisher class
+ */
+class PubSubHubbub_Publisher {
+	/**
+	 * Function that is called whenever a new post is published
+	 *
+	 * @param int $post_id the post-id
+	 * @return int the post-id
+	 */
+	public static function publish_post( $post_id ) {
+		// we want to notify the hub for every feed
+		$feed_urls   = array();
+		$feed_urls[] = get_bloginfo( 'atom_url' );
+		$feed_urls[] = get_bloginfo( 'rdf_url' );
+		$feed_urls[] = get_bloginfo( 'rss2_url' );
+
+		if ( current_theme_supports( 'microformats2' ) ) {
+			$feed_urls[] = site_url( '/' );
+		}
+
+		$feed_urls = apply_filters( 'pubsubhubbub_feed_urls', $feed_urls, $post_id );
+
+		// publish them
+		self::publish_to_hub( $feed_urls );
+	}
+
+	/**
+	 * Function that is called whenever a new comment is published
+	 *
+	 * @param int $comment_id the comment-id
+	 * @return int the comment-id
+	 */
+	public static function publish_comment( $comment_id ) {
+		// get default comment-feeds
+		$feed_urls   = array();
+		$feed_urls[] = get_bloginfo( 'comments_atom_url' );
+		$feed_urls[] = get_bloginfo( 'comments_rss2_url' );
+
+		$feed_urls = apply_filters( 'pubsubhubbub_comment_feed_urls', $feed_urls, $comment_id );
+
+		// publish them
+		self::publish_to_hub( $feed_urls );
+	}
+
+	/**
+	 * Accepts either a single url or an array of urls
+	 *
+	 * @param string|array $topic_urls a single topic url or an array of topic urls
+	 */
+	public static function publish_update( $topic_urls, $hub_url ) {
+		if ( ! isset( $hub_url ) ) {
+			return new WP_Error( 'missing_hub_url', __( 'Please specify a hub url', 'pubsubhubbub' ) );
+		}
+
+		if ( ! preg_match( '|^https?://|i', $hub_url ) ) {
+			/* translators: %s is the $hub_url */
+			return new WP_Error( 'invalid_hub_url', sprintf( __( 'The specified hub url does not appear to be valid: %s', 'pubsubhubbub' ), $hub_url ) );
+		}
+
+		if ( ! isset( $topic_urls ) ) {
+			return new WP_Error( 'missing_topic_url', __( 'Please specify a topic url', 'pubsubhubbub' ) );
+		}
+
+		// check that we're working with an array
+		if ( ! is_array( $topic_urls ) ) {
+			$topic_urls = array( $topic_urls );
+		}
+
+		// set the mode to publish
+		$post_string = 'hub.mode=publish';
+		// loop through each topic url
+		foreach ( $topic_urls as $topic_url ) {
+			// lightweight check that we're actually working w/ a valid url
+			if ( preg_match( '|^https?://|i', $topic_url ) ) {
+				// append the topic url parameters
+				$post_string .= '&hub.url=' . esc_url( $topic_url );
+			}
+		}
+
+		$wp_version = get_bloginfo( 'version' );
+		$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
+
+		$args = array(
+			'timeout' => 100,
+			'limit_response_size' => 1048576,
+			'redirection' => 20,
+			'user-agent' => "$user_agent; PubSubHubbub/WebSub",
+			'body' => $post_string,
+		);
+
+		// make the http post request
+		return wp_remote_post( $hub_url, $args );
+	}
+
+	/**
+	 * The ability for other plugins to hook into the PuSH code
+	 *
+	 * @param array $feed_urls a list of feed urls you want to publish
+	 */
+	public static function publish_to_hub( $feed_urls ) {
+		// remove dups (ie. they all point to feedburner)
+		$feed_urls = array_unique( $feed_urls );
+
+		// get the list of hubs
+		$hub_urls = self::get_hubs();
+
+		// loop through each hub
+		foreach ( $hub_urls as $hub_url ) {
+			// publish the update to each hub
+			$response = self::publish_update( $feed_urls, $hub_url );
+
+			do_action( 'pubsubhubbub_publish_update_response', $response );
+		}
+	}
+
+	/**
+	 * Get the endpoints from the WordPress options table
+	 * valid parameters are "publish" or "subscribe"
+	 *
+	 * @uses apply_filters() Calls 'pubsubhubbub_hub_urls' filter
+	 */
+	public static function get_hubs() {
+		$endpoints = get_option( 'pubsubhubbub_endpoints' );
+		$hub_urls  = explode( PHP_EOL, $endpoints );
+
+		// if no values have been set, revert to the defaults (websub on app engine & superfeedr)
+		if ( ! $endpoints || ! $hub_urls || ! is_array( $hub_urls ) ) {
+			$hub_urls = array(
+				'https://pubsubhubbub.appspot.com',
+				'https://pubsubhubbub.superfeedr.com',
+			);
+		}
+
+		// clean out any blank values
+		foreach ( $hub_urls as $key => $value ) {
+			if ( empty( $value ) ) {
+				unset( $hub_urls[ $key ] );
+			} else {
+				$hub_urls[ $key ] = trim( $hub_urls[ $key ] );
+			}
+		}
+
+		return apply_filters( 'pubsubhubbub_hub_urls', $hub_urls );
+	}
+}
diff --git a/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-topics.php b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-topics.php
new file mode 100644
index 000000000..f92518f11
--- /dev/null
+++ b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub-topics.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * The WebSub/PubSubHubbub topics class
+ */
+class Pubsubhubbub_Topics {
+	/**
+	 * Add hub-<link> to the Atom feed
+	 */
+	public static function add_atom_link_tag() {
+		// check if current url is one of the feed urls
+		if ( ! pubsubhubbub_show_discovery() ) {
+			return;
+		}
+
+		$hub_urls = pubsubhubbub_get_hubs();
+
+		foreach ( $hub_urls as $hub_url ) {
+			printf( '<link rel="hub" href="%s" />', $hub_url ) . PHP_EOL;
+		}
+	}
+
+	/**
+	 * Add hub-<link> to the RSS/RDF feed
+	 */
+	public static function add_rss_link_tag() {
+		// check if current url is one of the feed urls
+		if ( ! pubsubhubbub_show_discovery() ) {
+			return;
+		}
+
+		$hub_urls = pubsubhubbub_get_hubs();
+
+		foreach ( $hub_urls as $hub_url ) {
+			printf( '<atom:link rel="hub" href="%s"/>', $hub_url ) . PHP_EOL;
+		}
+	}
+
+	/**
+	 * Add Atom namespace to rdf-feed
+	 */
+	public static function add_rss_ns_link() {
+		echo ' xmlns:atom="http://www.w3.org/2005/Atom" ' . PHP_EOL;
+	}
+
+	/**
+	 * Adds link headers as defined in the current v0.4 draft
+	 */
+	public static function template_redirect() {
+		// check if current url is one of the feed urls
+		if ( ! pubsubhubbub_show_discovery() ) {
+			return false;
+		}
+
+		$hub_urls = pubsubhubbub_get_hubs();
+		// add all "hub" headers
+		foreach ( $hub_urls as $hub_url ) {
+			header( sprintf( 'Link: <%s>; rel="hub"', $hub_url ), false );
+		}
+
+		// add the "self" header
+		header( sprintf( 'Link: <%s>; rel="self"', pubsubhubbub_get_self_link() ), false );
+	}
+}
diff --git a/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub.php b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub.php
new file mode 100644
index 000000000..bdc72ee48
--- /dev/null
+++ b/wp-content/plugins/pubsubhubbub/includes/class-pubsubhubbub.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * The WebSub/PubSubHubbub class
+ */
+class Pubsubhubbub {
+	/**
+	 * Load the plugin textdomain.
+	 */
+	public static function load_textdomain() {
+		load_plugin_textdomain( 'pubsubhubbub', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
+	}
+}
diff --git a/wp-content/plugins/pubsubhubbub/includes/deprecated.php b/wp-content/plugins/pubsubhubbub/includes/deprecated.php
index acc3c0808..fdf7bf31e 100644
--- a/wp-content/plugins/pubsubhubbub/includes/deprecated.php
+++ b/wp-content/plugins/pubsubhubbub/includes/deprecated.php
@@ -6,7 +6,7 @@
  * @deprecated
  */
 function publish_to_hub( $deprecated = null, $feed_urls ) {
-	pubsubhubbub_publish_to_hub( $feed_urls );
+	PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
 }
 
 /**
@@ -17,7 +17,7 @@ function publish_to_hub( $deprecated = null, $feed_urls ) {
  * @deprecated
  */
 function pshb_publish_to_hub( $feed_urls ) {
-	pubsubhubbub_publish_to_hub( $feed_urls );
+	PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
 }
 
 /**
diff --git a/wp-content/plugins/pubsubhubbub/includes/functions.php b/wp-content/plugins/pubsubhubbub/includes/functions.php
index ca015fe87..b3718e23a 100644
--- a/wp-content/plugins/pubsubhubbub/includes/functions.php
+++ b/wp-content/plugins/pubsubhubbub/includes/functions.php
@@ -5,102 +5,45 @@
  * @param array $feed_urls a list of feed urls you want to publish
  */
 function pubsubhubbub_publish_to_hub( $feed_urls ) {
-	require_once( dirname( __FILE__ ) . '/pubsubhubbub-publisher.php' );
-
-	// remove dups (ie. they all point to feedburner)
-	$feed_urls = array_unique( $feed_urls );
-
-	pubsubhubbub_update_topic_urls( $feed_urls );
-
-	// get the list of hubs
-	$hub_urls = pubsubhubbub_get_hubs();
-
-	// loop through each hub
-	foreach ( $hub_urls as $hub_url ) {
-		$p = new PubSubHubbub_Publisher( $hub_url );
-		// publish the update to each hub
-		$response = $p->publish_update( $feed_urls );
-
-		do_action( 'pubsubhubbub_publish_update_response', $response );
-	}
+	PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
 }
 
 /**
- * get the endpoints from the wordpress options table
+ * Get the endpoints from the WordPress options table
  * valid parameters are "publish" or "subscribe"
  *
- *	@uses apply_filters() Calls 'pubsubhubbub_hub_urls' filter
+ * @uses apply_filters() Calls 'pubsubhubbub_hub_urls' filter
  */
 function pubsubhubbub_get_hubs() {
-	$endpoints = get_option( 'pubsubhubbub_endpoints' );
-	$hub_urls = explode( PHP_EOL, $endpoints );
-
-	// if no values have been set, revert to the defaults (websub on app engine & superfeedr)
-	if ( ! $endpoints || ! $hub_urls || ! is_array( $hub_urls ) ) {
-		$hub_urls = array(
-			'https://pubsubhubbub.appspot.com',
-			'https://pubsubhubbub.superfeedr.com',
-		);
-	}
-
-	// clean out any blank values
-	foreach ( $hub_urls as $key => $value ) {
-		if ( empty( $value ) ) {
-			unset( $hub_urls[ $key ] );
-		} else {
-			$hub_urls[ $key ] = trim( $hub_urls[ $key ] );
-		}
-	}
-
-	return apply_filters( 'pubsubhubbub_hub_urls', $hub_urls );
+	return PubSubHubbub_Publisher::get_hubs();
 }
 
 /**
- * Add new topic urls
+ * Check if link supports PubSubHubbub or WebSub
  *
- * @param array $urls list of urls
+ * @return boolean
  */
-function pubsubhubbub_update_topic_urls( $urls ) {
-	if ( ! is_array( $urls ) ) {
-		return;
-	}
-
-	$topic_urls = pubsubhubbub_get_topic_urls();
-	$topic_urls = array_merge( $topic_urls, $urls );
+function pubsubhubbub_show_discovery() {
+	global $withcomments;
 
-	update_option( 'pubsubhubbub_topic_urls', array_unique( $topic_urls ) );
-}
+	if ( ! $withcomments ) {
+		$withcomments = 0;
+	}
 
-/**
- * Return topic urls
- *
- * @return array list of urls
- */
-function pubsubhubbub_get_topic_urls() {
-	$default_feeds = array(
-		get_bloginfo( 'atom_url' ),
-		get_bloginfo( 'rdf_url' ),
-		get_bloginfo( 'rss2_url' ),
-		//get_bloginfo( 'comments_atom_url' ),
-		//get_bloginfo( 'comments_rss2_url' ),
-	);
+	$show_discovery = false;
 
-	$feeds = get_option( 'pubsubhubbub_topic_urls', $default_feeds );
+	$supported_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_feed_types', array( 'atom', 'rss2', 'rdf' ) );
+	$supported_comment_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_comment_feed_types', array( 'atom', 'rss2' ) );
 
-	if ( is_array( $feeds ) ) {
-		return $feeds;
+	if (
+		( is_feed( $supported_feed_types ) && ! is_archive() && ! is_singular() && 0 == $withcomments ) ||
+		( is_feed( $supported_comment_feed_types ) && 1 == $withcomments ) ||
+		( is_home() && current_theme_supports( 'microformats2' ) )
+	) {
+		$show_discovery = true;
 	}
 
-	return $default_feeds;
-}
-
-/**
- * Check if link supports PubSubHubbub or WebSub
- *
- * @return boolean
- */
-function pubsubhubbub_show_discovery() {
-	return (boolean) pubsubhubbub_get_self_link();
+	return apply_filters( 'pubsubhubbub_show_discovery', $show_discovery );
 }
 
 /**
@@ -109,22 +52,5 @@ function pubsubhubbub_show_discovery() {
  * @return boolean
  */
 function pubsubhubbub_get_self_link() {
-	// get current url
-	$urls = pubsubhubbub_get_topic_urls();
-
-	$current_url = home_url( add_query_arg( null, null ) );
-	$current_url = untrailingslashit( $current_url );
-	$current_url = preg_replace( '/^https?:\/\//i', '', $current_url );
-
-	$matches = preg_grep( '/^https?:\/\/' . preg_quote( $current_url, '/' ) . '\/?$/i', $urls );
-
-	if ( empty( $matches ) ) {
-		return false;
-	}
-
-	if ( count( $matches ) >= 2 ) {
-		return home_url( add_query_arg( null, null ) );
-	}
-
-	return current( $matches );
+	return trailingslashit( home_url( add_query_arg( null, null ) ) );
 }
diff --git a/wp-content/plugins/pubsubhubbub/languages/pubsubhubbub.pot b/wp-content/plugins/pubsubhubbub/languages/pubsubhubbub.pot
index 8be411eef..8e899aeea 100644
--- a/wp-content/plugins/pubsubhubbub/languages/pubsubhubbub.pot
+++ b/wp-content/plugins/pubsubhubbub/languages/pubsubhubbub.pot
@@ -2,9 +2,9 @@
 # This file is distributed under the MIT.
 msgid ""
 msgstr ""
-"Project-Id-Version: WebSub/PubSubHubbub 2.2.1\n"
+"Project-Id-Version: WebSub/PubSubHubbub 3.0.0\n"
 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pubsubhubbub\n"
-"POT-Creation-Date: 2018-02-04 19:41:40+00:00\n"
+"POT-Creation-Date: 2018-07-02 15:10:24+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -13,34 +13,144 @@ msgstr ""
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "X-Generator: grunt-wp-i18n 0.5.4\n"
 
-#: pubsubhubbub.php:153
-msgid "Settings"
+#: includes/class-pubsubhubbub-admin.php:39
+msgid "The WebSub/PubSubHubbub endpoints"
 msgstr ""
 
-#. Plugin Name of the plugin/theme
-msgid "WebSub/PubSubHubbub"
+#: includes/class-pubsubhubbub-admin.php:50
+msgid "Overview"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:51
+msgid ""
+"WebSub provides a common mechanism for communication between publishers of "
+"any kind of Web content and their subscribers, based on HTTP web hooks. "
+"Subscription requests are relayed through hubs, which validate and verify "
+"the request. Hubs then distribute new and updated content to subscribers "
+"when it becomes available. WebSub was previously known as PubSubHubbub."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:58
+msgid "Terms"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:61
+msgid "Publisher"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:62 templates/settings-page.php:9
+msgid ""
+"A WebSub Publisher is an implementation that advertises a topic and hub URL "
+"on one or more resource URLs."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:65
+msgid "Subscriber"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:66
+msgid ""
+"A WebSub Subscriber is an implementation that discovers the hub and topic "
+"URL given a resource URL, subscribes to updates at the hub, and accepts "
+"content distribution requests from the hub. The subscriber MAY support "
+"authenticated content distribution."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:69
+msgid "Hub"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:70
+msgid ""
+"A WebSub Hub is an implementation that handles subscription requests and "
+"distributes the content to subscribers when the corresponding topic URL has "
+"been updated. Hubs MUST support subscription requests with a secret and "
+"deliver authenticated requests when requested. Hubs MUST deliver the full "
+"contents of the topic URL in the request, and MAY reduce the payload to a "
+"diff if the content type supports it."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:78
+msgid "The IndieWeb"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:80
+msgid "The IndieWeb is a people-focused alternative to the \"corporate web\"."
 msgstr ""
 
-#: templates/settings-page.php:4
-msgid "Define custom hubs"
+#: includes/class-pubsubhubbub-admin.php:82
+msgid "Your content is yours"
 msgstr ""
 
-#: templates/settings-page.php:19
-msgid "Hubs (one per line)"
+#: includes/class-pubsubhubbub-admin.php:83
+msgid ""
+"When you post something on the web, it should belong to you, not a "
+"corporation. Too many companies have gone out of business and lost all of "
+"their users’ data. By joining the IndieWeb, your content stays yours and in "
+"your control."
 msgstr ""
 
-#: templates/settings-page.php:28
-msgid "Topic URLs"
+#: includes/class-pubsubhubbub-admin.php:86
+msgid "You are better connected"
 msgstr ""
 
-#: templates/settings-page.php:30
+#: includes/class-pubsubhubbub-admin.php:87
 msgid ""
-"These topic URLs will be send to the hub if you post a new, or update an "
-"existing post:"
+"Your articles and status messages can go to all services, not just one, "
+"allowing you to engage with everyone. Even replies and likes on other "
+"services can come back to your site so they’re all in one place."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:90
+msgid "You are in control"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:91
+msgid ""
+"You can post anything you want, in any format you want, with no one "
+"monitoring you. In addition, you share simple readable links such as "
+"example.com/ideas. These links are permanent and will always work."
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:97
+msgid "For more information:"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:98
+msgid "<a href=\"https://indieweb.org/WebSub\">IndieWeb Wiki page</a>"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:99
+msgid "<a href=\"https://websub.rocks/\">Test suite</a>"
+msgstr ""
+
+#: includes/class-pubsubhubbub-admin.php:100
+msgid "<a href=\"https://www.w3.org/TR/websub/\">W3C Spec</a>"
+msgstr ""
+
+#: includes/class-pubsubhubbub-publisher.php:54
+msgid "Please specify a hub url"
+msgstr ""
+
+#: includes/class-pubsubhubbub-publisher.php:59
+#. translators: %s is the $hub_url
+msgid "The specified hub url does not appear to be valid: %s"
+msgstr ""
+
+#: includes/class-pubsubhubbub-publisher.php:63
+msgid "Please specify a topic url"
+msgstr ""
+
+#. Plugin Name of the plugin/theme
+msgid "WebSub/PubSubHubbub"
+msgstr ""
+
+#: templates/settings-page.php:7
+msgid "Publisher Settings"
 msgstr ""
 
-#: templates/settings-page.php:40
-msgid "Thanks for using WebSub/PubSubHubbub!"
+#: templates/settings-page.php:18
+msgid "Hubs <small>(one per line)</small>"
 msgstr ""
 
 #. Plugin URI of the plugin/theme
diff --git a/wp-content/plugins/pubsubhubbub/pubsubhubbub.php b/wp-content/plugins/pubsubhubbub/pubsubhubbub.php
index b9ff681cd..232109470 100755
--- a/wp-content/plugins/pubsubhubbub/pubsubhubbub.php
+++ b/wp-content/plugins/pubsubhubbub/pubsubhubbub.php
@@ -3,7 +3,7 @@
  * Plugin Name: WebSub/PubSubHubbub
  * Plugin URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub/
  * Description: A better way to tell the world when your blog is updated.
- * Version: 2.2.2
+ * Version: 3.0.0
  * Author: Matthias Pfefferle
  * Author URI: https://notiz.blog/
  * License: MIT
@@ -12,180 +12,55 @@
  * Domain Path: /languages
  */
 
-add_action( 'init', array( 'PubSubHubbub_Plugin', 'load_textdomain' ) );
-add_action( 'plugins_loaded', array( 'PubSubHubbub_Plugin', 'init' ) );
-
-class PubSubHubbub_Plugin {
-
-	/**
-	 * Initialize plugin
-	 */
-	public static function init() {
-		require_once( dirname( __FILE__ ) . '/includes/functions.php' );
-
-		add_action( 'publish_post', array( 'PubSubHubbub_Plugin', 'publish_post' ) );
-		//add_action( 'comment_post', array( 'PubSubHubbub_Plugin', 'publish_comment' ) );
-
-		add_action( 'atom_head', array( 'PubSubHubbub_Plugin', 'add_atom_link_tag' ) );
-		add_action( 'comments_atom_head', array( 'PubSubHubbub_Plugin', 'add_atom_link_tag' ) );
-
-		add_action( 'rdf_header', array( 'PubSubHubbub_Plugin', 'add_rss_link_tag' ) );
-		add_action( 'rss2_head', array( 'PubSubHubbub_Plugin', 'add_rss_link_tag' ) );
-		add_action( 'commentsrss2_head', array( 'PubSubHubbub_Plugin', 'add_rss_link_tag' ) );
-
-		add_action( 'rdf_ns', array( 'PubSubHubbub_Plugin', 'add_rss_ns_link' ) );
-
-		add_action( 'admin_menu', array( 'PubSubHubbub_Plugin', 'add_plugin_menu' ) );
-		add_action( 'admin_init', array( 'PubSubHubbub_Plugin', 'register_settings' ) );
-
-		add_filter( 'plugin_action_links', array( 'PubSubHubbub_Plugin', 'add_settings_link' ), 10, 2 );
-
-		add_action( 'template_redirect', array( 'PubSubHubbub_Plugin', 'template_redirect' ) );
-
-		require_once( dirname( __FILE__ ) . '/includes/deprecated.php' );
-	}
-
-	/**
-	 * Function that is called whenever a new post is published
-	 *
-	 * @param int $post_id the post-id
-	 * @return int the post-id
-	 */
-	public static function publish_post( $post_id ) {
-		// we want to notify the hub for every feed
-		$feed_urls = array();
-		$feed_urls[] = get_bloginfo( 'atom_url' );
-		$feed_urls[] = get_bloginfo( 'rdf_url' );
-		$feed_urls[] = get_bloginfo( 'rss2_url' );
-
-		$feed_urls = apply_filters( 'pubsubhubbub_feed_urls', $feed_urls, $post_id );
-
-		// publish them
-		pubsubhubbub_publish_to_hub( $feed_urls );
-	}
+/**
+ * Initialize plugin
+ */
+function pubsubhubbub_init() {
+	require_once( dirname( __FILE__ ) . '/includes/functions.php' );
 
 	/**
-	 * Function that is called whenever a new comment is published
-	 *
-	 * @param int $comment_id the comment-id
-	 * @return int the comment-id
+	 * Publisher integration
 	 */
-	public static function publish_comment( $comment_id ) {
-		// get default comment-feeds
-		$feed_urls = array();
-		$feed_urls[] = get_bloginfo( 'comments_atom_url' );
-		$feed_urls[] = get_bloginfo( 'comments_rss2_url' );
-
-		$feed_urls = apply_filters( 'pubsubhubbub_comment_feed_urls', $feed_urls, $comment_id );
+	require_once( dirname( __FILE__ ) . '/includes/class-pubsubhubbub-publisher.php' );
 
-		// publish them
-		pubsubhubbub_publish_to_hub( $feed_urls );
-	}
+	add_action( 'publish_post', array( 'PubSubHubbub_Publisher', 'publish_post' ) );
+	//add_action( 'comment_post', array( 'PubSubHubbub_Publisher', 'publish_comment' ) );
 
 	/**
-	 * Add hub-<link> to the atom feed
+	 * Admin panel
 	 */
-	public static function add_atom_link_tag() {
-		// check if current url is one of the feed urls
-		if ( ! pubsubhubbub_show_discovery() ) {
-			return;
-		}
-
-		$hub_urls = pubsubhubbub_get_hubs();
+	require_once( dirname( __FILE__ ) . '/includes/class-pubsubhubbub-admin.php' );
 
-		foreach ( $hub_urls as $hub_url ) {
-			printf( '<link rel="hub" href="%s" />', $hub_url ) . PHP_EOL;
-		}
-	}
+	add_action( 'admin_init', array( 'PubSubHubbub_Admin', 'register_settings' ) );
+	add_action( 'admin_menu', array( 'Pubsubhubbub_Admin', 'add_plugin_menu' ) );
 
 	/**
-	 * Add hub-<link> to the rss/rdf feed
+	 * Feed integrations
 	 */
-	public static function add_rss_link_tag() {
-		// check if current url is one of the feed urls
-		if ( ! pubsubhubbub_show_discovery() ) {
-			return;
-		}
+	require_once( dirname( __FILE__ ) . '/includes/class-pubsubhubbub-topics.php' );
 
-		$hub_urls = pubsubhubbub_get_hubs();
+	add_action( 'atom_head', array( 'Pubsubhubbub_Topics', 'add_atom_link_tag' ) );
+	add_action( 'rdf_header', array( 'Pubsubhubbub_Topics', 'add_rss_link_tag' ) );
+	add_action( 'rss2_head', array( 'Pubsubhubbub_Topics', 'add_rss_link_tag' ) );
 
-		foreach ( $hub_urls as $hub_url ) {
-			printf( '<atom:link rel="hub" href="%s"/>', $hub_url ) . PHP_EOL;
-		}
-	}
-
-	/**
-	 * Add atom namespace to rdf-feed
-	 */
-	public static function add_rss_ns_link() {
-		echo ' xmlns:atom="http://www.w3.org/2005/Atom" ' . PHP_EOL;
-	}
-
-	/**
-	 * Add a link to our settings page in the WP menu
-	 */
-	public static function add_plugin_menu() {
-		add_options_page(
-			'WebSub/PubSubHubbub Settings',
-			'WebSub/PubSubHubbub',
-			'administrator',
-			'pubsubhubbub',
-			array(
-				'PubSubHubbub_Plugin',
-				'add_settings_page',
-			)
-		);
-	}
+	add_action( 'comments_atom_head', array( 'Pubsubhubbub_Topics', 'add_atom_link_tag' ) );
+	add_action( 'commentsrss2_head', array( 'Pubsubhubbub_Topics', 'add_rss_link_tag' ) );
 
-	/**
-	 * Write the content for our settings page that allows you to
-	 * define your endpoints
-	 */
-	public static function add_settings_page() {
-		load_template( plugin_dir_path( __FILE__ ) . 'templates/settings-page.php' );
-	}
+	add_action( 'rdf_ns', array( 'Pubsubhubbub_Topics', 'add_rss_ns_link' ) );
 
-	/**
-	 * Add a settings link next to deactive / edit
-	 */
-	public static function add_settings_link( $links, $file ) {
-		if ( 'pubsubhubbub/pubsubhubbub.php' == $file && function_exists( 'admin_url' ) ) {
-			$settings_link = '<a href="' . admin_url( 'options-general.php?page=pubsubhubbub' ) . '">' . __( 'Settings' ) . '</a>';
-			array_unshift( $links, $settings_link ); // before other links
-		}
-		return $links;
-	}
+	add_action( 'template_redirect', array( 'Pubsubhubbub_Topics', 'template_redirect' ) );
 
 	/**
-	 * Adds link headers as defined in the current v0.4 draft
+	 * Main class
 	 */
-	public static function template_redirect() {
-		// check if current url is one of the feed urls
-		if ( ! pubsubhubbub_show_discovery() ) {
-			return false;
-		}
-
-		$hub_urls = pubsubhubbub_get_hubs();
-		// add all "hub" headers
-		foreach ( $hub_urls as $hub_url ) {
-			header( sprintf( 'Link: <%s>; rel="hub"', $hub_url ), false );
-		}
+	require_once( dirname( __FILE__ ) . '/includes/class-pubsubhubbub.php' );
 
-		// add the "self" header
-		header( sprintf( 'Link: <%s>; rel="self"', pubsubhubbub_get_self_link() ), false );
-	}
+	add_action( 'init', array( 'PubSubHubbub', 'load_textdomain' ) );
 
 	/**
-	 * Register PubSubHubbub settings
+	 * Deprecated functions
 	 */
-	public static function register_settings() {
-		register_setting( 'pubsubhubbub_options', 'pubsubhubbub_endpoints' );
-	}
-
-	/**
-	 * Load the plugin textdomain.
-	 */
-	public static function load_textdomain() {
-		load_plugin_textdomain( 'pubsubhubbub', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
-	}
+	require_once( dirname( __FILE__ ) . '/includes/deprecated.php' );
 }
+
+add_action( 'plugins_loaded', 'pubsubhubbub_init' );
diff --git a/wp-content/plugins/pubsubhubbub/readme.txt b/wp-content/plugins/pubsubhubbub/readme.txt
index 4d2d86d7e..c933c0860 100644
--- a/wp-content/plugins/pubsubhubbub/readme.txt
+++ b/wp-content/plugins/pubsubhubbub/readme.txt
@@ -3,14 +3,14 @@ Contributors: pfefferle, joshfraz
 Donate link: https://notiz.blog/donate/
 Tags: webhooks, websub, puhsubhubbub, pubsub, ping, push, indieweb, openweb, ostatus
 Requires at least: 4.5
-Tested up to: 4.9.6
-Stable tag: 2.2.2
+Tested up to: 4.9.7
+Stable tag: 3.0.0
 
 A better way to tell the world when your blog is updated.
 
 == Description ==
 
-This plugin is a simple way to let people know in real-time when your blog is updated.  PubSubHubbub is widely adopted and is used by Google Reader, Google Alerts and many other services.  The latest version of the spec is called WebSub, and is developed by the W3C. Subscription requests are relayed through hubs, which validate and verify the request. Hubs then distribute new and updated content to subscribers when it becomes available.
+This plugin is a simple way to let people know in real-time when your blog is updated.  PubSubHubbub/WebSub is widely adopted and is used by Google Reader, Google Alerts and many other services.  Subscription requests are relayed through hubs, which validate and verify the request. Hubs then distribute new and updated content to subscribers when it becomes available.
 
 This plugin:
 
@@ -20,9 +20,8 @@ This plugin:
 * Supports all of the feed formats used by WordPress, not just ATOM and RSS2
 * Supports latest specs
 	* PubSubHubbub [Version 0.4](https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html)
-	* WebSub [Dev Version](https://www.w3.org/TR/websub/)
-* Announces which hubs you are using by adding `<link rel="hub" ...>` declarations to your template header and ATOM feed
-* Adds `<atom:link rel="hub" ...>` to your RSS feeds along with the necessary XMLNS declaration for RSS 0.92/1.0
+	* WebSub [W3C Version](https://www.w3.org/TR/websub/)
+* Announces which hubs you are using by adding `<link rel="hub" ...>` declarations to your template header and Atom feed
 
 By default this plugin will ping the following hubs:
 
@@ -39,13 +38,32 @@ Please contact me if you operate a hub that you would like to be included as a d
 
 == Frequently Asked Questions ==
 
+= What is WebSub? =
+
+WebSub provides a common mechanism for communication between publishers of any kind of Web content and their subscribers, based on HTTP web hooks. Subscription requests are relayed through hubs, which validate and verify the request. Hubs then distribute new and updated content to subscribers when it becomes available. WebSub was previously known as PubSubHubbub.
+
 = Where can I learn more about the WebSub protocol? =
 
-You can visit [WebSub on Github](https://github.com/w3c/websub "WebSub on Github")
+* [W3C Spec](https://www.w3.org/TR/websub/ "W3C Spec")
+* [WebSub on Github](https://github.com/w3c/websub "WebSub on Github")
+* [WebSub.rocks - a WebSub validator](https://websub.rocks/ "WebSub.rocks")
 
 = Where can I learn more about the PubsSubHubbub protocol? =
 
-You can visit [PubsSubHubbub on Github](https://github.com/pubsubhubbub "PubsSubHubbub on Github")
+* [PubsSubHubbub on Github](https://github.com/pubsubhubbub "PubsSubHubbub on Github")
+* [Latest Spec (0.4)](http://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html)
+
+= What is a Hub? =
+
+A WebSub Hub is an implementation that handles subscription requests and distributes the content to subscribers when the corresponding topic URL has been updated. Hubs MUST support subscription requests with a secret and deliver authenticated requests when requested. Hubs MUST deliver the full contents of the topic URL in the request, and MAY reduce the payload to a diff if the content type supports it.
+
+= What is a Publisher? =
+
+A WebSub Publisher is an implementation that advertises a topic and hub URL on one or more resource URLs.
+
+= What is a Subscriber? =
+
+A WebSub Subscriber is an implementation that discovers the hub and topic URL given a resource URL, subscribes to updates at the hub, and accepts content distribution requests from the hub. The subscriber MAY support authenticated content distribution.
 
 == Screenshots ==
 
@@ -55,6 +73,12 @@ You can visit [PubsSubHubbub on Github](https://github.com/pubsubhubbub "PubsSub
 
 Project maintained on github at [pubsubhubbub/wordpress-pubsubhubbub](https://github.com/pubsubhubbub/wordpress-pubsubhubbub).
 
+= 3.0.0 =
+
+* optimized the DB load
+* added help section
+* better code encapsulation
+
 = 2.2.2 =
 
 * temporarily remove comment-feed support to be more GDPR compliant
diff --git a/wp-content/plugins/pubsubhubbub/templates/settings-page.php b/wp-content/plugins/pubsubhubbub/templates/settings-page.php
index 450a3ef3a..35b504580 100644
--- a/wp-content/plugins/pubsubhubbub/templates/settings-page.php
+++ b/wp-content/plugins/pubsubhubbub/templates/settings-page.php
@@ -1,41 +1,31 @@
 <div class="wrap">
-<h2><?php _e( 'WebSub/PubSubHubbub', 'pubsubhubbub' ); ?></h2>
+	<h1><?php esc_html_e( 'WebSub/PubSubHubbub', 'pubsubhubbub' ); ?></h1>
 
-<h3><?php _e( 'Define custom hubs', 'pubsubhubbub' ); ?></h3>
+	<form method="post" action="options.php">
+		<?php settings_fields( 'pubsubhubbub' ); ?>
 
-<form method="post" action="options.php">
-<!-- starting -->
-<?php settings_fields( 'pubsubhubbub_options' ); ?>
-<?php do_settings_sections( 'pubsubhubbub_options' ); ?>
-<!-- ending -->
+		<h2 class="title"><?php esc_html_e( 'Publisher Settings', 'pubsubhubbub' ); ?></h2>
 
-<?php
-// load the existing pubsub endpoint list from the wordpress options table
-$pubsubhubbub_endpoints = trim( implode( PHP_EOL, pubsubhubbub_get_hubs() ), PHP_EOL );
-?>
+		<p><?php esc_html_e( 'A WebSub Publisher is an implementation that advertises a topic and hub URL on one or more resource URLs.', 'pubsubhubbub' ); ?></p>
 
-<table class="form-table">
-	<tr valign="top">
-		<th scope="row"><?php _e( 'Hubs (one per line)', 'pubsubhubbub' ); ?></th>
-		<td><textarea name="pubsubhubbub_endpoints" rows="10" cols="50" class="large-text"><?php echo $pubsubhubbub_endpoints; ?></textarea></td>
-	</tr>
-</table>
+		<?php
+		// load the existing pubsub endpoint list from the WordPress options table
+		$pubsubhubbub_endpoints = trim( implode( PHP_EOL, pubsubhubbub_get_hubs() ), PHP_EOL );
+		?>
 
-<?php submit_button(); ?>
+		<table class="form-table">
+			<tr valign="top">
+				<th scope="row"><?php _e( 'Hubs <small>(one per line)</small>', 'pubsubhubbub' ); ?></th>
+				<td>
+					<textarea name="pubsubhubbub_endpoints" id="pubsubhubbub_endpoints" rows="10" cols="50" class="large-text"><?php echo $pubsubhubbub_endpoints; ?></textarea>
+				</td>
+			</tr>
+		</table>
 
-</form>
+		<?php do_settings_fields( 'pubsubhubbub', 'publisher' ); ?>
 
-<h3><?php _e( 'Topic URLs', 'pubsubhubbub' ); ?></h3>
+		<?php do_settings_sections( 'pubsubhubbub' ); ?>
 
-<p><?php _e( 'These topic URLs will be send to the hub if you post a new, or update an existing post:', 'pubsubhubbub' ); ?></p>
-
-<ul>
-<?php foreach ( pubsubhubbub_get_topic_urls() as $topic_url ) { ?>
-	<li><pre><?php echo $topic_url; ?></pre></li>
-<?php } ?>
-</ul>
-
-<hr />
-
-<p><strong><?php _e( 'Thanks for using WebSub/PubSubHubbub!', 'pubsubhubbub' ); ?></strong></p>
+		<?php submit_button(); ?>
+	</form>
 </div>
-- 
GitLab