Adding UserAgent Fixed Image Download Issues
-
I downloaded your plugin and it seemed to work absolutely perfectly for my needs, except that for some reason the thumbnail images weren’t being downloaded and set correctly (when I set “Post thumbnail” to “Generate from first image”).
I did some troubleshooting and realized that the RSS feeds server was returning a 403 error when the script tried to download the image, but the image worked fine when I looked at it in a browser. Adding a UserAgent to your script fixed the issue and now everything is working perfectly.
Might I suggest that you add the UserAgent into the script itself so I don’t have to edit the plugin every time you update? Obviously, there may be reasons not to do it, but it helped me a lot.
The fix I made was to change:
$content = @file_get_contents($url);
on line 187 of cybersyn.php to:
ini_set('user_agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'); $content = @file_get_contents($url);
Thanks again for the great plugin!
- The topic ‘Adding UserAgent Fixed Image Download Issues’ is closed to new replies.