Making WordPress.org

Opened 5 months ago

Last modified 3 days ago

#8296 new enhancement

Show registered abilities

Reported by: superdav42 Owned by:
Priority: normal Milestone:
Component: Plugin Directory Keywords:
Cc:

Description

It would be very helpful to show any abilities, if any, are registered by plugins on their plugin repository listing. We already do something similar for blocks. If we could show the abilities users would know if a given plugin would work for the their workflow that uses abilities.

Change History (11)

This ticket was mentioned in ​Slack in #core-ai by superdav42. ​View the logs.


5 months ago

#2 @ancawonka
3 months ago

Plus one to this. It would not only help us decide which plugins to use for their abilities, but it would let more people know about the existence of abilities in general.

#3 @nikskyverge
3 months ago

Adding a +5 here. I had several people ask about this after my talk on the Abilities API at WCUS. Key themes in the feedback were developers wanting to showcase their work and users wanting to be able to discover plugins based on registered abilities.

From a platform perspective on the Core AI team, it would also help to have visibility into adoption of the API.

Ability registration is standardized, so should able to detect statically similar to/alongside the code scan for blocks.

This ticket was mentioned in ​Slack in #meta by nikskyverge. ​View the logs.


3 months ago

#5 @nikskyverge
3 months ago

To start putting some technical detail around this:

This ticket was mentioned in ​Slack in #meta by nikskyverge. ​View the logs.


3 months ago

​@justlevine commented on ​PR #1168:


9 days ago
#7

  1. core/* abilities. Should a plugin's own core/* registrations be listed? The AI plugin re-registers core/content-query, core/settings-get and core/users-query.

fwiw, my vote is yes. The fact that "core" is a reserved prefix is organizational, not prescriptive for wordpress-develops codebase. Can think of a bunch of hypotheticals in e.g. the importer plugins, two-fctor, MCP Adapter, or other in our growing catalog of Canonical Plugins etc that could make a good argument for prefixing some abilities with core/. We can turn it into a PCP sniff if we wanna enforce it, but why programmatically limit the PRT?

(Independent of this, I'm sharing again that I think our _experimental_ Core Abilities in the ai plugin/MCP adapter/shared package/wtvr should use something like core-experimental/* or some other prefix that isn't core, so we have a non-breaking migration path)

​nikmclaughlin commented on ​PR #1168:


9 days ago
#8

Agreed w/ @justlevine on 1 above, and I'd add that if we _did_ want to manage conflicts, dedupe abilities, or encourage different behavior from plugins, those solutions would better live elsewhere (PCP, Core Abilities API, etc.). Simply listing a plugin's registered abilities makes an clearer decision, IMO, that we should list ALL registered abilities, even if we decide that some of them are "doing it wrong".

  1. WooCommerce. Abilities that WooCommerce registers on a plugin's behalf, through woocommerce_ability_definition_classes, aren't detected.

Curious if we could get feedback from @nerrad & team on that. Short of direction from Woo, I think it makes sense from a .org perspective to only show abilities that are registered via Core registration patterns (i.e. hooked in to wp_abilities_api_init & calling wp_register_ability). The existing PR already accounts for indirect implementations that have been found across plugins generally (as mentioned: "Popular plugins rarely pass literals to wp_register_ability()"), but Woo's ability extension is more of a plugin-specific sub-ecosystem for abilities, rather than a pattern plugin devs are using to register abilities with Core. Put another way, it's my understanding that extensions using woocommerce_ability_definition_classes are looking to expose abilities in a WooCommerce-specific context, which .org doesn't need to cater toward.

​@dpknauss commented on ​PR #1168:


3 days ago
#9

This will be a terrific addition to .org — I've wanted neutral technical facts about plugins to be included there for a long time.

This might be out of scope, but here are two small additions that would make the stored data useful for security review, not just discovery:

  1. Exposure flags. Record meta.public, meta.show_in_rest, and meta.mcp.public when they resolve, and null when they don’t. They sit in the same args array the scanner already resolves for label and description. They control which channels expose an ability: REST uses show_in_rest and falls back to public, and MCP Adapter 0.7.x uses mcp.public and also falls back to public, ignoring show_in_rest.
  2. Authorization filter hooks. Record whether the plugin’s own code hooks wp_ability_permission_result or wp_pre_execute_ability, with file and line, plus bundled. Either filter can override an ability’s permission check. On a live site, a callback such as __return_true can’t be traced back to the plugin that added it, but the importer sees each plugin’s source on its own, so it can.

Neither field says whether an ability is safe, so they shouldn't be displayed as any kind of judgment like that. They'd tell reviewers, site owners, and agents where to look deeper.

​@dpknauss commented on ​PR #1168:


3 days ago
#10

Two refinements to my comment above:

  1. Exposure flags: for each value, it would help to record whether it was set explicitly, left out (so the documented fallback applies), or couldn't be resolved. A nullable boolean collapses the last two, which mean different things.
  2. Authorization hooks: the two filters don't do the same thing. wp_ability_permission_result changes the permission result. wp_pre_execute_ability can skip input preparation and the permission check entirely, whether for caching, denial, or a replacement result. So the record should name the hook and callback without inferring their effect. Also, the early register_ability / abilities_registry text check would skip a plugin that only hooks these filters without registering abilities, so hook detection would need its own relevance check.

​@dpknauss commented on ​PR #1168:


3 days ago
#11

Two refinements to my comment above:

  1. Exposure flags: for each value, it would help to record whether it was set explicitly, left out (so the documented fallback applies), or couldn't be resolved. A nullable boolean collapses the last two, which mean different things.
  2. Authorization hooks: the two filters don't do the same thing. wp_ability_permission_result changes the permission result. wp_pre_execute_ability can skip input preparation and the permission check entirely, whether for caching, denial, or a replacement result. So the record should name the hook and callback without inferring their effect. Also, the early register_ability / abilities_registry text check would skip a plugin that only hooks these filters without registering abilities, so hook detection would need its own relevance check.
Note: See TracTickets for help on using tickets.