Make WordPress Core

Opened 10 days ago

Closed 3 days ago

Last modified 2 days ago

#64697 closed defect (bug) (reported-upstream)

Getting fatal error on 7.0-beta.1

Reported by: gautammkgarg's profile gautammkgarg Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: AI Keywords:
Focuses: Cc:

Description

I am getting below Fatal error while visiting any page of WordPress 7.0-beta.1

Fatal error: Declaration of WP_AI_Client_HTTP_Client::sendRequestWithOptions(WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface must be compatible with WordPress\AiClient\Providers\Http\Contracts\ClientWithOptionsInterface::sendRequestWithOptions(Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): Psr\Http\Message\ResponseInterface in C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-includes\ai-client\adapters\class-wp-ai-client-http-client.php on line 101

Change History (25)

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


10 days ago

#2 @mukesh27
10 days ago

  • Keywords reporter-feedback added
  • Severity changed from blocker to normal
  • Version set to trunk

Hi @gautammkgarg

Welcome to trac and thanks for the ticket!

Have you get the error without any plugin activated? Share your Site Health info if possible.

#3 @gautammkgarg
10 days ago

I found the root cause of the issue. Below plugin is causing this issue. even if we keep this plugin in deactivated state, it's triggering the fatal error.

Plugin URL: https://wordpress.org/plugins/plugin-check/
Version: 1.8.0

#4 @gautammkgarg
10 days ago

@mukesh27, are you facing the same issue with "Plugin Check" plugin installed?

#5 @andy_moyle
10 days ago

I am getting the same error with Plugin Check installed. I deleted that plugin and my test site came back up.

Plugin URL: ​https://wordpress.org/plugins/plugin-check/
Version: 1.8.0

Last edited 10 days ago by andy_moyle (previous) (diff)

#6 @gautammkgarg
10 days ago

  • Keywords reporter-feedback removed

#7 @nikunj8866
10 days ago

  • Keywords 2nd-opinion added

Reproduction Report

Description

❌ This report validates that the issue cannot be reproduced.

Environment

  • WordPress: 7.0-beta1
  • PHP: 8.2.27
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
  • Browser: Chrome 145.0.0.0
  • OS: Windows 10/11
  • Theme: Storefront 4.6.1
  • MU Plugins: None activated
  • Plugins:
    • Plugin Check (PCP) 1.8.0
    • Test Reports 1.2.1
    • WordPress Beta Tester 3.6.5

Steps to Reproduce

  1. Install WordPress 7.0-beta1 via Beta Tester plugin.
  2. Install and activate the Plugin Check plugin (version 1.8.0).

Actual Results

  1. ❌ Error condition doesn't occur (can't be reproduced).

Supplemental Artifacts

https://screenrec.com/share/TIcMV0UamY

#8 @vishitshah
10 days ago

The same issue was traced back to the Plugin Check plugin. After removing it, the test site was restored and is now functioning normally.

Plugin URL: ​https://wordpress.org/plugins/plugin-check/
Version: 1.8.0

#9 @huzaifaalmesbah
10 days ago

Environment

  • WordPress: 7.0-beta1-61715
  • PHP: 8.2.30
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Four 1.4
  • MU Plugins: None activated
  • Plugins:
    • Plugin Check (PCP) 1.8.0
    • Test Reports 1.2.1

I tested the issue using the above environment configuration, but I am unable to reproduce the fatal error.

@gautammkgarg @andy_moyle @vishitshah Could you please share detailed, step-by-step reproduction steps starting from a fresh WordPress install?

If possible, please also share a screencast demonstrating the exact sequence of actions that lead to the fatal error.

This will help us accurately isolate and investigate the root cause.

#10 @vishitshah
10 days ago

Hi @huzaifaalmesbah,

I downloaded and set up WordPress 7.0 Beta 1 on my test site. After installing and activating the Plugin Check (PCP) plugin, the website stopped working and showed a fatal error.

It appears that Plugin Check is not currently compatible with WordPress 7.0 Beta 1. Once I removed the plugin, the site started working normally again.

Last edited 10 days ago by vishitshah (previous) (diff)

#11 @mukesh27
10 days ago

  • Keywords close added

I made a testing site https://upholdafterthought.s6-tastewp.com/ and install and activate plugin Check plugin and didn't reproduce the issue.

Site health report:

### wp-core ###

version: 7.0-beta1-61715
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%year%/%monthnum%/%day%/%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 1
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /s6-upholdafterthought/wordpress
wordpress_size: 119.02 MB (124799305 bytes)
uploads_path: /s6-upholdafterthought/wordpress/wp-content/uploads
uploads_size: 66.00 B (66 bytes)
themes_path: /s6-upholdafterthought/wordpress/wp-content/themes
themes_size: 44.80 MB (46971108 bytes)
plugins_path: /s6-upholdafterthought/wordpress/wp-content/plugins
plugins_size: 41.82 MB (43851354 bytes)
fonts_path: /s6-upholdafterthought/wordpress/wp-content/uploads/fonts
fonts_size: directory not found
database_size: 960.00 KB (983040 bytes)
total_size: 206.57 MB (216604873 bytes)

### wp-dropins (1) ###

maintenance.php: true

### wp-active-theme ###

name: Twenty Twenty-Five (twentytwentyfive)
version: 1.4
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates, post-formats, editor-style
theme_path: /s6-upholdafterthought/wordpress/wp-content/themes/twentytwentyfive
auto_update: Disabled

### wp-themes-inactive (14) ###

Twenty Eleven: version: 5.0, author: the WordPress team, Auto-updates disabled
Twenty Fifteen: version: 4.1, author: the WordPress team, Auto-updates disabled
Twenty Fourteen: version: 4.4, author: the WordPress team, Auto-updates disabled
Twenty Nineteen: version: 3.2, author: the WordPress team, Auto-updates disabled
Twenty Seventeen: version: 4.0, author: the WordPress team, Auto-updates disabled
Twenty Sixteen: version: 3.7, author: the WordPress team, Auto-updates disabled
Twenty Ten: version: 4.5, author: the WordPress team, Auto-updates disabled
Twenty Thirteen: version: 4.5, author: the WordPress team, Auto-updates disabled
Twenty Twelve: version: 4.7, author: the WordPress team, Auto-updates disabled
Twenty Twenty: version: 3.0, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Four: version: 1.4, author: the WordPress team, Auto-updates disabled
Twenty Twenty-One: version: 2.7, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.6, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Two: version: 2.1, author: the WordPress team, Auto-updates disabled

### wp-plugins-active (1) ###

Plugin Check (PCP): version: 1.8.0, author: WordPress Performance Team and Plugin Review Team, Auto-updates disabled

### wp-plugins-inactive (4) ###

Akismet Anti-spam: Spam Protection: version: 5.6, author: Automattic - Anti-spam Team, Auto-updates disabled
Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled
WP Console: version: 2.6.0, author: Edi Amin, Auto-updates disabled
WP File Manager: version: 8.0.2, author: mndpsingh287, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1692
imagemagick_version: ImageMagick 6.9.12-98 Q16 x86_64 18038 https://legacy.imagemagick.org
imagick_version: 3.8.1
file_uploads: 1
post_max_size: 60M
upload_max_filesize: 60M
max_effective_size: 60 MB
max_file_uploads: 20
imagick_limits: 
	imagick::RESOURCETYPE_AREA: 244 MB
	imagick::RESOURCETYPE_DISK: 2147483648
	imagick::RESOURCETYPE_FILE: 768
	imagick::RESOURCETYPE_MAP: 2 GB
	imagick::RESOURCETYPE_MEMORY: 1 GB
	imagick::RESOURCETYPE_THREAD: 1
	imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: Unable to determine
image_format_transforms: image/heic → image/jpeg, image/heif → image/jpeg, image/heic-sequence → image/jpeg, image/heif-sequence → image/jpeg
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: unknown

### wp-server ###

server_architecture: Linux 6.8.0-90-generic x86_64
httpd_software: TasteWP-S6 Official/3.0.0 (nginx fork)
php_version: 8.5.3 64bit
php_sapi: fpm-fcgi
max_input_variables: 5000
time_limit: 100
memory_limit: 256M
max_input_time: 30
upload_max_filesize: 60M
php_post_max_size: 60M
curl_version: 8.5.0 OpenSSL/3.0.13
suhosin: false
imagick_availability: true
opcode_cache: not available
pretty_permalinks: true
static_robotstxt_file: false
current: 2026-02-23T09:43:38+00:00
utc-time: Monday, 23-Feb-26 09:43:38 UTC
server-time: 2026-02-23T09:43:37+00:00

### wp-database ###

extension: mysqli
server_version: 8.0.45-0ubuntu0.24.04.1
client_version: mysqlnd 8.5.3
max_allowed_packet: 268435456
max_connections: 1000

### wp-constants ###

WP_HOME: https://upholdafterthought.s6-tastewp.com
WP_SITEURL: https://upholdafterthought.s6-tastewp.com
WP_CONTENT_DIR: /s6-upholdafterthought/wordpress/wp-content
WP_PLUGIN_DIR: /s6-upholdafterthought/wordpress/wp-content/plugins
WP_MEMORY_LIMIT: 128M
WP_MAX_MEMORY_LIMIT: 128M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: /s6-upholdafterthought/wordpress/debug.log
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: true
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined
EMPTY_TRASH_DAYS: 30

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: does not exist

#12 @gautammkgarg
10 days ago

  • Keywords 2nd-opinion close removed

I tried setting up fresh WordPress 7.0 Beta 1, but I could not replicate the issue on the fresh installation. But on my old WordPress instance, I am getting the issue. I am sharing more details about my existing instance, maybe it help finding the exact issue.

Error Logs:

[23-Feb-2026 09:41:27 UTC] PHP Fatal error:  Declaration of WP_AI_Client_HTTP_Client::sendRequestWithOptions(WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface must be compatible with WordPress\AiClient\Providers\Http\Contracts\ClientWithOptionsInterface::sendRequestWithOptions(Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): Psr\Http\Message\ResponseInterface in C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-includes\ai-client\adapters\class-wp-ai-client-http-client.php on line 101
[23-Feb-2026 09:41:27 UTC] PHP Stack trace:
[23-Feb-2026 09:41:27 UTC] PHP   1. {main}() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-admin\site-health.php:0
[23-Feb-2026 09:41:27 UTC] PHP   2. require_once() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-admin\site-health.php:10
[23-Feb-2026 09:41:27 UTC] PHP   3. require_once() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-admin\admin.php:35
[23-Feb-2026 09:41:27 UTC] PHP   4. require_once() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-load.php:50
[23-Feb-2026 09:41:27 UTC] PHP   5. require_once() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-config.php:108
[23-Feb-2026 09:41:27 UTC] PHP   6. require() C:\Users\Gautam\Local Sites\wordpress-dev\app\public\wp-settings.php:290


Site Heath Info after deleting Plugin Check plugin

`
### wp-core ###

version: 7.0-beta1-61715
site_language: en_US
user_language: en_US
timezone: +05:30
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 1
blog_public: 1
default_comment_status: open
environment_type: local
user_count: 6
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public
wordpress_size: loading...
uploads_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/uploads
uploads_size: loading...
themes_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/themes
themes_size: loading...
plugins_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/plugins
plugins_size: loading...
fonts_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/uploads/fonts
fonts_size: loading...
database_size: loading...
total_size: loading...

### wp-dropins (1) ###

object-cache.php: true

### wp-active-theme ###

name: Twenty Twenty-Five (twentytwentyfive)
version: 1.4
author: the WordPress team
author_website: https://wordpress.org
parent_theme: none
theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, widgets-block-editor, block-templates, post-formats, editor-style
theme_path: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/themes/twentytwentyfive
auto_update: Disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1808
imagemagick_version: ImageMagick 7.1.0-18 Q16 x64 2021-12-14 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
imagick_limits: 
	imagick::RESOURCETYPE_AREA: 31 GB
	imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
	imagick::RESOURCETYPE_FILE: 1536
	imagick::RESOURCETYPE_MAP: 31 GB
	imagick::RESOURCETYPE_MEMORY: 16 GB
	imagick::RESOURCETYPE_THREAD: 1
	imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLIF, FLV, FPX, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YAML, YCbCr, YCbCrA, YUV
image_format_transforms: image/heic → image/jpeg, image/heif → image/jpeg, image/heic-sequence → image/jpeg, image/heif-sequence → image/jpeg
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: not available

### wp-server ###

server_architecture: Windows NT 10.0 AMD64
httpd_software: nginx/1.26.1
php_version: 8.4.16 64bit
php_sapi: cgi-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 256M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 8.16.0 OpenSSL/3.0.18
suhosin: false
imagick_availability: true
opcode_cache: true
opcode_cache_memory_usage: 49626384 of 132156912
opcode_cache_interned_strings_usage: 91.37% of 8388608 (724024 free)
opcode_cache_hit_rate: 98.61
opcode_cache_full: false
pretty_permalinks: true
htaccess_extra_rules: false
static_robotstxt_file: false
current: 2026-02-23T09:42:55+00:00
utc-time: Monday, 23-Feb-26 09:42:55 UTC
server-time: 2026-02-23T15:12:50+05:30

### wp-database ###

extension: mysqli
server_version: 8.0.35
client_version: mysqlnd 8.4.16
max_allowed_packet: 1073741824
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content
WP_PLUGIN_DIR: C:\Users\Gautam\Local Sites\wordpress-dev\app\public/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: true
SCRIPT_DEBUG: true
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
EMPTY_TRASH_DAYS: 30

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: does not exist

`

#13 @mukesh27
10 days ago

Seems like issue is with Windows system as i can't reproduce it in Mac.

cc. @flixos90

#14 @gautammkgarg
10 days ago

I am checking various files, and I am very close to find the exact cause. I will share the details very soon.

#15 @gautammkgarg
10 days ago

The culprit it Object Cache Drop In

\wp-content\object-cache.php

I have this file available in my workspace. I don't know from where did it came. I don't know how does it work. I think I have not installed it. This file is causing the issue.

Here is the content of Object Cache file

<?php
/**
 * Plugin Name: Plugin Check Object Cache Drop-In
 * Plugin URI: https://github.com/WordPress/plugin-check
 * Description: Plugin check drop-in to setup the test environment early. This is not a real object cache drop-in and will not override other actual object cache drop-ins.
 * Version: 1
 * Author: WordPress Performance Team
 * Author URI: https://make.wordpress.org/performance/
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * Object cache drop-in from Plugin Check.
 *
 * This drop-in is used, admittedly as a hack, to be able to setup the
 * WordPress environment as early as possible. Once a plugin is loaded, it is
 * too late to configure the test environment.
 *
 * This file respects any real object cache implementation the site may already
 * be using, and it is implemented in a way that there is no risk for breakage.
 *
 * @package plugin-check
 * @since 1.0.0
 */

// Set constant to be able to later check for whether this file was loaded.
define( 'WP_PLUGIN_CHECK_OBJECT_CACHE_DROPIN_VERSION', 1 );

function plugin_check_initialize_runner() {
        $plugins_dir = defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins';
        $plugin_dir  = $plugins_dir . '/plugin-check/';
        if ( ! file_exists( $plugin_dir . 'vendor/autoload.php' ) ) {
                return;
        }

        require_once $plugin_dir . 'vendor/autoload.php';

        if ( class_exists( 'WordPress\Plugin_Check\Utilities\Plugin_Request_Utility' ) ) {
                // Initialize the Check Runner class based on the request.
                WordPress\Plugin_Check\Utilities\Plugin_Request_Utility::initialize_runner();
        }
}
plugin_check_initialize_runner();

This file autoloads the composer libraries of plugin-check plugin. plugin-check plugin also have AI related files, which are little different than the files that comes with 7.0-beta1. That's why they are causing the conflict.

Either we need to fix this object cache file, or we need to update AI files in plugin-cleck plugin.

Last edited 10 days ago by gautammkgarg (previous) (diff)

#16 @ozgursar
10 days ago

Reproduction Report

Environment

  • WordPress: 7.0-beta1-61715
  • PHP: 8.3.30
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Plugin Check (PCP) 1.8.0
    • Test Reports 1.2.1

Steps taken

  1. Use the WordPress Playground link below that installs and activates Plugin Check (PCP) version 1.8.0

https://playground.wordpress.net/?php=8.3&wp=beta&plugin=plugin-check

  1. ❌ Bug is not occurring

Screenshots/Screencast with results

https://i.imgur.com/2Di7lf9.png

#17 @siliconforks
10 days ago

I think a reliable way to reproduce the issue is to activate the Plugin Check plugin, and then run the following WP-CLI command:

$ wp plugin check nonexistent-plugin
Error: Invalid plugin slug: Plugin with slug nonexistent-plugin is not installed.

Then run the same command again:

$ wp plugin check nonexistent-plugin
PHP Fatal error:  Declaration of WP_AI_Client_HTTP_Client::sendRequestWithOptions(WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface must be compatible with WordPress\AiClient\Providers\Http\Contracts\ClientWithOptionsInterface::sendRequestWithOptions(Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): Psr\Http\Message\ResponseInterface in .../wp-includes/ai-client/adapters/class-wp-ai-client-http-client.php on line 101
Fatal error: Declaration of WP_AI_Client_HTTP_Client::sendRequestWithOptions(WordPress\AiClientDependencies\Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): WordPress\AiClientDependencies\Psr\Http\Message\ResponseInterface must be compatible with WordPress\AiClient\Providers\Http\Contracts\ClientWithOptionsInterface::sendRequestWithOptions(Psr\Http\Message\RequestInterface $request, WordPress\AiClient\Providers\Http\DTO\RequestOptions $options): Psr\Http\Message\ResponseInterface in .../wp-includes/ai-client/adapters/class-wp-ai-client-http-client.php on line 101
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

(To fix this, simply delete the wp-content/object-cache.php file.)

#18 @westonruter
9 days ago

  • Milestone changed from Awaiting Review to 7.0

#19 follow-up: @ravichudasama01
8 days ago

I tested this issue locally on WordPress 7.0 Beta 1, but I’m not able to reproduce the reported behavior.

Screenshot for reference:-
https://prnt.sc/51Yf0ObN4Gl3

#20 in reply to: ↑ 19 @siliconforks
8 days ago

Replying to ravichudasama01:

I tested this issue locally on WordPress 7.0 Beta 1, but I’m not able to reproduce the reported behavior.

Did you try the steps in this comment above? That appears to trigger the issue reliably for me.

#21 @justlevine
8 days ago

This seems to be due to Plugin Check relying on Composer to require wp-ai-client, both in a manner and usage that makes it incompatible with 7.0beta1.

The change needs to happen downstream in PCP. Along the lines of:

  1. Remove the dependency from Composer
  2. Update plugin usage to check for the wp_ai_client_prompt() function instead of directly instantiated

For reference, this how @dkotter handled it for the AI Experiments plugin https://github.com/WordPress/ai/pull/242

Don't believe there's anything we need to do about this in Core, but hopefully this will serve as another reminder as to why it's a bad idea to treat Feature Plugins as Composer dependencies.

Last edited 8 days ago by justlevine (previous) (diff)

#22 @davidperez
4 days ago

Hello,
I am an active contributor to PCP. We could remove the composer library, but we would have to inform our users that they cannot use AI unless they upgrade to WP 7.0.

#23 @flixos90
3 days ago

  • Milestone 7.0 deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

This should be fixed by WP AI Client release 0.4.0, but it requires changes in how that package is loaded. Please refer to the release notes.

That being said, for running PHPUnit tests itself, this won't fix it: The problem is that PHPUnit will always load vendor/autoload.php, and there's no way around it we are aware of.

For the time being, you may need to allow 7.0 tests to fail, or you will need to conditionally remove the WP AI Client and PHP AI Client dependencies when running in 7.0. The team acknowledges that this is a workaround that is not ideal, but we have been unable to find a better solution, given this aspect of PHPUnit does not appear to be configurable.

Keep in mind that, once WordPress 7.0 stable is out, the WP AI Client package will be discontinued. Plugins should no longer bundle it, and neither should they bundle the PHP AI Client package.

Plugins that currently bundle these packages are strongly encouraged to prepare for using the WordPress 7.0 implementation, and eventually require usage of WordPress 7.0. Doing this will also address several problems with the current approach of bundling the package, which will lead to challenges with providers from external plugins not being recognized.

Please let us know if you continue to face unexpected challenges after having implemented the changes mentioned in the WP AI Client 0.4.0 release notes. Since technically this is an issue of the original packages, I'm going to close this as a non-Core issue, but please feel free to continue sharing related findings and/or ideas.

#24 @justlevine
3 days ago

We could remove the composer library, but we would have to inform our users that they cannot use AI unless they upgrade to WP 7.0.

Just to tl;dr for folks only skimming since I just got DMed about this: users can upgrade to 7.0 or install the WP AI Client as a plugin until the can upgrade.

Regrettably, future-compat is always a concern when shipping premature functionality to production users, but hopefully the latest changes to WP AI Client will make it easier to support existing users while still being able to benefit from whatever future goodies come to WP7.next.

#25 @davidperez
2 days ago

The PR is finished and pending review. It will be launched ASAP.

Note: See TracTickets for help on using tickets.