Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#52862 closed enhancement (invalid)

Rearrange Test-order in function: wp_is_local_html_output

Reported by: espiat's profile espiat Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7
Component: Site Health Keywords:
Focuses: Cc:



Since 5.7 i saw many sites with an SSL Error in the Site Health overview.

Reason: The function wp_is_local_html_output is checking the response header for rds, wlmmanifest and rest.

Many, many seo, optimize, and maintenace plugins remove the rds and qlmanifest meta tags.

The chance that there is some rest link in the header is far greater - i think.

My suggestion is to change the order of the checks.

New order:

  1. has_action( 'wp_head', 'rest_output_link_wp_head' )
  2. has_action( 'wp_head', 'wlwmanifest_link' )
  3. has_action( 'wp_head', 'rsd_link' )

This increases the likelihood that the check will run and confuse the user less.


I have one more code note.

The code is a bit difficult to read from my point of view.

You have to go to the end of the line to understand what is going on.

My suggestion would be from the following code:

return false! == strpos ($html, $pattern);

to do this:

return strpos ($html, $pattern) === false ? false : true;

But it can also be that this does not correspond to your code standard.

Change History (3)

#1 @espiat
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#2 @espiat
3 years ago

I checked it out again.
Change the order, would have no effect.

But, is there no other way to check if HTML was generated by this site?

I closed the ticket. Sorry.

#3 @desrosj
3 years ago

  • Keywords reporter-feedback dev-feedback 2nd-opinion removed
  • Milestone Awaiting Review deleted

Hi @espiat,

Welcome to Trac! I'm sorry that this did not receive a response in a more timely manner.

If you are still looking for an answer to your question, I recommend heading over to the Support Forums. Trac is not for general support.

Note: See TracTickets for help on using tickets.