Plugin Author
Nico
(@nico23)
You site runs on http? So you are saying the thumbnails must be loaded via https even on http sites? I have to check this myself.
The usage of wp_remote_head needs to have http or https.
Create a test.php in your public_html folder with the following code.
You’ll see that if wp_remote_head is given a url without http/https it will fail. Using just // on a url is fine in a web browser (“client side”). But wp_remote_head is a server side function. The server should connect with Youtube via https. So I would recommend changing the plugin as I mentioned in original post above. Hope this makes sense. Love the plugin!
<?
define(‘WP_USE_THEMES’, false);
require(‘./wp-load.php’);
$response = wp_remote_head(‘http://img.youtube.com/vi/PEZiZ9G-gNs/maxresdefault.jpg’);
var_dump($response);
$response = wp_remote_head(‘https://img.youtube.com/vi/PEZiZ9G-gNs/maxresdefault.jpg’);
var_dump($response);
$response = wp_remote_head(‘//img.youtube.com/vi/PEZiZ9G-gNs/maxresdefault.jpg’);
var_dump($response);
Thanks for this. I was looking for the error in the code and I just couldn’t put my finger on the error. Didn’t even notice this until you wrote. Saved me a headache. 🙂