WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Autoptimize] https issue (3 posts)

  1. dreamwhisper
    Member
    Posted 4 years ago #

    This plugin works well for my html and css. It does break the Featured Content Gallery if js is turned on.

    My question though is, if part of a blog is http:// and part of it is https://, what code needs to be edited so that the style sheet isn't http:// on the https:// pages?

    http://wordpress.org/extend/plugins/autoptimize/

  2. turl
    Member
    Posted 4 years ago #

    Hi!

    If WordPress is configured to use HTTPS, the plugin will make CSS and HTML urls using HTTPS. But if only some part is in HTTPS, you will need to hack "autoptimize.php" around line 19, where it says

    define('AUTOPTIMIZE_CACHE_URL',WP_CONTENT_URL.'/cache/autoptimize/');

    You might want to replace it with something like this:

    if($_SERVER['https'] == 1 || $_SERVER['https'] == 'on' || $_SERVER['SERVER_PORT'] == 443) {
    define('AUTOPTIMIZE_CACHE_URL','https://mysiteurl.com/wp-content/cache/autoptimize/');
    }else{
    define('AUTOPTIMIZE_CACHE_URL',WP_CONTENT_URL.'/cache/autoptimize/');
    }

    It's based on this code -> http://wordpress.org/support/topic/264510?replies=1

    Also, to do that modification you'll need Autoptimize 0.9 that I'll release later on today, or tomorrow. Check the version here: http://wordpress.org/extend/plugins/autoptimize/

    Emilio

  3. dreamwhisper
    Member
    Posted 4 years ago #

    Thanks for getting back to me and sorry for the late reply. I will give this a shot when I get back from vacation and let you know how it works.

Topic Closed

This topic has been closed to new replies.

About this Topic