• Resolved skyandsavvy

    (@skyandsavvy)


    After making some changes in Jetpack’s plugin settings (I think the culprit may have been turning on the site accelerator option) on my wordpress admin page, the backend admin page on my site started appearing in unformatted HTML. It had lost its CSS, I guess. After some time and attempts at fixing, I was able to navigate through the HTML version of the admin page and deactivate Jetpack, which immediately fixed the issue. However, upon reactivating, whenever I click ‘set up Jetpack’ the box that loads within my admin screen is also in HTML format. Even stranger, when I visit Jetpack’s official website (www.jetpack.com), it also shows up in HTML format. I am a beginner at wordpress and website building, but after scouring the internet for hours I am baffled. I have tried clearing my browser’s cache, wordpress admin cache, and deleting Jetpack and re-installing it. What is going on? Why would Jetpack’s website be in HTML format, since it’s totally separate from my wp admin page?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Hi @skyandsavvy

    Could you please post your site URL here so that we can have a look?

    If you want it to remain private, you can also contact us via this contact form. If you choose to reach out directly, please include a link to this thread.

    Thanks!

    Thread Starter skyandsavvy

    (@skyandsavvy)

    The site URL is https://skyandsavvy.com, but the issue has already resolved. At this point, I’m just curious as to why it happened. Maybe there was a problem with the Jetpack website’s CSS itself for a few hours? Was there an outage of some sort?

    Plugin Support MadHatter (a11n)

    (@madhattersez)

    I’m happy to hear this is working for you now!

    We didn’t have any recent outages or issues with CSS, no.

    If I had to guess, I’d imagine that your browser may have had some elements stuck in its cache temporarily, which resulted in breaking the formatting that you were seeing temporarily. If that issue hasn’t happened since, then this would make sense.

    Though that doesn’t explain why the official Jetpack site would’ve appeared that way (unless your browser was just being super ornery, hah).

    Please let us know if you have any other questions!

    Hi there! This is just to add a short comment saying that I’ve had a very similar issue as well, and I believe that @madhattersez is absolutely correct in his ‘guess’.

    My setup is rather complex — lots of caching levels, Proton, lots of optimisations, very intricate nginx configuration, several plugins (some of which manually hacked to be compatible with PHP 8.0…). On a multi-site installation, I was getting on the Dev Console a lot of 404 errors, some related to Photon, some related to Jetpack, and, well, some related to all sorts of other plugins. It’s a mess. Here’s an example:

    
    (index):476 GET https://<WP_PATH>/wp-content/plugins/jetpack/vendor/automattic/jetpack-lazy-images/src/js/intersectionobserver-polyfill.min.js?ver=1.1.2 net::ERR_ABORTED 404
    (index):478 GET https://<WP_PATH>/wp-content/plugins/jetpack/vendor/automattic/jetpack-lazy-images/src/js/lazy-images.min.js?ver=1.1.2 net::ERR_ABORTED 404
    

    Now, this doesn’t say much, but fortunately Brave/Chrome/Chromium’s Developer Tools will show something first (grouping many of the errors together):

    
    Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
    

    This baffled me, because clearly those stylesheets are being called with the correct MIME type, i.e. type='text/css' — I checked them all, one by one, and all are correct.

    So, what was going on? This wasn’t very easy to track down, but apparently, it seems that one of the many, many rules I’ve got on nginx failed to account for the extra ?ver=1.0.0 that some of the styles add (I’m not quite sure where it comes from — I guess I could check, but I’m lazy) — as a consequence, the server returned a 404 for that file (because it technically does not exist on disk, after all…), and that 404 is redirected to a ‘standard’ HTML file with some information about the error, so, naturally, when the browser gets an HTML file when it was expecting a CSS file… it complains (because HTML5 is strict with that kind of thing). And it caches the error ‘forever’.

    I’ve fixed it, tweaking with the nginx configuration, and, indeed, all other browsers I’ve got installed (even MS Edge, which technically is based on Chromium) have no issue whatsoever when reloading that particular site, so I know that it’s working. Alas, my ‘main’ browser may cache those things for half an eternity, and not even restarting it will ‘fix’ the issue (I suppose it keeps a disk copy of whatever is cached on the browser, and conveniently reloads it again when it starts…). I might be able to clear all browser caches, but — gasp! — I have far too many open tabs with important things that have in cache and do not want to lose…

    What was confusing me was mainly that things such as ?ver=1.0.0 are intended to work as ‘cache-busters’ — i.e. preventing the browser from caching those files, when they get reloaded. Right… unless you have the many levels of caching/optimisation I got! Ultimately, what happened was that at one of the levels, there was some sneaky URL rewriting, which automagically transformed things such as style.css?ver=1.0.0 into style.css_ver=1.0.0.html or something similar — and this was picked up at some caching level (possibly Cloudflare!) as being a legitimate, HTML file — which gets served statically and flagged for the browser to keep it for 6 months or more! And, of course, reloads/refreshes/reboots will not affect the browser, because it will still think that this pseudo-file is legitimate and ought to remain on the browser cache forever and ever… until something gets tweaked again, and, say, the stylesheet gets updated to show style.css?ver=1.0.1 instead, and then I presume that the whole caching stack will push the old file out of the browser cache and work normally…

    Depending on what exactly on my complex configuration has tagged things to stay ‘forever’ on the cache, it might take a few days, weeks, or even months, until that particular website shows up again (i.e. when the browser cache expires for that particular set of files). That’s why things may ‘suddenly’ start to work again without doing anything. At least, that’s my experience…

    Of course, as said, I was being lazy: I can delete all caches, not only at the browser level, but at the server(s) level as well. The only thing which I cannot directly clear is Proton (although I think that my caching plugin, WP Fastest Cache, communicates in some way with Proton and might be able to flag some files for refreshing, but I’m just wildly speculating here). And that’s why turning Jetpack off will temporarily let everything work again in perfection — the extra layers of caching & performance enhancement provided by Jetpack will be gone, the CSS file names will be slightly different this time, and the whole caching/optimisation stack will reload/refresh everything properly. Sadly, though, deactivating and reactivating Jetpack will also fail — since, once active, Jetpack/Proton will revert to whatever naming convention it uses, and all the other caches will say ‘aha, I’m sure I’ve seen this file before, let’s see if I’ve still got it in cache… oh yes, here it is!’

    Gah!

    Again, as said, in my case, this is not an issue with Jetpack, it’s just an unfortunate (and unwanted) side-effect from having a very complex configuration, and not all levels of the caching stack are aware of the others, so they can — and will! — interfere with each other, especially when I’m tinkering with configurations, thinking I’ve got them right this time, just to add more confusion to the whole mess…

    I’m just adding this comment for the sake of completeness; if someone googles for this particular issue, they might just check their many levels of caching and optimisation and go through one by one until they can figure out which one is messing up.

    But, unlike @skyandsavvy, I could navigate to https://www.jetpack.com/ and see it perfectly formatted, without errors.

    Plugin Contributor Ryan C.

    (@ryancowles)

    @skyandsavvy As others have noted, this was likely related to a caching issue. Since the issue has been resolved, it’s tough to determine exactly what caused the problem in the first place. But based on your description, it sounds like it could have been an incorrect stylesheet or script that was stuck in your browser cache and/or on your server’s cache.

    The fact that you experienced issues on both your site and Jetpack.com indicates to me that this was likely something related to your browser cache, as it wasn’t site-specific. I suspect incorrect scripts or styles were saved locally and when you visited sites that required those, they failed to load properly.

    That’s just a working hypothesis though, since we can’t be 100% sure. If this happens again, my first suggestion would be to try to reproduce the issue in another browser. That would allow you to confirm/deny a caching issue specific to your browser.

    Please let us know if you have any questions or experience any further trouble!

    Thread Starter skyandsavvy

    (@skyandsavvy)

    @ryancowles before the issue was resolved, I tried loading the website on two other browsers, which failed, and also failed after clearing the cache on all of them. I shared your hypothesis initially, but that wasn’t it! The problem only resolved on my website after disabling Jetpack, and resolved on its own on the Jetpack main website after a day. Mysterious.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Jetpack plugin and website appearing in unformatted html’ is closed to new replies.