Support » Plugin: Autoptimize » Lazy-loaded images not using https (Autooptimizeimages.php)

  • tjdyo

    (@tjdyo)


    The autoptimizeimages.php file outputs to http instead of https on websites that have https enabled everywhere, even when the source image is https.

    Line 541:
    Original Line:
    $_url = substr( $url, strpos( $url, '/http' ) + 1 );

    Changed it to:
    $_url = substr( $url, strpos( $url, '/https' ) + 1 );

    Would it be possible to get a new feature to enable HTTPS when needed for lazy loading?

    • This topic was modified 2 years ago by tjdyo.
    • This topic was modified 2 years ago by tjdyo.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hmmm, somewhat surprised; I use lazyload myself on my own site and have no problems with images being loaded over http. What are the options you have active on AO’s images tab?

    Thread Starter tjdyo

    (@tjdyo)

    Well, it’s not that the images weren’t loading with HTTP. It’s the fact that the whole website including the source images are loading via HTTPS.

    When Autoptimize lazy-loads those images, it swaps/links the files to HTTP. The issue with this is it makes browsers still recognize the website as insecure. Firefox spits back that the images are the only things not secure. After doing some digging, my team and I realized it was Autoptimize’s autooptimizeimages.php file.

    After changing that line of code, the website loads 100% as a secure connection and all the images are being loaded via HTTPS.

    As far as settings go, I just have “Lazy-load images?” checked off in the Images section.

    • This reply was modified 2 years ago by tjdyo.
    • This reply was modified 2 years ago by tjdyo.
    • This reply was modified 2 years ago by tjdyo.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Even more surprised in that case; the code you changed is only executed if “optimize images” is also active (it takes care of fetching “lqip” images from Shortpixel)? Did some more tests with lazyload and cannot reproduce images being loaded over http:// in that scenario either I’m afraid @tjdyo, pretty much at a loss what is going wrong for you there …

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lazy-loaded images not using https (Autooptimizeimages.php)’ is closed to new replies.