WordPress.org

Support

Support » Plugins and Hacks » WordPress HTTPS (SSL) » [Resolved] [Plugin: WordPress HTTPS] Problem with images

[Resolved] [Plugin: WordPress HTTPS] Problem with images

  • I believe there is a bug in this plugin.

    First off, I have FORCE_SSL_ADMIN enabled in wp-config.php so that all stuff in the admin area is secure.

    I also have the ‘Internal HTTPS Elements’ plugin option enabled.

    What happens is that I create a new page for the site. In this new page, I insert a photo. It appears that this plugin is forcing the image url to be https rather than http. Even thought the page will be served from http, the embedded image is https. I’m wondering if the plugin is confused because the image is inserted during a SSL session?

    ps. If I disable ‘Internal HTTPS Elements’ this does not happen, but that is an important option to remain enabled.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mike Ems

    @mvied

    Well, that makes sense.

    Right now, the plugin processes elements on the front-end and the admin panel. I’m sure it’s processing the post code and modifying it as well. I’ll have to make it so that when processing the back-end, it only fixes stylesheets and scripts, and just leaves images and such alone. That should take care of it.

    If you’re feeling daring, you can modify the plugin and give it a shot.

    Replace line 176 in wordpress-https.php:

    preg_match_all('/\<(script|link|img|input|form|embed|param)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);

    With this:

    if (is_admin()) {
     preg_match_all('/\<(script|link)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);
    } else {
     preg_match_all('/\<(script|link|img|input|form|embed|param)[^>]+((http|https):\/\/[\/-\w\.#]+)[^>]+>/im', $buffer, $matches);
    }

    That should do it. If you try it, let me know if it works. When I have more time, I’ll test it myself and if it works, I’ll get it into the next update.

    I updated the source code and this does appear to work, thank you.

    That didn’t fix it for me, even with “Internal HTTPS Elements” ticked off
    Also, when viewing my media library, all the links start with https.

    Is it because the links are hardcoded in the DB???

    I’ve fixed all the guids in the database, but it didn’t change anything…

    And it’s not just the image link, but also the link URL

    Plugin Author Mike Ems

    @mvied

    Hey Olivier,

    I’ve tried to reproduce your problem, but I can not. If you’d like, I can take a look at your website. You can email me directly at mike[at]mvied[dot]com.

    Thanks,
    Mike

    Did this fix make it into a release? I have been getting broken links since disabling SSL due to a required cert change. I was curious how some pictures were inserted as HTTPS until I saw this post that it was related to the plugin. It would be nice to know if this is now fixed so picture inserts will be HTTP while the inspect internal elements remains checked.

    Plugin Author Mike Ems

    @mvied

    Hey ccolotti,

    As far as I know this is fixed.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] [Plugin: WordPress HTTPS] Problem with images’ is closed to new replies.
Skip to toolbar