airani / wp-auto-upload

Automatically detect external images in the Wordpress post content and import images to your site and adding to the media library and finally replace image urls with new urls

Home Page:http://wordpress.org/plugins/auto-upload-images/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working for me for a Page from CDN

HeadStudios opened this issue · comments

I have a page with an image on it like so:
https://d418bv7mr3wfv.cloudfront.net/s3/W1siZiIsIjIwMTgvMTAvMTEvMjMvMDIvNTUvMjQxL1dlIGFzayBxdWVzdGlvbnMgdGhhdCBjcmVhdGUgbWFnaWNhbCBjb25uZWN0aW9ucyAoNCkucG5nIl1d
However after activating the plugin and updating the page the image is still redirecting to the Cloudfront CDN

The cURL in ImageUploader.php::save() needs to have the option for following redirects enabled for CDN and old attachment-style CMS links to work.

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

Edit: I think I have an outdated version of the plugin despite the ver # in WP matches the WordPress plugin page. The GitHub master copy of ImageUploader.php doesn't download the image within save anymore, there's a new func called downloadImage().

Fixed in v3.2