WordPress 7.1 — PHP warnings “Undefined array key type”
-
After the automatic update to WordPress 7.1, I’m getting repeated PHP warnings in my Apache error log on REST API requests:
PHP Warning: Undefined array key "type" in /…/wp-includes/rest-api.php on line 2266 PHP Warning: Undefined array key "type" in /…/wp-includes/rest-api.php on line 2275What’s affected: My page-optimization service (FastPixel) uses the REST API to post optimized pages back to the server, and it has stopped working entirely since the update — its requests fail. The warnings above appear in my logs on requests from that service’s IP.
This is happening on two separate sites, on two separate servers, both of which auto-updated to 7.1. Nothing else was changed on either site.
What I’ve already ruled out:
- Deactivated every plugin individually and retested — warnings persist
- Switched to a default theme (from Divi) — warnings persist
- REST API is not restricted —
/wp-json/returns the full JSON response normally - All plugins and core are fully up to date
- No security plugins installed; no firewall blocks; service IPs whitelisted
Environment: WordPress 7.1, Apache, Cloudways hosting. Site A runs PHP 8.1, Site B runs PHP 8.2 — the identical warnings appear on both, so this doesn’t appear to be PHP-version-specific.
Since the warnings originate in core’s
rest-api.phpand reproduce with all plugins disabled and a default theme active, this looks like it may be a core issue with 7.1’s REST API handling rather than a plugin conflict. Has anyone else seen this since updating to 7.1?
You must be logged in to reply to this topic.