diff --git a/README.md b/README.md index b32fc10..4e479a8 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ **Donate link:** https://notiz.blog/donate/ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 -**Tested up to:** 5.1.0 -**Stable tag:** 0.4.0 +**Tested up to:** 5.1 +**Stable tag:** 0.4.1 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -55,6 +55,10 @@ To implement: Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.4.1 ### + +* finally fixed contact list + ### 0.4.0 ### * added settings to enable/disable hashtag support diff --git a/activitypub.php b/activitypub.php index aef4845..44a397a 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.4.0 + * Version: 0.4.1 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/bin/deploy.sh b/bin/deploy.sh old mode 100644 new mode 100755 diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index 83ded6f..52f99d8 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,9 @@ "php": ">=5.3.0", "composer/installers": "~1.0" }, + "require-dev": { + "phpunit/phpunit": "^5.5" + }, "license": "MIT", "authors": [ { diff --git a/includes/class-db-activitypub-followers.php b/includes/class-db-activitypub-followers.php index 5b163f9..b6e9c18 100644 --- a/includes/class-db-activitypub-followers.php +++ b/includes/class-db-activitypub-followers.php @@ -9,20 +9,15 @@ class Db_Activitypub_Followers { return $followers; } - if ( count( $array ) == count( $array, COUNT_RECURSIVE ) ) { - return $followers; - } - foreach ( $followers as $key => $follower ) { if ( is_array( $follower ) && isset( $follower['type'] ) && 'Person' === $follower['type'] && isset( $follower['id'] ) && - true === filter_var( $follower['id'], FILTER_VALIDATE_URL ) + false !== filter_var( $follower['id'], FILTER_VALIDATE_URL ) ) { - unset( $followers[$key] ); - $followers[] = $follower['id']; + $followers[$key] = $follower['id']; } } @@ -38,7 +33,7 @@ class Db_Activitypub_Followers { isset( $actor['type'] ) && 'Person' === $actor['type'] && isset( $actor['id'] ) && - true === filter_var( $actor['id'], FILTER_VALIDATE_URL ) + false !== filter_var( $actor['id'], FILTER_VALIDATE_URL ) ) { $actor = $actor['id']; } diff --git a/languages/activitypub.pot b/languages/activitypub.pot index 6a51f19..d1c7ae0 100644 --- a/languages/activitypub.pot +++ b/languages/activitypub.pot @@ -2,9 +2,9 @@ # This file is distributed under the MIT. msgid "" msgstr "" -"Project-Id-Version: ActivityPub 0.4.0\n" +"Project-Id-Version: ActivityPub 0.4.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/activitypub\n" -"POT-Creation-Date: 2019-02-17 20:46:19+00:00\n" +"POT-Creation-Date: 2019-02-19 13:29:42+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -66,7 +66,7 @@ msgstr "" msgid "Fediverse" msgstr "" -#: includes/class-db-activitypub-followers.php:46 +#: includes/class-db-activitypub-followers.php:41 msgid "Unknown Actor schema" msgstr "" diff --git a/readme.txt b/readme.txt index 645547e..878477f 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: pfefferle Donate link: https://notiz.blog/donate/ Tags: OStatus, fediverse, activitypub, activitystream Requires at least: 4.7 -Tested up to: 5.1.0 -Stable tag: 0.4.0 +Tested up to: 5.1 +Stable tag: 0.4.1 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -55,6 +55,10 @@ To implement: Project maintained on github at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.4.1 = + +* finally fixed contact list + = 0.4.0 = * added settings to enable/disable hashtag support diff --git a/tests/test-class-db-activitypub-followers.php b/tests/test-class-db-activitypub-followers.php new file mode 100644 index 0000000..61f0f3d --- /dev/null +++ b/tests/test-class-db-activitypub-followers.php @@ -0,0 +1,18 @@ + 'Person', + 'id' => 'http://sally.example.org', + 'name' => 'Sally Smith', + ); + update_user_meta( 1, 'activitypub_followers', $followers ); + + $db_followers = Db_Activitypub_Followers::get_followers( 1 ); + + $this->assertEquals( 3, count( $db_followers ) ); + + $this->assertSame( array( 'https://example.com/author/jon', 'https://example.org/author/doe', 'http://sally.example.org' ), $db_followers ); + } +} diff --git a/tests/test.php b/tests/test.php deleted file mode 100644 index 0293fbc..0000000 --- a/tests/test.php +++ /dev/null @@ -1,6 +0,0 @@ -assertTrue( true ); - } -}