Monthly Archives: August 2016

Music from Our Tube; Lianne La Havas singing a Little Prayer

Burt Bacharach! Aretha Franklin! Dionne Warwick! My Best Friends Wedding (with the lobster gloves)! And now also Lianne La Havas, live, solo with the public singing background-vocals. Goosebumps!

Lianne La Havas – Say A Little Prayer @ De La Warr Pavillion, Bexhill 12/03/16

Watch this video on YouTube.

How to force Autoptimize to output protocol-relative URL’s

Autoptimize by default uses WordPress’ internal logic to determine if a URL should be HTTP or HTTPS. But in some cases WordPress may not be fully aware it is on HTTPS, or maybe you want part of your site HTTP and another part (cart & checkout?) in HTTPS. Protocol-relative URL’s to the rescue, except Autoptimize does not do those, right?

Well, not by default no. But the following code-snippet uses AO’s API to output protocol-relative URL’s (warning: not tested thoroughly in a production environment, but I’ll happy to assist in case of problems):

add_filter('autoptimize_filter_cache_getname','protocollesser');
add_filter('autoptimize_filter_base_replace_cdn','protocollesser');
function protocollesser($urlIn) {
  $urlOut=preg_replace('/https?:/i','',$urlIn);
  return $urlOut;
}