Help enabling Webfinger / Activity Pub
-
Good afternoon,
I am reaching out because I am attempting to connect my website to the Fediverse/Activity Pub and there seems to be a direct conflict coming from this plugin and I am not sure how to fix it.
My website seems to partially connect to ActivityPub, but Shield seems to be blocking access to https://thecozy.cat/.well-known/webfinger?resource=acct%3Aaevisia%40thecozy.cat which needs to be publicly viewable in order to work. When the Shield plugin is activated, my website throws a critical error when accessing that link. When I disable the Shield plugin, the link works fine and as it should, so it must be something Shield is blocking that is preventing access to this URL. I’ve gone through and tested all the settings I could think of that could be causing this issue, but am having no luck.
I am hoping support may be able to point me in the right direction to resolving this so I can continue to use ActivityPub with my website as well as keep my website protected. Thank you!
EDIT: This screenshot is what is visible when the shield plugin is deactivated, in case this information is needed.
- This topic was modified 1 year ago by aevisia.
The page I need help with: [log in to see the link]
-
Hi,
Sorry to hear that.
Under the main Config menu > Lockdown section, have you tried to disable the following options?:
- Disable XML-RPC
- Anonymous Rest API
If that doesn’t help, can you check your site admin email inbox and send us the error details, please? When a critical error occurs, WordPress sends email with error details. Email subject is “Your Site is Experiencing a Technical Issue”.
If you haven’t received it, please reproduce the error and then open up and review the web Console and/or Network tab (for AJAX/XHR requests). You may see errors there. This suggests something is going wrong with the request and there are errors being generated for some reason. The console will help highlight why this is happening, but then it may need investigation of PHP error logs to see what’s going wrong. Please check your PHP/Apache error logs. Once you can see the errors, we can probably point to the source of the issue quickly.
Let us know what you find especially if you see error logs and entries around the time the problem occurred and we’ll help however we can.
Thanks.
Hi Jelena, thank you for your help. I did try disabling those options and sadly it had no effect. I also didn’t receive any emails, likely due to the fact I just transferred my website over to a VPS a couple days ago and need to set up SMTP before I can get that functionality working.
I did as you said and got the error from the console. Here are the screenshots of the results in full.
Console:
.
Network:
.
.
I don’t have Apache, but using OpenLiteSpeed. Here is the error log for that:
2 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(148): apply_filters() 3 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::generate_user_data() 4 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 5 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(69): apply_filters() 6 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::parse_request() 7 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action() 9 /var/www/html/wp-includes/class-wp.php(418): do_action_ref_array() 10 /var/www/html/wp-includes/class-wp.php(813): WP->parse_request() 11 /var/www/html/wp-includes/functions.php(1336): WP->main() 12 /var/www/html/wp-blog-header.php(16): wp() 13 /var/www/html/index.php(17): require(‘…’) 14 {main}
thrown in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php on line 36
2023-11-20 17:23:19.252122 [NOTICE] [10469] [172.70.179.44:48068#wordpress] [STDERR] PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_url() in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php:36
Stack trace: 0 /var/www/html/wp-includes/class-wp-hook.php(324): Activitypub\Integration\Webfinger::add_user_discovery() 1 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(148): apply_filters() 3 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::generate_user_data() 4 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 5 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(69): apply_filters() 6 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::parse_request() 7 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action() 9 /var/www/html/wp-includes/class-wp.php(418): do_action_ref_array() 10 /var/www/html/wp-includes/class-wp.php(813): WP->parse_request() 11 /var/www/html/wp-includes/functions.php(1336): WP->main() 12 /var/www/html/wp-blog-header.php(16): wp() 13 /var/www/html/index.php(17): require(‘…’) 14 {main}thrown in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php on line 36
2023-11-20 17:47:40.397500 [NOTICE] [578] [172.70.126.156:60450#wordpress] [STDERR] PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_url() in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php:36
Stack trace: 0 /var/www/html/wp-includes/class-wp-hook.php(324): Activitypub\Integration\Webfinger::add_user_discovery() 1 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(148): apply_filters() 3 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::generate_user_data() 4 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 5 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(69): apply_filters() 6 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::parse_request() 7 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action() 9 /var/www/html/wp-includes/class-wp.php(418): do_action_ref_array() 10 /var/www/html/wp-includes/class-wp.php(813): WP->parse_request() 11 /var/www/html/wp-includes/functions.php(1336): WP->main() 12 /var/www/html/wp-blog-header.php(16): wp() 13 /var/www/html/index.php(17): require(‘…’) 14 {main}thrown in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php on line 36
.
.
Here is the WordPress debug log:
[20-Nov-2023 17:51:56 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_url() in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php:36
Stack trace: 0 /var/www/html/wp-includes/class-wp-hook.php(324): Activitypub\Integration\Webfinger::add_user_discovery() 1 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(148): apply_filters() 3 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::generate_user_data() 4 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() 5 /var/www/html/wp-content/plugins/webfinger/includes/class-webfinger.php(69): apply_filters() 6 /var/www/html/wp-includes/class-wp-hook.php(324): Webfinger::parse_request() 7 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 8 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action() 9 /var/www/html/wp-includes/class-wp.php(418): do_action_ref_array() 10 /var/www/html/wp-includes/class-wp.php(813): WP->parse_request() 11 /var/www/html/wp-includes/functions.php(1336): WP->main() 12 /var/www/html/wp-blog-header.php(16): wp() 13 /var/www/html/index.php(17): require(‘…’) 14 {main}thrown in /var/www/html/wp-content/plugins/activitypub/integration/class-webfinger.php on line 36
.
.
And lastly, here is the php file for class-webfinger as detected in the wordpress debug log:
<?php namespace Activitypub\Integration; use Activitypub\Rest\Webfinger as Webfinger_Rest; use Activitypub\Collection\Users as User_Collection; /** * Compatibility with the WebFinger plugin * * @see https://www.ads-software.com/plugins/webfinger/ */ class Webfinger { /** * Initialize the class, registering WordPress hooks */ public static function init() { \add_filter( 'webfinger_user_data', array( self::class, 'add_user_discovery' ), 10, 3 ); \add_filter( 'webfinger_data', array( self::class, 'add_pseudo_user_discovery' ), 99, 2 ); } /** * Add WebFinger discovery links * * @param array $array the jrd array * @param string $resource the WebFinger resource * @param WP_User $user the WordPress user * * @return array the jrd array */ public static function add_user_discovery( $array, $resource, $user ) { $user = User_Collection::get_by_id( $user->ID ); $array['links'][] = array( 'rel' => 'self', 'type' => 'application/activity+json', 'href' => $user->get_url(), ); return $array; } /** * Add WebFinger discovery links * * @param array $array the jrd array * @param string $resource the WebFinger resource * @param WP_User $user the WordPress user * * @return array the jrd array */ public static function add_pseudo_user_discovery( $array, $resource ) { if ( $array ) { return $array; } return Webfinger_Rest::get_profile( $resource ); } }
Hi,
Thanks for your help to work to the bottom of this.
Shield doesn’t issue 500 server errors – these are caused typically by PHP fatal errors, so there’s an error in your PHP somewhere.
The error logs you provided indicate that the errros are directly being caused within the “activitypub” plugin. They are fatal PHP errors and you’ll want to report these to them to fix for you – they’re not pertaining to Shield.
I hope this helps and if after the other party reviews their fatal errors that in some way Shield is discovered to be affecting this in some way we’re not aware of, please have them pass along the full details of how Shield is affecting this and we’ll help however we can.
Many thanks.
Paul.Hi Paul, thank you for your reply. I will check with the activitypub author but that still does not explain why the critical error happens ONLY when I have the Shield plugin activated. Why would that be if Shield is not affecting it in some way?
Hi,
conflicts happen, this is normal with WordPress. But when a plugin generates a fatal error when running alongside another, they’ll have to be the ones to work out why exactly that is… We wouldn’t know their code, sorry.
Hello, I am the maintainer of the ActivityPub plugin and plugin seems to fail, because a param that is required/expected will not be provided.
I can fix the plugin, that is does better handle that error, but as @aevisia already pointed out, that will not fix the issue.
But I understand your point @paultgoodchild
I just installed the shield and can not reproduce the issue.
Is there a way to import the settings of @aevisia ???
Hi Matthias – what is the parameter that is required/expected? If you can tell us that, we’ll ensure it’s done correctly in our plugin going forward. Let us know and we’ll help however we can.
Thanks!
@pfefferle thank you for looking into this issue further, it is appreciated! Are you looking to get my shield settings? I will check when I get home from work and see if there is a way to export them somehow. @paultgoodchild do you know off the bat if this is something possible to do so I can send it to @pfefferle?
Just checking to see if there’s any update regarding my last reply? I checked and couldn’t find any options to export my shield settings. One of my primary reasons for getting a VPS was to be able to get it set up with Activitypub. Really hoping to get this resolved soon. ??
@paultgoodchild is there a way to export my shield settings that I might have missed? I’d like to get @pfefferle the information he needs so that this can be resolved.
Thanks!
Hi,
Import and export of options is a premium feature. My suggestion would be to wait until the developer fixes the fatal errors and then see where you stand after that. And/Or provide them with access to your site to debug the issue directly.
We can provide more direct support, but this is again a service provided only to our ShieldPRO members.
This isn’t an appropriate venue to discuss premium membership, so if this is something you’re interested to discuss further please reach out to us directly.
Thanks!
- The topic ‘Help enabling Webfinger / Activity Pub’ is closed to new replies.