Make WordPress Core

Opened 3 weeks ago

Last modified 45 hours ago

#65020 new defect (bug)

Connectors: Support custom plugin is_active callback in connector registry and plugin status output

Reported by: iamadisingh's profile iamadisingh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: AI Keywords: connectors dev-feedback has-patch
Focuses: Cc:

Description

This changeset backports connector improvements from Gutenberg to Core:

  • Extend connector plugin metadata to support optional plugin.is_active callback.
  • Validate plugin.is_active as callable during WP_Connector_Registry::register().
  • Use plugin.is_active callback when building connector script-module data, with fallback to file_exists + is_plugin_active.
  • Update default Akismet connector to use a robust activity check: defined( AKISMET_VERSION ) && class_exists( Akismet, false ).

Some plugins (especially MU-loaded or non-standard load paths) cannot be reliably detected via is_plugin_active(file) alone. Allowing an explicit activity callback provides accurate activation state in connectors UI.

Change History (6)

#1 @gaisma22
12 days ago

  • Keywords dev-feedback added; needs-testing has-patch removed

No patch file or PR is attached to this ticket. The description contains code snippets but nothing that can be applied or tested. Removing has-patch and needs-testing. Adding dev-feedback as the changes need review from a developer with commit access first.

This ticket was mentioned in Slack in #core-test by gaisma22. View the logs.


12 days ago

#3 @JeffPaul
12 days ago

  • Keywords connectors added

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


8 days ago

This ticket was mentioned in PR #11565 on WordPress/wordpress-develop by @iamadisingh.


8 days ago
#5

  • Keywords has-patch added

Backport of wordpress/gutenberg#76994. Adds an optional is_active callable to the plugin definition when
registering a connector via WP_Connector_Registry::register().

The Connectors screen previously resolved a connector's active/installed status by checking is_plugin_active() and file_exists() against WP_PLUGIN_DIR only. Plugins installed as must-use plugins — or loaded from non-standard paths could not be detected this way, causing theirconnectors to disappear from the screen even though the plugin was in use.

Trac ticket: https://core.trac.wordpress.org/ticket/65020

@iamadisingh commented on PR #11565:


45 hours ago
#6

This PR has been updated to also address https://core.trac.wordpress.org/ticket/65099.

Note: See TracTickets for help on using tickets.