• zetland

    (@zetland)


    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 - 16 through 30 (of 36 total)
  • Plugin Author Frank Goossens

    (@futtta)

    not entirely sure why you had to “swap the " with ' and vice versa”, but

    <script type='text/javascript' src='/wp-content
    would match

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

    but
    <script type="text/javascript" src="/wp-content

    would not.

    what would work is (if you need to avoid the single quotes) is;

    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);
    }

    or, if you only want single quotes;

    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);
    }

    Question still being if that will solve the files not being aggregated off course …

    frank

    Thread Starter zetland

    (@zetland)

    Hi Frank,

    Yeah, I changed the single quote marks because my HTML appeared like this in the browser:

    <script type="text/javascript" src="/wp-content/plugins/jetpack/modules/wpgroho.js"></script>

    So I was worried that <script type='text/javascript' src='/wp-content would not match anything. Not sure if that’s incorrect though? At any rate, the str_replace method didn’t work for me in either instance.

    Thanks,

    James

    Plugin Author Frank Goossens

    (@futtta)

    ok, we’ll have to shift gears here; do you have (or can you set up) a non-prod instance where we could experiment to the extent we could break things?

    Thread Starter zetland

    (@zetland)

    Well, we’re running UpdraftPlus on the site. I’m happy to let you play around with the live site, just backup before you make the changes. Does that work for you?

    Thanks,

    James

    Plugin Author Frank Goossens

    (@futtta)

    I can’t touch live-sites I’m afraid :-/

    Any chance you could (get your hoster to) setup a staging-site?

    Thread Starter zetland

    (@zetland)

    Okay, my colleague’s now asking if we could send over the backup files. Would that work?

    Plugin Author Frank Goossens

    (@futtta)

    well, we can try ??

    you can reach me at futtta-at-gmail-dot-com

    Thread Starter zetland

    (@zetland)

    Hi Frank,

    I’ve emailed you the backup files this morning. Let me know if that works for you. If not, I’ll do what I can to get a Staging site set up. Thanks again for your help.

    James

    Plugin Author Frank Goossens

    (@futtta)

    I’ll try to get things up and running on my local dev-machine ??

    Thread Starter zetland

    (@zetland)

    Did you have any luck with this?

    Plugin Author Frank Goossens

    (@futtta)

    not yet, still on my to-do list ??

    Thread Starter zetland

    (@zetland)

    One thing I found yesterday which might help, when I installed the Cloudflare plugin and activated that, the plugin settings were completely blank.

    Thread Starter zetland

    (@zetland)

    Cool, thank you!

    Thread Starter zetland

    (@zetland)

    Hey Frank, did you get anywhere with this one?

    Thanks,

    James

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Evening James;
    I was able to replicate the problem by activating the “make paths relative”-plugin that was in your zip-files, but if I remember correctly disabling it did not solve the problem for you? My gut feeling (based on this problem but also on cloudflare admin not working) that the installation is suffering from some weird issues which I feel might require a complete re-install of your site to fix.

    Have a nice evening,
    frank

Viewing 15 replies - 16 through 30 (of 36 total)
  • The topic ‘Autoptimize not concatenating CSS or JavaScript’ is closed to new replies.