Closed ghost closed 5 years ago
A little more on this, it looks like the media_side_load function isn't completing it's job, therefore instead of the URL being https://foo.com/wp-content/uploads/youtube_id.jpg it is (for example) https://foo.com/wp-content/uploads/;https://i.ytimg.com/an_webp/youtube_id/mqdefault_6s.webp?du=3000&sqp=CMiB4uMF&rs=AOn4CLAYC0zNrTLHvzbFDjTW_HiIJ53fgA
Yes and no. It seems like the url we're using to test some things, https://www.youtube.com/oembed?format=json&url=http://www.youtube.com/watch?v=XYZXYZ
isn't including it specifically in its JSON response, but at least for a couple of videos I've tested, there still sometimes is that max version. The one that succeeded the most for me is a really recent video. The plugin also does testing to see if there is a max version, before falling back to the hqversion. We work with what we can successfully find. Not sure what you had to change to make it work on your end, but we can test ourselves if you can provide the youtube urls you are using.
Not managing to recreate issue 2, with WordPress 5.1. It may be something else in your install that's having effects on things.
Willing to help check things where we can, pending some extra feedback :)
Extra feedback is once I added the PHP snippet to compensate for the 800 character limit, the problems went away :)
Don't quite know how you can account for that in the code... but it would be a nice fix. I still have a few sites on 4.9.9 but need to move them to 5.1 for security reasons soon.
Damn Gutenberg and their hidden markup eating up those characters.
Yeah, no doubt.
I'll just add this here for completeness (this is also on the WP repository support forum):
To solve problems with WP 5.0 and later:
Take the following code and insert into your themes functions.php (hopefully you have a child theme) or use a snippet plugin to add it globally to the site:
function reelism_larger_content_scan( $length ) { return 3200; } add_filter( 'wds_featured_images_character_limit', 'reelism_larger_content_scan' );
There are a couple of issues: 1) It looks like YouTube isn't supplying the maxresdefault file size any longer. Several online attempts to download that image result in the YouTube file not found result. The mqdefault file size is still supported.
2) In WP 5.1 - the URL to show the thumbnail as a featured image now has the URL of the site in front of it. So instead of http://img.youtube.com/vi/THE-VIDEO-ID/maxresdefault.jpg now the media file shows the siteurl in front of the thumbnail url. The result is a broken link to the thumbnail url.I was able to change the maxresdefault to mqdefault in the php code locally, but I wasn't able to figure out how to change the url that's inserted into the media library to fetch the featured image.