Recently, I was doing the optimization of my personal WordPress site. I checked it with the official site inspection tool. The following two errors occurred. The problem prompts are as follows:
site health status
WordPress Site Health Check shows you critical issues about your WordPress configuration, and items that require your attention.
2 key questions
Active PHP session performance detected
The
session_start()
function call generates a PHP session. The session interferes with the REST API and loopback requests. The session must be closed by thesession_write_close()
function before making any HTTP requests .REST API encountered bug performance
The REST API is a way for WordPress and other applications to communicate with the server. For example the block editor page, which relies on REST to display and save your pages and articles.
The REST API request failed with an error.
Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)
After checking a lot of information, I found the answer on stackoverflow.com,
In most cases the real cause of the above error is the incorrect mechanism for using PHP sessions in plugins or themes when they use the session_start() function.
…
The post wordpress reports that the session_start() function call generates a PHP session. This session interfered with REST API and loopback request issues. first appeared on Lenix Blog .
This article is reprinted from https://blog.p2hp.com/archives/8721
This site is for inclusion only, and the copyright belongs to the original author.