Site Health test for page caching does not account for wp_remote_retrieve_header()
returning arrays
#6937
Labels
Bug
Something isn't working
Changelogged
Whether the issue/PR has been added to release notes.
P0
High priority
Site Health
Milestone
Bug Description
As reported in a support forum topic, an error can occur in the page caching detection test:
The
preg_match()
call in question is here:amp-wp/src/Admin/SiteHealth.php
Lines 547 to 549 in 7c2b5ae
The
$header_value
is being passed here:amp-wp/src/Admin/SiteHealth.php
Lines 626 to 639 in 7c2b5ae
So apparently we're not accounting for
wp_remote_retrieve_header()
returning an array instead of a string.Note the site is running PHP 8.1 which is the cause for the fatal due to the additional strictness.
Expected Behaviour
No error should occur.
Screenshots
No response
PHP Version
8.1
Plugin Version
2.1.4
AMP plugin template mode
Standard, Transitional, Reader
WordPress Version
No response
Site Health
No response
Gutenberg Version
No response
OS(s) Affected
No response
Browser(s) Affected
No response
Device(s) Affected
No response
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response
The text was updated successfully, but these errors were encountered: