WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] [Plugin: WordPress HTTPS] Problem with images (8 posts)

  1. krbvroc1
    Member
    Posted 3 years ago #

    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.

  2. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. krbvroc1
    Member
    Posted 3 years ago #

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

  4. Olivier
    Member
    Posted 3 years ago #

    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???

  5. Olivier
    Member
    Posted 3 years ago #

    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

  6. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    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

  7. ccolotti
    Member
    Posted 2 years ago #

    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.

  8. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey ccolotti,

    As far as I know this is fixed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic