Title: woocommerce &amp; autoptimizer https issue
Last modified: August 20, 2016

---

# woocommerce & autoptimizer https issue

 *  Resolved [dbs121](https://wordpress.org/support/users/dbs121/)
 * (@dbs121)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-autoptimizer-https-issue/)
 * hi,
 * i am using autoptimizer with woocommerce (both latest versions). while testing
   i notice when i am logged in and then logout the site from the frontend will 
   break (i’m using chrome) because of the following errors listed in the inspector
   window:
 * [blocked] The page at [https://www.[mysite].com/my-account/](https://www.[mysite].com/my-account/)
   ran insecure content from [http://www.[mysite]/wp-content/cache/autoptimize/autoptimize_85eee0c5db682bdc9b0cb2eaeefb618b.php](http://www.[mysite]/wp-content/cache/autoptimize/autoptimize_85eee0c5db682bdc9b0cb2eaeefb618b.php).
 * [blocked] The page at [https://www.[mysite]/my-account/](https://www.[mysite]/my-account/)
   ran insecure content from [http://www.[mysite]/wp-content/cache/autoptimize/autoptimize_6766732f7f1f0f4e059fb624eeb8accd.php](http://www.[mysite]/wp-content/cache/autoptimize/autoptimize_6766732f7f1f0f4e059fb624eeb8accd.php).
 * looks like it’s caught out by non-secure cached content.
 * is there a workaround for this as autoptimizer is my go-to optimizer for wp.
 * thanks!
 * [http://wordpress.org/extend/plugins/autoptimize/](http://wordpress.org/extend/plugins/autoptimize/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-autoptimizer-https-issue/#post-3568415)
 * OK, problem indeed is that Autoptimize forces the aggregated & minimized js &
   css-files to be served over HTTP (or rather, it uses the WP_CONTENT_URL from 
   wordpress, which tends to be [http://abc.xyz/wp-content/](http://abc.xyz/wp-content/)
   instead fo [https://abc.xyz/wp-content/](https://abc.xyz/wp-content/))
 * easy fix: go into your wordpress admin and change the URL in site address and/
   or wordpress address from HTTP into HTTPS (or is it HTTPS already?).
 * better fix (and will include something like this in the next version which I’m
   working on): open wp-content/plugins/autoptimize/autoptimize.php and from line
   17 change
 *     ```
       //Plugin constants
       define('AUTOPTIMIZE_CACHE_DIR',WP_CONTENT_DIR.'/cache/autoptimize/');
       define('AUTOPTIMIZE_CACHE_URL',WP_CONTENT_URL.'/cache/autoptimize/');
       define('AUTOPTIMIZE_CACHE_DELAY',true);
       ```
   
 * into:
 *     ```
       //Plugin constants
       $WP_CONTENT_URL_SSLFIX=(empty($_SERVER['HTTPS'])) ? WP_CONTENT_URL : str_replace("http://", "https://", WP_CONTENT_URL);
       define('AUTOPTIMIZE_CACHE_DIR',WP_CONTENT_DIR.'/cache/autoptimize/');
       define('AUTOPTIMIZE_CACHE_URL',$WP_CONTENT_URL_SSLFIX.'/cache/autoptimize/');
       define('AUTOPTIMIZE_CACHE_DELAY',true);
       ```
   
 * and let me know if that solves your aches.
 *  Thread Starter [dbs121](https://wordpress.org/support/users/dbs121/)
 * (@dbs121)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-autoptimizer-https-issue/#post-3568418)
 * yes, that did it – thank you so much – i opted to edit the autoptimize.php file
   as you listed and works great now.
 * thanks again!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-autoptimizer-https-issue/#post-3568420)
 * you’re welcome, thanks for the great rating! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘woocommerce & autoptimizer https issue’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/woocommerce-autoptimizer-https-issue/#post-3568420)
 * Status: resolved