WebSub/PubSubHubbub - Version 3.1.0

Version Description

  • update wording (more consequent use of WebSub)
  • add category-, tag- and author-feeds support
Download this release

Release Info

Developer pfefferle
Plugin Icon 128x128 WebSub/PubSubHubbub
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.3 to 3.1.0

.svnignore DELETED
@@ -1,32 +0,0 @@
1
- .DS_Store
2
- .editorconfig
3
- .git
4
- .gitignore
5
- .travis.yml
6
- .codeclimate.yml
7
- .data
8
- .svnignore
9
- Gruntfile.js
10
- LINGUAS
11
- Makefile
12
- README.md
13
- readme.md
14
- CODE_OF_CONDUCT.md
15
- LICENSE.md
16
- _site
17
- bin
18
- composer.json
19
- composer.lock
20
- docker-compose.yml
21
- gulpfile.js
22
- package.json
23
- node_modules
24
- npm-debug.log
25
- phpcs.xml
26
- package.json
27
- phpunit.xml
28
- phpunit.xml.dist
29
- tests
30
- node_modules
31
- vendor
32
- package-lock.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-pubsubhubbub-admin.php CHANGED
@@ -8,8 +8,8 @@ class Pubsubhubbub_Admin {
8
  */
9
  public static function add_plugin_menu() {
10
  $options_page = add_options_page(
11
- 'WebSub/PubSubHubbub Settings',
12
- 'WebSub/PubSubHubbub',
13
  'administrator',
14
  'pubsubhubbub',
15
  array(
8
  */
9
  public static function add_plugin_menu() {
10
  $options_page = add_options_page(
11
+ 'WebSub Settings',
12
+ 'WebSub',
13
  'administrator',
14
  'pubsubhubbub',
15
  array(
includes/class-pubsubhubbub-publisher.php CHANGED
@@ -12,14 +12,36 @@ class PubSubHubbub_Publisher {
12
  public static function publish_post( $post_id ) {
13
  // we want to notify the hub for every feed
14
  $feed_urls = array();
15
- $feed_urls[] = get_bloginfo( 'atom_url' );
16
- $feed_urls[] = get_bloginfo( 'rdf_url' );
17
- $feed_urls[] = get_bloginfo( 'rss2_url' );
18
 
19
  if ( current_theme_supports( 'microformats2' ) ) {
20
  $feed_urls[] = site_url( '/' );
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  $feed_urls = apply_filters( 'pubsubhubbub_feed_urls', $feed_urls, $post_id );
24
 
25
  // publish them
12
  public static function publish_post( $post_id ) {
13
  // we want to notify the hub for every feed
14
  $feed_urls = array();
 
 
 
15
 
16
  if ( current_theme_supports( 'microformats2' ) ) {
17
  $feed_urls[] = site_url( '/' );
18
  }
19
 
20
+ $post = get_post( $post_id );
21
+
22
+ $feed_types = pubsubhubbub_get_supported_feed_types();
23
+
24
+ foreach ( $feed_types as $feed_type ) {
25
+ $feed_urls[] = get_feed_link( $feed_type );
26
+
27
+ // add tag-feeds
28
+ $tags = wp_get_post_tags( $post_id );
29
+
30
+ foreach ( $tags as $tag ) {
31
+ $feed_urls[] = get_term_feed_link( $tag->term_id, 'post_tag', $feed_type );
32
+ }
33
+
34
+ // add category-feeds
35
+ $categories = wp_get_post_categories( $post_id );
36
+
37
+ foreach ( $categories as $category ) {
38
+ $feed_urls[] = get_term_feed_link( $category, 'category', $feed_type );
39
+ }
40
+
41
+ // add author-feeds
42
+ $feed_urls[] = get_author_feed_link( $post->post_author, $feed_type );
43
+ }
44
+
45
  $feed_urls = apply_filters( 'pubsubhubbub_feed_urls', $feed_urls, $post_id );
46
 
47
  // publish them
includes/functions.php CHANGED
@@ -24,20 +24,14 @@ function pubsubhubbub_get_hubs() {
24
  * @return boolean
25
  */
26
  function pubsubhubbub_show_discovery() {
27
- global $withcomments;
28
-
29
- if ( ! $withcomments ) {
30
- $withcomments = 0;
31
- }
32
-
33
  $show_discovery = false;
34
 
35
- $supported_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_feed_types', array( 'atom', 'rss2', 'rdf' ) );
36
- $supported_comment_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_comment_feed_types', array( 'atom', 'rss2' ) );
37
 
38
  if (
39
- ( is_feed( $supported_feed_types ) && ! is_archive() && ! is_singular() && 0 == $withcomments ) ||
40
- ( is_feed( $supported_comment_feed_types ) && 1 == $withcomments ) ||
41
  ( is_home() && current_theme_supports( 'microformats2' ) )
42
  ) {
43
  $show_discovery = true;
@@ -56,3 +50,21 @@ function pubsubhubbub_get_self_link() {
56
 
57
  return esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  * @return boolean
25
  */
26
  function pubsubhubbub_show_discovery() {
 
 
 
 
 
 
27
  $show_discovery = false;
28
 
29
+ $supported_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_feed_types', pubsubhubbub_get_supported_feed_types() );
30
+ $supported_comment_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_comment_feed_types', pubsubhubbub_get_supported_comment_feed_types() );
31
 
32
  if (
33
+ ( is_feed( $supported_feed_types ) && ! is_date() && ! is_post_type_archive() && ! is_singular() ) ||
34
+ ( is_feed( $supported_comment_feed_types ) && is_singular() ) ||
35
  ( is_home() && current_theme_supports( 'microformats2' ) )
36
  ) {
37
  $show_discovery = true;
50
 
51
  return esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
52
  }
53
+
54
+ /**
55
+ * Undocumented function
56
+ *
57
+ * @return void
58
+ */
59
+ function pubsubhubbub_get_supported_feed_types() {
60
+ return apply_filters( 'pubsubhubbub_supported_feed_types', array( 'atom', 'rss2' ) );
61
+ }
62
+
63
+ /**
64
+ * Undocumented function
65
+ *
66
+ * @return void
67
+ */
68
+ function pubsubhubbub_get_supported_comment_feed_types() {
69
+ return apply_filters( 'pubsubhubbub_supported_comment_feed_types', array( 'atom', 'rss2' ) );
70
+ }
languages/pubsubhubbub.pot CHANGED
@@ -1,18 +1,18 @@
1
- # Copyright (C) 2019 Matthias Pfefferle
2
  # This file is distributed under the MIT.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WebSub/PubSubHubbub 3.0.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wordpress-pubsubhubbub\n"
8
- "POT-Creation-Date: 2019-07-26 07:58:30+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
- "X-Generator: grunt-wp-i18n1.0.2\n"
16
 
17
  #: includes/class-pubsubhubbub-admin.php:39
18
  msgid "The WebSub/PubSubHubbub endpoints"
@@ -39,7 +39,7 @@ msgstr ""
39
  msgid "Publisher"
40
  msgstr ""
41
 
42
- #: includes/class-pubsubhubbub-admin.php:62 templates/settings-page.php:9
43
  msgid ""
44
  "A WebSub Publisher is an implementation that advertises a topic and hub URL "
45
  "on one or more resource URLs."
@@ -209,31 +209,39 @@ msgstr ""
209
  msgid "<a href=\"https://notiz.blog/donate\">Donate</a>"
210
  msgstr ""
211
 
212
- #: includes/class-pubsubhubbub-publisher.php:54
213
  msgid "Please specify a hub url"
214
  msgstr ""
215
 
216
- #: includes/class-pubsubhubbub-publisher.php:59
217
  #. translators: %s is the $hub_url
218
  msgid "The specified hub url does not appear to be valid: %s"
219
  msgstr ""
220
 
221
- #: includes/class-pubsubhubbub-publisher.php:63
222
  msgid "Please specify a topic url"
223
  msgstr ""
224
 
225
- #. Plugin Name of the plugin/theme
226
- msgid "WebSub/PubSubHubbub"
 
 
 
 
227
  msgstr ""
228
 
229
- #: templates/settings-page.php:7
230
  msgid "Publisher Settings"
231
  msgstr ""
232
 
233
- #: templates/settings-page.php:18
234
  msgid "Hubs <small>(one per line)</small>"
235
  msgstr ""
236
 
 
 
 
 
237
  #. Plugin URI of the plugin/theme
238
  msgid "https://github.com/pubsubhubbub/wordpress-pubsubhubbub/"
239
  msgstr ""
@@ -243,9 +251,9 @@ msgid "A better way to tell the world when your blog is updated."
243
  msgstr ""
244
 
245
  #. Author of the plugin/theme
246
- msgid "Matthias Pfefferle"
247
  msgstr ""
248
 
249
  #. Author URI of the plugin/theme
250
- msgid "https://notiz.blog/"
251
  msgstr ""
1
+ # Copyright (C) 2021 Josh Fraser and Matthias Pfefferle
2
  # This file is distributed under the MIT.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: WebSub/PubSubHubbub 3.0.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wordpress-pubsubhubbub\n"
8
+ "POT-Creation-Date: 2021-07-20 10:51:19+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
16
 
17
  #: includes/class-pubsubhubbub-admin.php:39
18
  msgid "The WebSub/PubSubHubbub endpoints"
39
  msgid "Publisher"
40
  msgstr ""
41
 
42
+ #: includes/class-pubsubhubbub-admin.php:62 templates/settings-page.php:8
43
  msgid ""
44
  "A WebSub Publisher is an implementation that advertises a topic and hub URL "
45
  "on one or more resource URLs."
209
  msgid "<a href=\"https://notiz.blog/donate\">Donate</a>"
210
  msgstr ""
211
 
212
+ #: includes/class-pubsubhubbub-publisher.php:76
213
  msgid "Please specify a hub url"
214
  msgstr ""
215
 
216
+ #: includes/class-pubsubhubbub-publisher.php:81
217
  #. translators: %s is the $hub_url
218
  msgid "The specified hub url does not appear to be valid: %s"
219
  msgstr ""
220
 
221
+ #: includes/class-pubsubhubbub-publisher.php:85
222
  msgid "Please specify a topic url"
223
  msgstr ""
224
 
225
+ #: templates/settings-page.php:2
226
+ msgid "WebSub"
227
+ msgstr ""
228
+
229
+ #: templates/settings-page.php:2
230
+ msgid "(FKA. PubSubhubbub)"
231
  msgstr ""
232
 
233
+ #: templates/settings-page.php:6
234
  msgid "Publisher Settings"
235
  msgstr ""
236
 
237
+ #: templates/settings-page.php:17
238
  msgid "Hubs <small>(one per line)</small>"
239
  msgstr ""
240
 
241
+ #. Plugin Name of the plugin/theme
242
+ msgid "WebSub/PubSubHubbub"
243
+ msgstr ""
244
+
245
  #. Plugin URI of the plugin/theme
246
  msgid "https://github.com/pubsubhubbub/wordpress-pubsubhubbub/"
247
  msgstr ""
251
  msgstr ""
252
 
253
  #. Author of the plugin/theme
254
+ msgid "Josh Fraser and Matthias Pfefferle"
255
  msgstr ""
256
 
257
  #. Author URI of the plugin/theme
258
+ msgid "https://github.com/pubsubhubbub/wordpress-pubsubhubbub"
259
  msgstr ""
pubsubhubbub.php CHANGED
@@ -3,9 +3,9 @@
3
  * Plugin Name: WebSub/PubSubHubbub
4
  * Plugin URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub/
5
  * Description: A better way to tell the world when your blog is updated.
6
- * Version: 3.0.3
7
- * Author: Matthias Pfefferle
8
- * Author URI: https://notiz.blog/
9
  * License: MIT
10
  * License URI: http://opensource.org/licenses/MIT
11
  * Text Domain: pubsubhubbub
3
  * Plugin Name: WebSub/PubSubHubbub
4
  * Plugin URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub/
5
  * Description: A better way to tell the world when your blog is updated.
6
+ * Version: 3.1.0
7
+ * Author: Josh Fraser and Matthias Pfefferle
8
+ * Author URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub
9
  * License: MIT
10
  * License URI: http://opensource.org/licenses/MIT
11
  * Text Domain: pubsubhubbub
readme.txt CHANGED
@@ -1,10 +1,12 @@
1
- === WebSub/PubSubHubbub ===
2
  Contributors: pfefferle, joshfraz
3
  Donate link: https://notiz.blog/donate/
4
- Tags: webhooks, websub, puhsubhubbub, pubsub, ping, push, indieweb, openweb, ostatus
 
 
5
  Requires at least: 4.5
6
- Tested up to: 5.2.2
7
- Stable tag: 3.0.3
8
 
9
  A better way to tell the world when your blog is updated.
10
 
@@ -73,6 +75,11 @@ A WebSub Subscriber is an implementation that discovers the hub and topic URL gi
73
 
74
  Project maintained on github at [pubsubhubbub/wordpress-pubsubhubbub](https://github.com/pubsubhubbub/wordpress-pubsubhubbub).
75
 
 
 
 
 
 
76
  = 3.0.3 =
77
 
78
  * update dependencies
1
+ === WebSub (FKA. PubSubHubbub) ===
2
  Contributors: pfefferle, joshfraz
3
  Donate link: https://notiz.blog/donate/
4
+ Author: PubSubHubbub Team
5
+ Author URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub
6
+ Tags: webhook, websub, pubsub, ping, indieweb, ostatus
7
  Requires at least: 4.5
8
+ Tested up to: 5.8
9
+ Stable tag: 3.1.0
10
 
11
  A better way to tell the world when your blog is updated.
12
 
75
 
76
  Project maintained on github at [pubsubhubbub/wordpress-pubsubhubbub](https://github.com/pubsubhubbub/wordpress-pubsubhubbub).
77
 
78
+ = 3.1.0 =
79
+
80
+ * update wording (more consequent use of WebSub)
81
+ * add category-, tag- and author-feeds support
82
+
83
  = 3.0.3 =
84
 
85
  * update dependencies
templates/settings-page.php CHANGED
@@ -1,6 +1,5 @@
1
  <div class="wrap">
2
- <h1><?php esc_html_e( 'WebSub/PubSubHubbub', 'pubsubhubbub' ); ?></h1>
3
-
4
  <form method="post" action="options.php">
5
  <?php settings_fields( 'pubsubhubbub' ); ?>
6
 
1
  <div class="wrap">
2
+ <h1><?php esc_html_e( 'WebSub', 'pubsubhubbub' ); ?> <small><?php esc_html_e( '(FKA. PubSubhubbub)', 'pubsubhubbub' ); ?></small></h1>
 
3
  <form method="post" action="options.php">
4
  <?php settings_fields( 'pubsubhubbub' ); ?>
5