close

Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

#64818 closed defect (bug) (fixed)

Fatal error with AI Connectors

Reported by: clifgriffin's profile clifgriffin Owned by:
Milestone: 7.0 Priority: normal
Severity: critical Version: trunk
Component: AI Keywords: has-patch needs-testing
Focuses: Cc:

Description

Installed WP 7.0 beta3 and got this fatal as soon as I installed the Google/Gemini connector.

This doesn't seem specific to the Google AI connector as the the Anthropic and OpenAI providers do not have a getAuthenticationMethod method either.

Stacktrace:

[05-Mar-2026 22:03:58 UTC] PHP Fatal error:  Uncaught Error: Call to undefined method WordPress\AiClient\Providers\DTO\ProviderMetadata::getAuthenticationMethod() in /Users/cliftongriffin/Sites/cfwdev/wp-includes/connectors.php:164
Stack trace:
#0 /Users/cliftongriffin/Sites/cfwdev/wp-includes/connectors.php(285): _wp_connectors_get_connector_settings()
#1 /Users/cliftongriffin/Sites/cfwdev/wp-includes/class-wp-hook.php(341): _wp_register_default_connector_settings('')
#2 /Users/cliftongriffin/Sites/cfwdev/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
#3 /Users/cliftongriffin/Sites/cfwdev/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#4 /Users/cliftongriffin/Sites/cfwdev/wp-settings.php(774): do_action('init')
#5 /Users/cliftongriffin/Sites/cfwdev/wp-config.php(114): require_once('/Users/cliftong...')
#6 /Users/cliftongriffin/Sites/cfwdev/wp-load.php(50): require_once('/Users/cliftong...')
#7 /Users/cliftongriffin/Sites/cfwdev/wp-admin/admin-ajax.php(22): require_once('/Users/cliftong...')
#8 /Applications/Herd.app/Contents/Resources/valet/server.php(167): require('/Users/cliftong...')
#9 {main}
  thrown in /Users/cliftongriffin/Sites/cfwdev/wp-includes/connectors.php on line 164

Change History (10)

#1 Image @johnbillion
4 weeks ago

  • Milestone changed from Awaiting Review to 7.0
  • Version set to trunk

#3 Image @maulikmakwana2008
4 weeks ago

  • Keywords needs-testing added

I was able to reproduce this issue on WordPress 7.0-beta3.

The fatal error occurs in wp-includes/connectors.php when calling
$provider_metadata->getAuthenticationMethod().

However, the ProviderMetadata class used by several providers
(Google/Gemini, OpenAI, Anthropic) does not implement this method,
which results in a fatal error:

Call to undefined method ProviderMetadata::getAuthenticationMethod().

This patch adds a method_exists() check before calling the method
to prevent the fatal error when the provider metadata does not
implement getAuthenticationMethod().

Tested locally with AI connectors enabled and confirmed that the
fatal error no longer occurs.

#4 Image @kimclow
4 weeks ago

Were you using any specific connectors? I used AI Engine to connect my test site with ChatGPT and Claude. I was able to successfully add my API keys with no errors. However, when I added the Chatbot to my post page, I started running into issues.

I got a critical error warning in WP Admin (that messaged faded before I took my screenshot), and on the front end, the site was down: https://d.pr/i/0LNeWx

See console errors here: https://d.pr/i/bMeVCo

Image

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


4 weeks ago

#6 Image @huzaifaalmesbah
4 weeks ago

Reproduction Report

Environment

  • WordPress: 7.0-beta3-61849-src
  • PHP: 8.2.29
  • Server: nginx/1.29.5
  • Database: mysqli (Server: 8.4.8 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • AI Provider for Anthropic 1.0.2
    • AI Provider for Google 1.0.2
    • AI Provider for OpenAI 1.0.2
    • Classic Editor 1.6.7
    • Test Reports 1.2.1

Steps taken

  1. Installed a fresh WordPress 7.0-beta3 environment.
  2. Logged into the WordPress admin dashboard.
  3. Navigated to Settings → Connectors.
  4. From the Connectors page, attempted to install the available AI providers:
    • Anthropic
    • Google
    • OpenAI
  5. Entered the required API keys for the providers.
  6. Saved the settings and confirmed the API connections were successful.
  7. Navigated through the admin dashboard and tested the connector settings page
  8. ❌ Bug is not occurring

Additional Notes

I was not able to reproduce the fatal error described in the ticket.
Could someone please share the exact steps required to reproduce the issue, including:

  • Whether a specific connector must be used (Google, OpenAI, or Anthropic)
  • Whether a particular plugin or workflow triggers the issue
  • Whether the error occurs during installation, activation, or when using the connector

This information would help testers reproduce the issue more reliably.

#7 Image @clifgriffin
3 weeks ago

After more testing, it turns out that this error happens when the Plugin Check plugin is active:
https://wordpress.org/plugins/plugin-check/

Confirmed with WP 7.0b5

#8 Image @siliconforks
3 weeks ago

This sounds like the same thing as #64697 then? (See this comment.)

#9 Image @nilambar
3 weeks ago

This has been fixed in "trunk" in Plugin Check https://github.com/WordPress/plugin-check/pull/1195

#10 Image @gziolo
3 weeks ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.