WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#35844 closed enhancement (fixed)

Move is_ssl() to load.php for use in advanced-cache.php

Reported by: johnjamesjacoby Owned by: DrewAPicture
Milestone: 4.6 Priority: normal
Severity: normal Version: 2.6
Component: Bootstrap/Load Keywords: has-patch
Focuses: Cc:

Description (last modified by johnjamesjacoby)

The is_ssl() function is currently in functions.php making it unavailable to advanced-cache.php.

Batcache and other similar plugins end up copying is_ssl() verbatim for their own use.

I think this is a safe move because:

  • Traditional plugins and themes cannot load early enough to need to manually include it
  • WordPress does not require_once the functions.php file, meaning anyone trying to pre-include it in their own advanced-cache.php implementation would encounter fatal errors

I think this is a good move because:

  • Other common is_ functions are there already (is_multisite(), et all)
  • It's a highly useful utility function that developers should feel safe assuming is always available inside of WordPress's runtime, no matter how early

Patch imminent.

Attachments (1)

35844.1.patch (1.4 KB) - added by johnjamesjacoby 5 years ago.
Relocate is_ssl() with added @since note

Download all attachments as: .zip

Change History (15)

@johnjamesjacoby
5 years ago

Relocate is_ssl() with added @since note

#2 @johnjamesjacoby
5 years ago

  • Description modified (diff)

#3 @DrewAPicture
5 years ago

  • Keywords needs-patch added

Interesting. I'm a tentative +1 for this.

Last edited 5 years ago by DrewAPicture (previous) (diff)

#4 @swissspidy
5 years ago

  • Keywords has-patch added; needs-patch removed

#5 @johnbillion
5 years ago

  • Keywords 4.6-early added
  • Milestone changed from Awaiting Review to Future Release

#6 @johnbillion
5 years ago

  • Keywords 4.6-early removed
  • Milestone changed from Future Release to 4.6

#7 @johnjamesjacoby
5 years ago

Does this need anything more to be #blessed?

This ticket was mentioned in Slack in #core by ocean90. View the logs.


4 years ago

#9 @ocean90
4 years ago

  • Keywords 2nd-opinion removed
  • Owner set to DrewAPicture
  • Status changed from new to assigned

Let's add some missing brackets in 35844.1.patch and then it can go in.

Last edited 4 years ago by ocean90 (previous) (diff)

#10 @DrewAPicture
4 years ago

  • Status changed from assigned to accepted

#11 @DrewAPicture
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 37677:

Boostrap: Move is_ssl() to wp-includes/load.php.

Moving to load.php introduces parity with other commonly evaluated is_*() functions such as is_admin() or is_multisite(). It also makes is_ssl() available much earlier in the loading process, such as for use in drop-ins like advanced-cache.php.

Props johnjamesjacoby.
Fixes #35844.

#12 @DrewAPicture
4 years ago

  • Keywords needs-dev-note added

Wouldn't hurt to write up a little dev-note for this, especially if anybody has been audacious enough redefine is_ssl() in a drop-in without a function_exists() check.

#13 @jorbin
4 years ago

There are enough bootrap/load changes that I think a summary of all of them will make a good single dev-note. Started a draft without much content.

#14 @ocean90
4 years ago

  • Keywords needs-dev-note removed
Note: See TracTickets for help on using tickets.