Skip to content

Commit d781011

Browse files
authored
improve error messages and codes (#532)
* improve error messages and codes * version bump
1 parent e91334e commit d781011

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Tags:** OStatus, fediverse, activitypub, activitystream
44
**Requires at least:** 4.7
55
**Tested up to:** 6.3
6-
**Stable tag:** 1.0.9
6+
**Stable tag:** 1.0.10
77
**Requires PHP:** 5.6
88
**License:** MIT
99
**License URI:** http://opensource.org/licenses/MIT
@@ -105,6 +105,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides.
105105

106106
Project maintained on GitHub at [automattic/wordpress-activitypub](https://github.com/automattic/wordpress-activitypub).
107107

108+
### 1.0.10 ###
109+
110+
* Improved: better error messages if remote profile is not accessible
111+
108112
### 1.0.9 ###
109113

110114
* Fixed: broken following endpoint

activitypub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: ActivityPub
44
* Plugin URI: https://github.com/pfefferle/wordpress-activitypub/
55
* Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.
6-
* Version: 1.0.9
6+
* Version: 1.0.10
77
* Author: Matthias Pfefferle & Automattic
88
* Author URI: https://automattic.com/
99
* License: MIT

includes/class-signature.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public static function verify_http_signature( $request ) {
328328
public static function get_remote_key( $key_id ) { // phpcs:ignore
329329
$actor = get_remote_metadata_by_actor( strip_fragment_from_url( $key_id ) ); // phpcs:ignore
330330
if ( \is_wp_error( $actor ) ) {
331-
return $actor;
331+
return new WP_Error( 'activitypub_no_remote_profile_found', __( 'No Profile found or Profile not accessible', 'activitypub' ), array( 'status' => 401 ) );
332332
}
333333
if ( isset( $actor['publicKey']['publicKeyPem'] ) ) {
334334
return \rtrim( $actor['publicKey']['publicKeyPem'] ); // phpcs:ignore

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: automattic, pfefferle, mediaformat, mattwiebe, akirk, jeherve, nur
33
Tags: OStatus, fediverse, activitypub, activitystream
44
Requires at least: 4.7
55
Tested up to: 6.3
6-
Stable tag: 1.0.9
6+
Stable tag: 1.0.10
77
Requires PHP: 5.6
88
License: MIT
99
License URI: http://opensource.org/licenses/MIT
@@ -105,6 +105,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides.
105105

106106
Project maintained on GitHub at [automattic/wordpress-activitypub](https://github.com/automattic/wordpress-activitypub).
107107

108+
= 1.0.10 =
109+
110+
* Improved: better error messages if remote profile is not accessible
111+
108112
= 1.0.9 =
109113

110114
* Fixed: broken following endpoint

0 commit comments

Comments
 (0)