• Resolved amitramani

    (@amitramani)


    So I have been using AO for a while now, without any issues. Just yesterday, I moved the site to WP Engine. Ever since then, there seems to be conflict between the CSS and JS loading. I notice that if I have “Optimize CSS” enabled on the AO settings, the site loads without CSS. Also, JS functionality is broken when I enable “Optimize JS” from the AO settings.

    The effect is more pronounced on mobile devices. I have asked WP Engine for help, but their solution is to disable AO.

    Can anyone here offer any tips on how to get AO working without any site rendering issues?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Frank Goossens

    (@futtta)

    hey amit ??

    in general ao can work great on WP Engine (they even recommend it).

    now the nice thing about WPE is that they have a staging site, let’s have a look there maybe? can you enable AO JS and CSS optimization there and provide me with the URL so I can have a look?

    frank

    Thread Starter amitramani

    (@amitramani)

    Hey Frank, the staging URL is :
    https://tacknrider.staging.wpengine.com/

    I have enabled AO now. Let me know if you need access to Admin dashboard.

    • This reply was modified 7 years, 8 months ago by amitramani.
    Plugin Author Frank Goossens

    (@futtta)

    Let me know if you need access to Admin dashboard.

    that might indeed be more efficient ??

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

    frank

    Thread Starter amitramani

    (@amitramani)

    Frank
    Sent via email. Please confirm if you received it.
    Thank you in advance for your help! I know you do not have to do this.

    Plugin Author Frank Goossens

    (@futtta)

    got it Amit ??

    So I removed the CDN-url, which seems to be for production only and did some tests;
    * on my PC using responsive view
    * on my Samsung Galaxy Core Prime with Chrome browser (over wifi)
    * https://www.webpagetest.org/result/170313_70_DH0/ -> Galaxy S7 – Chrome – 3G
    * https://www.webpagetest.org/result/170313_J7_DR1/ -> iPhone 6 iOS 9 – LTE
    * https://www.webpagetest.org/result/170313_K8_DVK/ -> Nexus 7 Landscape – Chrome – LTE

    And all seems to work fine really. can you check on your end and if things don’t work make screenshots & try to capture as much info as possible so we can troubleshoot?

    frank

    Thread Starter amitramani

    (@amitramani)

    Frank
    Sorry for the delayed response.
    Thank you so much! Staging site does look good without the CDN URL. I should have tested on my own without the CDN URL.

    I do see slightly different behavior on the live site, though. As soon as I enable the “Optimize CSS code” setting (even though my CDN URL is blank), the CSS fails to render on mobile.

    I do not mind sharing my live site login with you. Let me know if you have any other suggestions.

    Thread Starter amitramani

    (@amitramani)

    Here is the link to the screenshot of what happens when I enable “Optimize CSS Code” on the live site (viewed on iPhone 6s)

    Live Site with “Optimize CSS Code” enabled on iPhone 6s

    Plugin Author Frank Goossens

    (@futtta)

    ok, some questions first (I try to avoid logging in on live sites);
    * is your staging identical to live? same plugins, same settings?
    * so the problem is only with “optimize CSS”, not with “optimize JS”?
    * the problem only occurs when on mobile? any mobile or only iphone? always or regularly or sometimes?
    * can you re-enable AO and do a couple of tests on webpagetest.org selecting a mobile device from the “location” dropdown (and under “advanced settings”->”test settings” set “number of tests to run” to 5? you can copy/paste the test-result URL in this thread for me to review?

    frank

    Thread Starter amitramani

    (@amitramani)

    Hi Frank
    Answers to your questions:
    * is your staging identical to live? same plugins, same settings?
    [AMIT] The only difference was Object Cache was enabled on Live, it was disabled on Staging. Even after I disabled Object Cache on Live, the result is the same.
    * so the problem is only with “optimize CSS”, not with “optimize JS”?
    [AMIT] I am not sure if JS functionality is also broken. It is hard to tell because the site is not rendering well. Pretty much unusable.
    * the problem only occurs when on mobile? any mobile or only iphone? always or regularly or sometimes?
    [AMIT] It occurs Always. I have tried it with my personal iPhone and it occurs always.
    * can you re-enable AO and do a couple of tests on webpagetest.org selecting a mobile device from the “location” dropdown (and under “advanced settings”->”test settings” set “number of tests to run” to 5? you can copy/paste the test-result URL in this thread for me to review?
    [AMIT] https://www.webpagetest.org/result/170315_Q2_WQH/

    Plugin Author Frank Goossens

    (@futtta)

    OK, I think we’re on to something;
    -> on ACC your autoptimized files are static (i.e. .css or .js)
    -> on PROD they are not (i.e. they’re .php)

    Now knowing there are a number of hosters (not sure about WPE) and also security plugins that block .php-files in /wp-content from being accessed, so that’s what I think what is happening here.

    so tick that ‘Save aggregated script/css as static files’-option in AO on PROD and retest, I give this a 95% chance of fixing your problem ??

    frank

    Thread Starter amitramani

    (@amitramani)

    Frank
    I did as you suggested. Been testing for the last few minutes on just my iPhone. It all looks good so far!!
    While I understand your explanation, what still confuses me is that this problem of CSS rendering only occurs on mobile devices.

    Thanks for your help! I truly appreciate it. You always go above and beyond.

    Plugin Author Frank Goossens

    (@futtta)

    While I understand your explanation, what still confuses me is that this problem of CSS rendering only occurs on mobile devices.

    well, I have no idea how the access to .php is blocked, but theoretically it could differentiate between browsers (“useragent”-string).

    Thread Starter amitramani

    (@amitramani)

    Thank you. Your explanation about User-Agents makes sense. It possibly is related to the Chrome Browser on iPhones.

    Thread Starter amitramani

    (@amitramani)

    Hi Frank
    Seems like somehow Stripe (payment gateway) was broken after this change. Credit card payments are failing with the error message from Line 716
    https://github.com/woocommerce/woocommerce-gateway-stripe/blob/4de601e77df51db756badd3ce187bfe6e008f3df/includes/class-wc-gateway-stripe.php#L716

    I am not expecting you to solve this. Just wanted to know if you had any ideas to suggest. WPE is not willing to help since its more plugin related.

    Plugin Author Frank Goossens

    (@futtta)

    changing from Autoptimize from dynamic (PHP) to static delivery cannot really be the reason Stripe doesn’t work any more.

    but what -if any- JS errors are visible on the browser console when on the woo checkout-page/ when you try to pay?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Need help for debugging on WP Engine’ is closed to new replies.