Conversation
Register ActivityPub abilities (discovery, social) for the WordPress Abilities API (WP 6.9+), enabling other plugins to discover and call ActivityPub operations without depending on internal class structures.
|
I think it's a great path but I need to test how viable it is for each use case! |
|
There a some things that I like within the current state, that is using public methods of the ActivityPub plugin directly: the Event Bridge plugin utilizes PHPStan in automated tests which gives very good feedback where things might break before they do, and if there is a long enough deprecation warning I get clear indicators for needed maintenance. I get clear hints, when not calling methods right, or not handling the returns correctly in all edge cases. And a question about the examples above, Isn't this example missing, who is the 'actor' and who is the 'target'? Edit: checked the source. $result = wp_run_ability( 'activitypub/follow', array(
'actor' => 'organizer@events.example.com',
) );The Abilities API is new to me, it's the first time I hear about it. To be honest, another factor that makes me hesitate committing to it is that it has been designed to be useful for LLMs, maybe even at the expense of potential stability clever human-made solutions can offer. |
|
Or are there any linters already available that take the ability API use into account? |
- Gate follow/unfollow abilities behind `activitypub_following_ui` option - Require `manage_options` for cross-user operations (follow, unfollow, get-following) - Rename `activitypub/get-actor-info` to `activitypub/get-actor` - Remove empty placeholder categories (publish, moderation)
Proposed changes:
resolve-handle,get-actor-info) and Social (get-followers,get-following,follow,unfollow).activitypub_register_ability_categories,activitypub_register_abilities) so third-party plugins can register additional abilities.Why this matters
Plugins like Friends or Events Bridge for ActivityPub currently call internal classes (
Collection\Followers,Collection\Following, etc.) directly. If we refactor those classes, those plugins break. The Abilities API provides a stable contract: plugins call abilities by name, and we can change the internal implementation freely.PHP usage examples for other plugins
Discover abilities at runtime:
Get followers (e.g. Friends plugin showing a follower list):
Get following:
Follow a remote actor (e.g. Events Bridge auto-following an event organizer):
Unfollow:
Resolve a WebFinger handle:
Look up a remote actor profile:
Register additional abilities from a third-party plugin:
All abilities are also exposed via REST at
/wp-json/wp-abilities/v1/abilities/activitypub/*when the Abilities API is active.Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Add WordPress Abilities API integration for plugin interoperability.