Skip to content

Commit 053a08d

Browse files
committed
added NodeInfo2 support
1 parent fbac1a2 commit 053a08d

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

languages/webmention.pot

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the MIT.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Webmention 3.8.7\n"
5+
"Project-Id-Version: Webmention 3.8.8\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/webmention\n"
7-
"POT-Creation-Date: 2018-11-07 16:56:55+00:00\n"
7+
"POT-Creation-Date: 2018-11-28 16:53:10+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"

readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
**Tags:** webmention, pingback, trackback, linkback, indieweb, comment, response
77
**Requires at least:** 4.7
88
**Tested up to:** 4.9.9
9-
**Stable tag:** 3.8.7
9+
**Stable tag:** 3.8.8
1010
**Requires PHP:** 5.2
1111
**License:** MIT
1212
**License URI:** http://opensource.org/licenses/MIT
@@ -80,6 +80,10 @@ As Webmention uses the REST API endpoint system, most up to date caching plugins
8080

8181
Project and support maintained on github at [pfefferle/wordpress-webmention](https://github.com/pfefferle/wordpress-webmention).
8282

83+
### 3.8.8 ###
84+
85+
* Added NodeInfo(2) support
86+
8387
### 3.8.7 ###
8488

8589
* Fixed default value of `webmention_avatars` on the settings page

readme.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://notiz.blog/donate/
44
Tags: webmention, pingback, trackback, linkback, indieweb, comment, response
55
Requires at least: 4.7
66
Tested up to: 4.9.9
7-
Stable tag: 3.8.7
7+
Stable tag: 3.8.8
88
Requires PHP: 5.2
99
License: MIT
1010
License URI: http://opensource.org/licenses/MIT
@@ -78,6 +78,10 @@ As Webmention uses the REST API endpoint system, most up to date caching plugins
7878

7979
Project and support maintained on github at [pfefferle/wordpress-webmention](https://github.com/pfefferle/wordpress-webmention).
8080

81+
= 3.8.8 =
82+
83+
* Added NodeInfo(2) support
84+
8185
= 3.8.7 =
8286

8387
* Fixed default value of `webmention_avatars` on the settings page

webmention.php

+33-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Webmention support for WordPress posts
66
* Author: Matthias Pfefferle
77
* Author URI: https://notiz.blog/
8-
* Version: 3.8.7
8+
* Version: 3.8.8
99
* License: MIT
1010
* License URI: http://opensource.org/licenses/MIT
1111
* Text Domain: webmention
@@ -77,6 +77,9 @@ public static function init() {
7777

7878
add_action( 'comment_form_after', array( 'Webmention_Plugin', 'comment_form' ), 11 );
7979

80+
add_filter( 'nodeinfo_data', array( 'Webmention_Plugin', 'nodeinfo' ), 10, 2 );
81+
add_filter( 'nodeinfo2_data', array( 'Webmention_Plugin', 'nodeinfo2' ), 10 );
82+
8083
// remove old Webmention code
8184
remove_action( 'init', array( 'WebMentionFormPlugin', 'init' ) );
8285
remove_action( 'init', array( 'WebMentionForCommentsPlugin', 'init' ) );
@@ -127,4 +130,33 @@ public static function pings_open( $open, $post_id ) {
127130
public static function plugin_textdomain() {
128131
load_plugin_textdomain( 'webmention', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
129132
}
133+
134+
/**
135+
* Extend NodeInfo data
136+
*
137+
* @param array $nodeinfo NodeInfo data
138+
* @param array $version updated data
139+
*/
140+
public static function nodeinfo( $nodeinfo, $version ) {
141+
if ( '2.0' == $version) {
142+
$nodeinfo['protocols'][] = 'webmention';
143+
} else {
144+
$nodeinfo['protocols']['inbound'][] = 'webmention';
145+
$nodeinfo['protocols']['outbound'][] = 'webmention';
146+
}
147+
148+
return $nodeinfo;
149+
}
150+
151+
/**
152+
* Extend NodeInfo2 data
153+
*
154+
* @param array $nodeinfo NodeInfo2 data
155+
* @param array $version updated data
156+
*/
157+
public static function nodeinfo2( $nodeinfo ) {
158+
$nodeinfo['protocols'][] = 'webmention';
159+
160+
return $nodeinfo;
161+
}
130162
}

0 commit comments

Comments
 (0)