• Hey Frank,

    Thanks for the excellent plugin and all your help here. I’ve been using Autoptimize for a while now and it’s been fine with my other sites, but I’ve now got one that isn’t complying. I have optimize HTML, CSS and JavaScript all ticked, but it’s not concatenating CSS or JS. Do you know of something that could block this (plugin or wp-config.php code or anything else)? I’ve been toying around with my setup but can’t get it to play ball so far…

    Thanks,

    James

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 36 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, there seems to be some JS/ CSS optimized and other not, weird … I guess a theme or plugin conflict, try identifying by disabling/ enabling plugins and/ or switching a default theme to identify?

    frank

    Thread Starter zetland

    (@zetland)

    Well, it’s worked with this theme in the past, so I don’t think that’s the issue. I’m disabling plugins now. There are a lot of them though. Do you have a list of ones which interfere with AO?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Do you have a list of ones which interfere with AO?

    afraid not, no :-/

    Thread Starter zetland

    (@zetland)

    Just removed all plugins and checked in Incognito. It’s still doing the same thing. Any other suggestions?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    and when switching themes @zetland (I know you wrote it worked before, but still to be absolutely sure …)

    Thread Starter zetland

    (@zetland)

    Well, this plugin used to work fine with my old theme, but let me take a look…

    Thread Starter zetland

    (@zetland)

    Yup, same problem

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, the only logical conclusion would be Autoptimize (and hence PHP and the user under which the PHP-process is running) cannot read those files from the filesystem, in which case AO indeed leaves the files in place (in order not to break anything). could that be the case somehow?

    Thread Starter zetland

    (@zetland)

    I’d be surprised if that were the case. How can I find out if it can’t read those files, and what could I do to fix it?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    1. check the permissions of the files that are not aggregated on the server
    2. change the permission

    but I see something that might help us find the root cause; your unoptimized HTML has resources with a full URL, e.g.:

    
    <script type='text/javascript' src='https://vocularapp.com/wp-content/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js'></script>

    and some without a full URL, e.g.:

    
    <script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>

    and it looks as though the files that have a full URL are aggregated and the ones that don’t have a full URL are not.

    so, the question; what code is causing this difference? is it something you can turn off?

    Thread Starter zetland

    (@zetland)

    Hi Frank,

    I’ll be honest, I’m not getting anywhere with this. Is there any chance I could enlist your help here? I’d be very happy to pay for your help, or make a charitable donation in your name as a token of gratitude.

    Thanks,

    James

    Plugin Author Frank Goossens

    (@futtta)

    OK, so to answer the question from your other post; AO should not bail on something like

    
    <script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>

    (I tested on my local dev to be 100% sure).

    Now this would just be a workaround, but maybe give this code snippet a try;

    
    add_filter('autoptimize_html_before_minify','vocularapp_fix');
    function vocularapp_fix($htmlIn) {
        return str_replace("<script type='text/javascript' src='/wp-content","<script type='text/javascript' src='https://vocularapp.com/wp-content",$htmlIn);
    }

    frank

    Thread Starter zetland

    (@zetland)

    Hi Frank,

    Thanks! I added this snippet to the AO code and then tried deactivating and reactivating it, looks like it’s not working yet though. Have I added the snippet to the wrong place?

    James

    Plugin Author Frank Goossens

    (@futtta)

    ah, but you shouldn’t add that to the autoptimize code, use something like code snippets to add it instead 🙂

    Thread Starter zetland

    (@zetland)

    Thanks for your amazing patience with this. I’ve added that code as via Code Snippets (although I had to swap the " with ' and vice versa to match my browser. I’m not seeing any differences though. Can you think of any reason why this might be? I’ve given it about 15 minutes to update, purged all my caches and done a hard refresh in Incognito…

    James

Viewing 15 replies - 1 through 15 (of 36 total)

The topic ‘Autoptimize not concatenating CSS or JavaScript’ is closed to new replies.