• ResolvedPlugin Author Optimizing Matters

    (@optimizingmatters)


    I’ll document confirmed bugs here the next couple of days.

    First one;
    -> problem: images referenced in CSS not translated to correct path, leading to 404’s
    -> fix; open wp-content/autoptimize/classes/autoptimizeStyles.php and on line 6 replace
    const ASSETS_REGEX = '/url\s*\(\s*(?!["\']?data:)(?![\'|\"]?[\#|\%|])([^)]+)\s*\)([^;},]*)/i';
    with
    const ASSETS_REGEX = '/url\s*\(\s*(?!["\']?data:)(?![\'|\"]?[\#|\%|])([^)]+)\s*\)([^;},]*)/iU';
    (so adding capital U to make the regex ungreedy)

Viewing 15 replies - 46 through 60 (of 66 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    autoptimize_f69ec39….js:204 Uncaught TypeError: Cannot read property ‘hasClass’ of undefined

    so how sure are you you did not have this warning on AO 2.1.x @martychc23? ??

    Anonymous User 14978628

    (@anonymized-14978628)

    I don’t know if this message appeared before, as i only saw it by chance as i was investigating another issue that required me to use the console.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    ok, if you can share your URL I’ll be happy to have a quick look at what might be going on there.

    Anonymous User 14978628

    (@anonymized-14978628)

    Great, sent you url to your gmail account. Thanks

    Hello,

    I updated to AO 2.2.1 and part of my site broke duo to CSS.
    In fact, I am hosting my wp-content folder on a static subdomain “static.site.com”. Everything worked fine except for theme images and font not loading. While checking the error, I found that the plugin converted relative img/font url to full ones while adding “wp-content” in the path. Ex: background-image: url(//static.image.com/wp-content/themes/theme/images/icons.png); instead of background-image: url(//static.image.com/themes/theme/images/icons.png);

    I managed to overcome the problem (in a brutal way) by changing ‘AUTOPTIMIZE_WP_CONTENT_NAME’ like this:

    if (!defined('AUTOPTIMIZE_WP_CONTENT_NAME')) { define('AUTOPTIMIZE_WP_CONTENT_NAME',chop('/'.wp_basename( WP_CONTENT_DIR ),'wp-content/')); }

    I am no expert in these stuff, but it seems that WP is returning an incorrect path for WP_CONTENT_DIR variable. I have googled similar problem but could not find another solution. So I am not sure if I should report this bug to WP.

    Could you please point out another less brutal solution?

    Regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, what you could do is add something like that to your wp-config.php, in which case AUTOPTIMIZE_WP_CONTENT_NAME is defined when AO runs and the code in AO will rely on that instead of trying itself?

    So,I added this to wp-config:
    define("AUTOPTIMIZE_WP_CONTENT_NAME", "https://static.site.com/")
    and the site gets broken.
    Looking in the console window, I find this error appearing:

    Uncaught TypeError: $nocnflct.scrollUp is not a function
        at HTMLDocument.<anonymous> ((index):3)
        at i (jquery.js:2)
        at Object.fireWith [as resolveWith] (jquery.js:2)
        at Function.ready (jquery.js:2)
        at HTMLDocument.K (jquery.js:2)

    Disabling the added line put things back in order. Am not sure what’s the problem here.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, the problem is that AUTOPTIMIZE_WP_CONTENT_NAME expects the name of the wp-content directory, and you’re feeding it with the wp-content URL ??

    Thank you for your support.
    I did input the wp-content directory in the variable and problem stayed the same.
    I don’t know what is going wrong here. But unless you have other options for me to test, I’ll stick with my hack ?? The problem is that I need to apply it after each AO update.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, I suppose you have //static.site.com/ set as CDN, in that case you could hook into the autoptimize_filter_base_replace_cdn filter to remove wp-content there?

    something like this maybe;

    add_filter('autoptimize_filter_base_replace_cdn','remove_wpcontent');
    function remove_wpcontent($in) {
        return str_replace('wp-content/','',$in);
    }

    Hi Frank ??

    Ok my developer could solve the issue by:
    unchecked options / purged the cache / enabled options /purged the cache

    Just a cache or some settings conflict only!

    But just another issue we couldn’t fix. It seems the async load of css doesnt work but google one works fine.
    https://www.ajibtarin.com

    Is there any other info I need to provide?

    ========================================

    we decided at last to downgrade and stay on 2.1.2 which some things didn’t work well for us after a lot of try. Size of some images became bigger at the end with ao.
    I think 2.1.2 is also good and make our site perfect ??

    Thanks a lot Frank

    • This reply was modified 7 years, 8 months ago by Amir.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    It seems the async load of css doesnt work but google one works fine.

    well, before you switched by to 2.1.2 I did see that you still have *something* messing with AO’s deferred CSS, so the question is what is doing that (I know Cloudflare Rocketloader does, but you’re not using that are you?). guess we’ll never know you’ve rolled back ??

    let me know if you want to chase this down further though (could do that on a non-production site if you want).

    I also noticed that now on TsunamiPremiumVapor.com if I enable HTML optimization, it breaks the conditional logic of my Formidable Forms.

    Plugin Author Frank Goossens

    (@futtta)

    well, HTML optimization didn’t change for 2.2.x, so this is not a regression. do you have specifics about what breaks specifically?

    It may not be related then, I just thought I would bring it up just in case. I did notice after I posted this that my other website doesn’t have this issue with HTML optimization enabled, so it must be something site specific. Yeah, I have fields with conditional logic that tell other fields or content to appear or be hidden based on what selection was made in other fields. With HTML optimization it was not working at all. Any of my fields that were hidden and set to conditionally appear when an option was selected, did not.

    • This reply was modified 7 years, 8 months ago by marketing2.
Viewing 15 replies - 46 through 60 (of 66 total)
  • The topic ‘“liveblog”; known 2.2 issues’ is closed to new replies.