Hi there,
What plugin are you using to implement SSL on your site? It could be an incompatibility because BWP Minify does use WordPress’s is_ssl() function (not directly though).
Thread Starter
B M
(@mampf)
Hi,
ah, why would I use a plugin to “implement” SSL? SSL is protocol-related, not application-related. All images and so on are automatically converted to “https:” by wordpress, if SSL is detected.
Anyway, I also have SSL Insecure Content Fixer installed. Which didn’t help, obviously.
What du you mean by “not directly”? If found SSL only in conjunction with CDN, and the filter https_local_ssl_verify.
But in the min.php-file I found that you are using home_url(). The docs say:
If the $scheme argument is “http” or “https” the is_ssl() check is overridden.
So maybe this is the point where it fails?
$http_host = $url['scheme'] . '://' . $url['host'];
Why not use either:
$http_host = '//' . $url['host'];
or
$scheme = $url['scheme'];
if (is_ssl()) {
$scheme = "https";
}
It’s just a quick guess where the problem is found, though I haven’t tested it yet. This would only fail on hosts where you can choose between ssl and non-ssl, though.
The issue is BWP Minify does use home_url() and does not pass any $scheme so it should be using https if instructed.
I will provide a fix that you can download, would you mind testing that out?
Thread Starter
B M
(@mampf)
I “fixed” it for me by using http_host = '//' . $url['host'];. Is that not an option?
I can also test your fix, if you like.
That is indeed an option, however not the root cause of the issue. If what you did to fix is simply replacing this line:
$http_host = $url['scheme'] . '://' . $url['host'];
with this line:
$http_host = '//' . $url['host'];
and nothing else, then an important check has failed.
Do you have a dev server? If not can you try printing out the result of home_url() on line 392?
Please test with 1.3.1 and see if it works for you, thanks!
Thread Starter
B M
(@mampf)
Hi, from what I tested this seems to work flawlessly.
Also, as you requested:
$ php -r 'include "wp-load.php"; echo home_url();'
http://www.sbo-schaumburg.de
Please be aware that my site is SSL optional.