WebSub/PubSubHubbub - Version 3.1.1

Version Description

  • fix deprecation issue (PHP8)
  • add _deprecated_function warnings
Download this release

Release Info

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

Code changes from version 3.1.0 to 3.1.1

includes/class-pubsubhubbub-publisher.php CHANGED
@@ -11,38 +11,7 @@ class PubSubHubbub_Publisher {
11
  */
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
48
  self::publish_to_hub( $feed_urls );
@@ -166,4 +135,46 @@ class PubSubHubbub_Publisher {
166
 
167
  return apply_filters( 'pubsubhubbub_hub_urls', $hub_urls );
168
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
11
  */
12
  public static function publish_post( $post_id ) {
13
  // we want to notify the hub for every feed
14
+ $feed_urls = self::get_feed_urls_by_post_id( $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  // publish them
17
  self::publish_to_hub( $feed_urls );
135
 
136
  return apply_filters( 'pubsubhubbub_hub_urls', $hub_urls );
137
  }
138
+
139
+ /**
140
+ * Returns a list of feed URLs for a given Post
141
+ *
142
+ * @param int $post_id The post ID
143
+ *
144
+ * @return array An array of feed URLs
145
+ */
146
+ public static function get_feed_urls_by_post_id( $post_id ) {
147
+ $post = get_post( $post_id );
148
+
149
+ $feed_types = pubsubhubbub_get_supported_feed_types();
150
+
151
+ foreach ( $feed_types as $feed_type ) {
152
+ $feed_urls[] = get_feed_link( $feed_type );
153
+
154
+ // add tag-feeds
155
+ $tags = wp_get_post_tags( $post_id );
156
+
157
+ foreach ( $tags as $tag ) {
158
+ $feed_urls[] = get_term_feed_link( $tag->term_id, 'post_tag', $feed_type );
159
+ }
160
+
161
+ // add category-feeds
162
+ $categories = wp_get_post_categories( $post_id );
163
+
164
+ foreach ( $categories as $category ) {
165
+ $feed_urls[] = get_term_feed_link( $category, 'category', $feed_type );
166
+ }
167
+
168
+ // add author-feeds
169
+ $feed_urls[] = get_author_feed_link( $post->post_author, $feed_type );
170
+ }
171
+
172
+ if ( current_theme_supports( 'microformats2' ) ) {
173
+ $feed_urls[] = site_url( '/' );
174
+ }
175
+
176
+ $feed_urls = apply_filters( 'pubsubhubbub_feed_urls', $feed_urls, $post_id );
177
+
178
+ return $feed_urls;
179
+ }
180
  }
includes/deprecated.php CHANGED
@@ -5,7 +5,9 @@
5
  *
6
  * @deprecated
7
  */
8
- function publish_to_hub( $deprecated = null, $feed_urls ) {
 
 
9
  PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
10
  }
11
 
@@ -17,6 +19,8 @@ function publish_to_hub( $deprecated = null, $feed_urls ) {
17
  * @deprecated
18
  */
19
  function pshb_publish_to_hub( $feed_urls ) {
 
 
20
  PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
21
  }
22
 
@@ -30,6 +34,8 @@ function pshb_publish_to_hub( $feed_urls ) {
30
  * @deprecated
31
  */
32
  function pshb_feed_urls( $feed_urls ) {
 
 
33
  return apply_filters( 'pshb_feed_urls', $feed_urls );
34
  }
35
  add_filter( 'pubsubhubbub_feed_urls', 'pshb_feed_urls' );
5
  *
6
  * @deprecated
7
  */
8
+ function publish_to_hub( $deprecated, $feed_urls ) {
9
+ _deprecated_function( __FUNCTION__, '3.0.0', 'pubsubhubbub_publish_to_hub()' );
10
+
11
  PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
12
  }
13
 
19
  * @deprecated
20
  */
21
  function pshb_publish_to_hub( $feed_urls ) {
22
+ _deprecated_function( __FUNCTION__, '3.0.0', 'pubsubhubbub_publish_to_hub()' );
23
+
24
  PubSubHubbub_Publisher::publish_to_hub( $feed_urls );
25
  }
26
 
34
  * @deprecated
35
  */
36
  function pshb_feed_urls( $feed_urls ) {
37
+ _deprecated_function( __FUNCTION__, '3.0.0', 'get_feed_urls_by_post_id()' );
38
+
39
  return apply_filters( 'pshb_feed_urls', $feed_urls );
40
  }
41
  add_filter( 'pubsubhubbub_feed_urls', 'pshb_feed_urls' );
includes/functions.php CHANGED
@@ -52,18 +52,18 @@ function pubsubhubbub_get_self_link() {
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' ) );
52
  }
53
 
54
  /**
55
+ * Return the list of feed types that are supported by PubSubHubbub
56
  *
57
+ * @return array List of supported feed types
58
  */
59
  function pubsubhubbub_get_supported_feed_types() {
60
  return apply_filters( 'pubsubhubbub_supported_feed_types', array( 'atom', 'rss2' ) );
61
  }
62
 
63
  /**
64
+ * Return the list of comment feed types that are supported by PubSubHubbub
65
  *
66
+ * @return array List of supported comment feed types
67
  */
68
  function pubsubhubbub_get_supported_comment_feed_types() {
69
  return apply_filters( 'pubsubhubbub_supported_comment_feed_types', array( 'atom', 'rss2' ) );
languages/pubsubhubbub.pot CHANGED
@@ -1,11 +1,11 @@
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"
@@ -209,16 +209,16 @@ msgstr ""
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
 
@@ -238,8 +238,20 @@ msgstr ""
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
@@ -251,7 +263,7 @@ msgid "A better way to tell the world when your blog is updated."
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
1
+ # Copyright (C) 2021 PubSubHubbub Team
2
  # This file is distributed under the MIT.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WebSub (FKA. PubSubHubbub) 3.1.1\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wordpress-pubsubhubbub\n"
8
+ "POT-Creation-Date: 2021-10-24 10:40:10+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
209
  msgid "<a href=\"https://notiz.blog/donate\">Donate</a>"
210
  msgstr ""
211
 
212
+ #: includes/class-pubsubhubbub-publisher.php:45
213
  msgid "Please specify a hub url"
214
  msgstr ""
215
 
216
+ #: includes/class-pubsubhubbub-publisher.php:50
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:54
222
  msgid "Please specify a topic url"
223
  msgstr ""
224
 
238
  msgid "Hubs <small>(one per line)</small>"
239
  msgstr ""
240
 
241
+ #: templates/settings-page.php:31
242
+ msgid "Example"
243
+ msgstr ""
244
+
245
+ #: templates/settings-page.php:42
246
+ msgid "For the article:"
247
+ msgstr ""
248
+
249
+ #: templates/settings-page.php:49
250
+ msgid "...the following feed-URLs will be published:"
251
+ msgstr ""
252
+
253
  #. Plugin Name of the plugin/theme
254
+ msgid "WebSub (FKA. PubSubHubbub)"
255
  msgstr ""
256
 
257
  #. Plugin URI of the plugin/theme
263
  msgstr ""
264
 
265
  #. Author of the plugin/theme
266
+ msgid "PubSubHubbub Team"
267
  msgstr ""
268
 
269
  #. Author URI of the plugin/theme
pubsubhubbub.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /**
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
1
  <?php
2
  /**
3
+ * Plugin Name: WebSub (FKA. 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.1
7
+ * Author: PubSubHubbub Team
8
  * Author URI: https://github.com/pubsubhubbub/wordpress-pubsubhubbub
9
  * License: MIT
10
  * License URI: http://opensource.org/licenses/MIT
readme.txt CHANGED
@@ -6,7 +6,7 @@ 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,6 +75,11 @@ A WebSub Subscriber is an implementation that discovers the hub and topic URL gi
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)
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.1
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.1 =
79
+
80
+ * fix deprecation issue (PHP8)
81
+ * add `_deprecated_function` warnings
82
+
83
  = 3.1.0 =
84
 
85
  * update wording (more consequent use of WebSub)