• Resolved woodstock0137

    (@woodstock0137)


    Hey, from the last few days I have noticed some weird things on my website https://www.Topbest7.in
    My homepage suddenly appears to be showing images of different alignment and the Top Menu goes off from. I have tried clearing caches on several levels (server, webpage, chrome, from the admin dashboard), but the problem seems to return after a few hours. Today, when I checked the site at Google developer tools, it showed one error “Uncaught SyntaxError: Unexpected token and it points to ——-

    autoptimize_40bea9e042e40f2d765ac0e84a5913ff.js:1 Uncaught SyntaxError: Unexpected token ‘<‘

    ——–
    I am not very techy, so I don’t what’s wrong with the plugin in this case? Sorry, I can’t seem to attach screenshots, so you will have to check the site mentioned above

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

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

    (@optimizingmatters)

    Thanks for re-posting woodstock0137 ??

    I’ve looked at the site and don’t see the JS error you mention and (at first sight) I don’t see a difference between the site with AO on or off (by adding ?ao_noptimize=1 to the URL). Do you currently see the site broken? Can you upload some screenshots to e.g. imgur.com and shere the URL(‘s) here?

    frank

    Thread Starter woodstock0137

    (@woodstock0137)

    Hi Frank, thanks for coming back. Yes, like I said in my note the issue is on and off. When I clear dynamic cache from my Siteground hosting panel, the issue seems to be resolved, but that shouldn’t be a permanent solution.
    When I wrote this post yesterday, the site was broken.

    I have mentioned the below URLs (taken yesterday) —

    https://imgur.com/ZWetQ8F
    https://imgur.com/R9jQBp5
    https://imgur.com/EhZpAHp

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I *think* the cached page at Siteground dynamic cache is at that moment pointing to a missing Autoptimized JS-file due to the AO cache having been cleared (by you or by a “rogue” plugin?) which results in a 404-error which seems to be redirected to the homepage. Clearing the SG cache fixes that as the page will be regenerated with links of existing AO-files.

    So the questions:
    * are you clearing the AO cache manually? or did you install a plugin to do that? or might you indeed have a “rogue” theme or plugin doing that?
    * normally AO has a “404 handler” but you have something else “hijacking” the 404 and redirecting to the homepage -> try to find out what is doing that and see if you can finetune (or disable) it to ensure AO can handle the 404’s in a nicer manner (redirecting to https://www.topbest7.in/wp-content/cache/autoptimize/js/autoptimize_fallback.js)

    frank

    Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    We (SiteGround) turned the Dynamic caching on by default. So either use the SG Optimizer plugin or disable it completely following this article: https://www.siteground.com/kb/disable-dynamic-caching-website/

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    doubt OP wants to disable page caching, but thanks for dropping by Hristo and I’m pretty sure things can be configured so AO & SG-O work together flawlessly? ??

    Thread Starter woodstock0137

    (@woodstock0137)

    Hi Frank, When i reached out to SG with this problem, they did uninstall the SG Optimizer plugin on my WordPress site, so the recommendation to disable the plugin is null. As far as other plugins are concerned, I see I have

    1. Asset clean up
    2. Autooptimize
    3. WP Fastest Cache

    To answer your question, I sometimes clear the cache manually, besides that Autooptimize plugin do that from the backend.

    Do let me know in simple language please what I need to do here. Thanks a ton for your efforts here.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, but in that case you need to follow the info on https://www.siteground.com/kb/disable-dynamic-caching-website/ to ensure the page isn’t cached by both SG and WP Fastest Cache?

    And if you clear AO’s cache ensure to clear WPFC’s too.

    Thread Starter woodstock0137

    (@woodstock0137)

    I am sorry I am a bit lost here, the above link says —

    “Dynamic Caching is a full-page caching mechanism powered by NGINX. It is activated by default on a server level and, even if you do not have the SG Optimizer plugin installed, we will still cache your WordPress. However, the SG Optimizer allows you to have much more control over this process and we highly recommend that you use it for the best dynamic cache results and for full access to the configuration options”

    To be clear, on my WP dashboard, I don’t have SG-O plugin, so should I

    1).Download SG-O plugin
    2).Disable Dynamic Cache

    If I download SG-O plugin, will that not conflict with the installed caching plugins?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    problem is now that you have 2 page caches; SG nginx (dynamic cache) AND WP fastest cache. you should ideally only have one and that one should be manageable from within WordPress to allow you to clear the page cache if needed.

    so in my opinion (although I am not an expert on SG-hosting) you should either (a) keep WPFC and disable SG’s dynamic caching (as explained in the article) OR
    (b) remove WPFC and install SG-optimizer instead (and make sure it does not optimize CSS/ JS as that you have AO doing).

    Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    SG Optimizer can work well with AO just don’t duplicate functionality. If you’re minifying in AO, disable minification in SGO and vise versa. Keep the Dynamic caching on and make sure the Autoflush is on. When AO regenerates styles, etc. that should trigger cache purge and you will see the changes right away.

    Thread Starter woodstock0137

    (@woodstock0137)

    View post on imgur.com

    View post on imgur.com

    Taking a look at these screenshots, do you think there is a clash of settings here which is interfering with the site? I published a post yesterday, which was not visible until I had to flush out the dynamic cache from SG account.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    yes, please disable “minify HTML” and “minify CSS” in WPFC.

    but the issue about having to flush dynamic cache is entirely different: if you want to keep WP Fastest Cache you will have to disable SG’s NGINX page cache. alternatively disable WPFC and install SG-optimizer.

    Thread Starter woodstock0137

    (@woodstock0137)

    Hi, I have now

    1. Minify HTML and Minify CSS on WPFC
    2. Delete dynamic caching through HTAccess file

    The issue seems to be okay from my end, can you validate from your end if it’s all good now?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    so if (1) means “off” on WPFC then OK

    re. (2) yes, that should do (although this is not my area of expertise, but Hristo knows ?? )

    Thread Starter woodstock0137

    (@woodstock0137)

    Yes for point 1, i have unchecked the options for minify HTML/CSS

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘“Uncaught SyntaxError: Unexpected token’ is closed to new replies.