diff --git a/.editorconfig b/.editorconfig index 79207a4..0fcdf7f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,6 +17,3 @@ indent_size = 4 [{.jshintrc,*.json,*.yml}] indent_style = space indent_size = 2 - -[{*.txt,wp-config-sample.php}] -end_of_line = crlf diff --git a/README.md b/README.md index a4d9493..763adf4 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,42 @@ **Tags:** social network, ostatus, federated, bundle, mastodon, gnu, social, gnu-social, status-net **Requires at least:** 4.5 **Tested up to:** 4.7.4 -**Stable tag:** 2.1.0 +**Stable tag:** 2.2.0 A bundle of plugins that turn your blog into your private federated social network. ## Description ## -OStatus for Wordpress turns your blog into a federated social network. This means you can share and talk to everyone using the OStatus protocol, including users of Status.net/Identi.ca and Wordpress.com - -The Plugin is compatible to Mastodon, gnu.social and Status.NET. +OStatus for Wordpress turns your blog into a federated social network. This means you can share and talk to everyone using the OStatus protocol, including users of Status.net/Identi.ca, gnu.social, Friendica and Mastodon. For more information about OStatus visit the [OStatus Community Group](https://www.w3.org/community/ostatus/) This plugin bundles a few other plugins it requires to work, theses are installed automatically unless you have them already installed. -The plugin requires: +Compatibility: + +* Mastodon + * [x] Follow blog + * [ ] Follow GNU.social + * [x] Share blog-posts + * [ ] Share GNU.social-posts + * [x] Share GNU.social-comments + * [ ] Share blog-comments +* Mastodon + * [x] Follow blog + * [ ] Follow Mastodon + * [x] Share blog-posts + * [ ] Share Mastodon-posts + * [x] Share Mastodon-comments + * [ ] Share blog-comments +* Friendica + * not tested yet + +Plugin requirements: * the `PubSubHubBub`-plugin: http://wordpress.org/plugins/pubsubhubbub/ * the `host-meta`-plugin: http://wordpress.org/plugins/host-meta/ -* the `webfinger`-plugin: http://wordpress.org/plugins/webfinger/ +* the `WebFinger`-plugin: http://wordpress.org/plugins/webfinger/ * the `Salmon`-plugin: http://wordpress.org/plugins/salmon/ * the `ActivityStream extension`-plugin: http://wordpress.org/plugins/activitystream-extension/ @@ -38,6 +55,9 @@ yes please! ## Changelog ## +### 2.2.0 ### +* better compatibility with mastodon + ### 2.1.0 ### * some small tweaks * added header image support diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..2ef00ae --- /dev/null +++ b/includes/functions.php @@ -0,0 +1,28 @@ +user_login . '@' . parse_url( home_url(), PHP_URL_HOST ); + } else { + return ''; + } +} diff --git a/ostatus-for-wordpress.php b/ostatus-for-wordpress.php index 64a4d73..718fd64 100644 --- a/ostatus-for-wordpress.php +++ b/ostatus-for-wordpress.php @@ -7,7 +7,7 @@ * Author URI: http://notiz.blog/ * License: MIT * License URI: http://opensource.org/licenses/MIT - * Version: 2.1.0 + * Version: 2.2.0 * Text Domain: ostatus-for-wordpress * Domain Path: /languages */ @@ -26,11 +26,15 @@ class Ostatus { * Initialize the plugin, registering WordPress hooks. */ public static function init() { + require_once dirname( __FILE__ ) . '/includes/functions.php'; + add_filter( 'webfinger_user_data', array( 'Ostatus', 'webfinger' ), 10, 3 ); add_filter( 'host_meta', array( 'Ostatus', 'host_meta' ) ); - add_action( 'atom_ns', array( 'Ostatus', 'atom_add_poco_namespace' ) ); + add_action( 'atom_ns', array( 'Ostatus', 'atom_add_namespaces' ) ); add_action( 'atom_head', array( 'Ostatus', 'atom_add_global_author' ) ); + add_action( 'atom_author', array( 'Ostatus', 'atom_add_entry_author' ) ); + add_feed( 'ostatus', array( 'Ostatus', 'do_feed_ostatus' ) ); add_action( 'do_feed_ostatus', array( 'Ostatus', 'do_feed_ostatus' ), 10, 1 ); @@ -108,11 +112,11 @@ public static function pubsubhubbub_feed_urls( $feeds, $post_id ) { /** * Added PortableContacts namespace */ - public static function atom_add_poco_namespace() { + public static function atom_add_namespaces() { if ( is_author() && is_feed( 'ostatus' ) ) { - echo 'xmlns:poco="http://portablecontacts.net/spec/1.0"' . PHP_EOL; - echo 'xmlns:media="http://purl.org/syndication/atommedia"' . PHP_EOL; - echo 'xmlns:ostatus="http://ostatus.org/schema/1.0"' . PHP_EOL; + echo 'xmlns:poco="http://portablecontacts.net/spec/1.0/"' . PHP_EOL; + echo 'xmlns:media="http://purl.org/syndication/atommedia/"' . PHP_EOL; + echo 'xmlns:ostatus="http://ostatus.org/schema/1.0/"' . PHP_EOL; } } @@ -121,7 +125,16 @@ public static function atom_add_poco_namespace() { */ public static function atom_add_global_author() { if ( is_author() && is_feed( 'ostatus' ) ) { - load_template( dirname( __FILE__ ) . '/templates/atom-author.php' ); + load_template( dirname( __FILE__ ) . '/templates/feed-ostatus-author.php' ); + } + } + + /** + * Extend entry author of the OStatus Atom feed + */ + public static function atom_add_entry_author() { + if ( is_author() && is_feed( 'ostatus' ) ) { + load_template( dirname( __FILE__ ) . '/templates/feed-ostatus-entry-author.php' ); } } diff --git a/readme.txt b/readme.txt index cd8736c..4ade7fb 100644 --- a/readme.txt +++ b/readme.txt @@ -1,27 +1,45 @@ === OStatus === Contributors: pepijndevos, pfefferle +Donate link: http://14101978.de Tags: social network, ostatus, federated, bundle, mastodon, gnu, social, gnu-social, status-net Requires at least: 4.5 Tested up to: 4.7.4 -Stable tag: 2.1.0 +Stable tag: 2.2.0 A bundle of plugins that turn your blog into your private federated social network. == Description == -OStatus for Wordpress turns your blog into a federated social network. This means you can share and talk to everyone using the OStatus protocol, including users of Status.net/Identi.ca and Wordpress.com - -The Plugin is compatible to Mastodon, gnu.social and Status.NET. +OStatus for Wordpress turns your blog into a federated social network. This means you can share and talk to everyone using the OStatus protocol, including users of Status.net/Identi.ca, gnu.social, Friendica and Mastodon. For more information about OStatus visit the [OStatus Community Group](https://www.w3.org/community/ostatus/) This plugin bundles a few other plugins it requires to work, theses are installed automatically unless you have them already installed. -The plugin requires: +Compatibility: + +* Mastodon + * [x] Follow blog + * [ ] Follow GNU.social + * [x] Share blog-posts + * [ ] Share GNU.social-posts + * [x] Share GNU.social-comments + * [ ] Share blog-comments +* Mastodon + * [x] Follow blog + * [ ] Follow Mastodon + * [x] Share blog-posts + * [ ] Share Mastodon-posts + * [x] Share Mastodon-comments + * [ ] Share blog-comments +* Friendica + * not tested yet + +Plugin requirements: * the `PubSubHubBub`-plugin: http://wordpress.org/plugins/pubsubhubbub/ * the `host-meta`-plugin: http://wordpress.org/plugins/host-meta/ -* the `webfinger`-plugin: http://wordpress.org/plugins/webfinger/ +* the `WebFinger`-plugin: http://wordpress.org/plugins/webfinger/ * the `Salmon`-plugin: http://wordpress.org/plugins/salmon/ * the `ActivityStream extension`-plugin: http://wordpress.org/plugins/activitystream-extension/ @@ -38,6 +56,9 @@ yes please! == Changelog == += 2.2.0 = +* better compatibility with mastodon + = 2.1.0 = * some small tweaks * added header image support diff --git a/templates/atom-author.php b/templates/feed-ostatus-author.php similarity index 75% rename from templates/atom-author.php rename to templates/feed-ostatus-author.php index 72fd4db..fede1e5 100644 --- a/templates/atom-author.php +++ b/templates/feed-ostatus-author.php @@ -1,7 +1,9 @@ http://activitystrea.ms/schema/1.0/person + + @@ -9,5 +11,5 @@ - + diff --git a/templates/feed-ostatus-entry-author.php b/templates/feed-ostatus-entry-author.php new file mode 100644 index 0000000..718c09a --- /dev/null +++ b/templates/feed-ostatus-entry-author.php @@ -0,0 +1,11 @@ + + + + + + + + + + +