junaidbhura / fly-dynamic-image-resizer

Fly Dynamic Image Resizer plugin for WordPress
https://wordpress.org/plugins/fly-dynamic-image-resizer/
MIT License
162 stars 26 forks source link

Generated src uses http rather than https #18

Closed issunboshi closed 6 years ago

issunboshi commented 6 years ago

Hi,

I'm about to launch a website which uses the plugin and it's ben great so far.

I've put the site on the production environment and now that the site is running under https, I see lots of mixed content warnings. All for images generated by this plugin. Is there anything we need to do to enable https as the output?

Thanks,

Cliff

junaidbhura commented 6 years ago

Hi @issunboshi looks like you might have forgotten to update your site's URL in the database. This plugin takes the value of wp_upload_dir() which uses the siteurl option.

Once you change the paths in the database to HTTPS, it should work as expected.

issunboshi commented 6 years ago

Hi @junaidbhura,

Thanks for getting back to me.

I've updated the site URL and WP home to the correct hosts. screen shot 2017-12-12 at 10 55 56

Everything else is working as expected except the output from this plugin.

I've tried to delete all existing cached images to see if that would force a change, but no luck.

As a test I've var_dumped the output ACF Pro pulling an image src and this plugin. ACF is showing a correct https path this plugin isn't. I've attached a screenshot of that. screen shot 2017-12-12 at 10 52 49

Is there anything that needs to be done to force the plugin to pick up on the change? I've tried uninstalling and then reinstalling it.

Thanks,

Cliff

horecny commented 6 years ago

Try to use "really simple ssl" WP plugin, this we are using as fallback for ssl issues.

junaidbhura commented 6 years ago

Hey @horecny @issunboshi have you tried it without the Really Simple SSL plugin?

It should just work out of the box. I've tested this on SSL, and it works great. I'm not sure what could be causing the issue on your website.

As I'd mentioned earlier, this plugin uses the value of baseurl from wp_upload_dir(). Can you var_dump the value of wp_upload_dir() and see what you get? That could be the issue.

Here is the function that is responsible for getting the image path:

https://github.com/junaidbhura/fly-dynamic-image-resizer/blob/master/inc/class-core.php#L389