Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
updated WebSub support
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Jul 2, 2018
1 parent 184beab commit 523de43
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 21 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
**Tags:** ostatus, federated, mastodon, social, gnusocial, statusnet
**Donate link:** https://notiz.blog/donate/
**Requires at least:** 4.5
**Tested up to:** 4.9.2
**Stable tag:** 2.3.1
**Tested up to:** 4.9.6
**Stable tag:** 2.3.2
**License:** MIT
**License URI:** https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -39,11 +39,11 @@ Compatibility:

Plugin requirements:

* the `WebSub/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 `Salmon`-plugin: http://wordpress.org/plugins/salmon/
* the `ActivityStreams`-plugin: http://wordpress.org/plugins/activitystream-extension/
* the `WebSub/PubSubHubbub`-plugin: <https://wordpress.org/plugins/pubsubhubbub/>
* the `host-meta`-plugin: <https://wordpress.org/plugins/host-meta/>
* the `WebFinger`-plugin: <https://wordpress.org/plugins/webfinger/>
* the `Salmon`-plugin: <https://wordpress.org/plugins/salmon/>
* the `ActivityStreams`-plugin: <https://wordpress.org/plugins/activitystream-extension/>

## Installation ##

Expand All @@ -63,6 +63,10 @@ If you are the author of a relevant plugin, or are planning one, contact us to g

## Changelog ##

### 2.3.2 ###

* updated WebSub support

### 2.3.1 ###

* htmlspecialchars instead of htmlentities
Expand Down
10 changes: 5 additions & 5 deletions languages/ostatus-for-wordpress.pot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (C) 2017 Matthias Pfefferle
# Copyright (C) 2018 Matthias Pfefferle
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: OStatus 2.3.0\n"
"Project-Id-Version: OStatus 2.3.2\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/ostatus-for-wordpress\n"
"POT-Creation-Date: 2017-12-18 21:20:12+00:00\n"
"POT-Creation-Date: 2018-07-02 14:46:03+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"X-Generator: grunt-wp-i18n 0.5.4\n"
Expand Down Expand Up @@ -105,5 +105,5 @@ msgid "Matthias Pfefferle"
msgstr ""

#. Author URI of the plugin/theme
msgid "http://notiz.blog/"
msgid "https://notiz.blog/"
msgstr ""
22 changes: 21 additions & 1 deletion ostatus-for-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://notiz.blog/
* License: MIT
* License URI: http://opensource.org/licenses/MIT
* Version: 2.3.1
* Version: 2.3.2
* Text Domain: ostatus-for-wordpress
* Domain Path: /languages
*/
Expand Down Expand Up @@ -38,6 +38,7 @@ public static function init() {
add_action( 'do_feed_ostatus', array( 'Ostatus', 'do_feed_ostatus' ), 10, 1 );

add_filter( 'pubsubhubbub_feed_urls', array( 'Ostatus', 'pubsubhubbub_feed_urls' ), 10, 2 );
add_filter( 'pubsubhubbub_show_discovery', array( 'Ostatus', 'pubsubhubbub_show_discovery' ), 12 );

add_action( 'admin_init', array( 'Ostatus', 'text_domain' ) );
add_action( 'admin_menu', array( 'Ostatus', 'admin_menu' ) );
Expand Down Expand Up @@ -116,6 +117,25 @@ public static function pubsubhubbub_feed_urls( $feeds, $post_id ) {
return $feeds;
}

/**
* Enable discovery
*
* @return boolean;
*/
public static function pubsubhubbub_show_discovery( $show_discovery ) {
global $withcomments;

if ( ! $withcomments ) {
$withcomments = 0;
}

if ( is_feed( 'ostatus' ) && ( ( ! is_archive() && ! is_singular() && 0 == $withcomments ) || is_author() ) ) {
$show_discovery = true;
}

return $show_discovery;
}

/**
* Load plugin text domain
*/
Expand Down
5 changes: 4 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
<ruleset name="WordPress">
<description>WordPress Coding Standard.</description>
<rule ref="WordPress-Core"/>
<rule ref="WordPress-Core">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
</rule>
</ruleset>
18 changes: 11 additions & 7 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: pepijndevos, pfefferle
Tags: ostatus, federated, mastodon, social, gnusocial, statusnet
Donate link: https://notiz.blog/donate/
Requires at least: 4.5
Tested up to: 4.9.2
Stable tag: 2.3.1
Tested up to: 4.9.6
Stable tag: 2.3.2
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -39,11 +39,11 @@ Compatibility:

Plugin requirements:

* the `WebSub/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 `Salmon`-plugin: http://wordpress.org/plugins/salmon/
* the `ActivityStreams`-plugin: http://wordpress.org/plugins/activitystream-extension/
* the `WebSub/PubSubHubbub`-plugin: <https://wordpress.org/plugins/pubsubhubbub/>
* the `host-meta`-plugin: <https://wordpress.org/plugins/host-meta/>
* the `WebFinger`-plugin: <https://wordpress.org/plugins/webfinger/>
* the `Salmon`-plugin: <https://wordpress.org/plugins/salmon/>
* the `ActivityStreams`-plugin: <https://wordpress.org/plugins/activitystream-extension/>

== Installation ==

Expand All @@ -63,6 +63,10 @@ If you are the author of a relevant plugin, or are planning one, contact us to g

== Changelog ==

= 2.3.2 =

* updated WebSub support

= 2.3.1 =

* htmlspecialchars instead of htmlentities
Expand Down
1 change: 1 addition & 0 deletions templates/feed-ostatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<name><?php the_author() ?></name>
<summary type="html"><?php echo esc_html( get_the_author_meta( 'description' ) ); ?></summary>
<id><?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?></id>
<uri><?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?></uri>
<email><?php echo esc_html( ostatus_get_acct( get_the_author_meta( 'ID' ) ) ); ?></email>
<link rel="alternate" type="text/html" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?>" />
Expand Down

0 comments on commit 523de43

Please sign in to comment.