Tagged: dynamtic css, missing css
-
AuthorPosts
-
April 3, 2024 at 10:06 pm #1439133
Hello,
I had another thread that have been closed but it is not completed: https://kriesi.at/support/topic/dynamic-css/
Today we experiencethat min. 5 websites lost their styling and we even tried to add the function that you guys suggested but it did not fix it until we cleared cache.
Can you please take a look at this again?
April 4, 2024 at 6:38 am #1439143Hey mvi,
Thank you for opening another thread.
Could you please share a link to one or two of the sites where this issue is occurring? Also, include the login details in the private field.
Have you tried to disable the default compression settings from the theme and instead enable the compression options available in the cache plugin? Enabling both options might be redundant and could potentially lead to issues.
Best regards,
IsmaelApril 4, 2024 at 8:34 am #1439166Hello Ismael,
I have added the login details in the private field.
The CSS File Merging And Compression are set to: Disable – no CSS file merging and compression
The Javascript File Merging And Compression are set to: Disable – no Javascript file merging and compressionApril 4, 2024 at 9:57 am #1439178Hi,
Thank you for the info.
The site seems to be rendering correctly when we checked. The dynamic css are loaded as expected. Would you mind providing a screenshot of the issue? You can use platforms like Savvyify, Imgur or Dropbox to upload and share the screenshot. Here are the steps to follow:
1.) Visit the website of your chosen platform, such as Savvyify, Imgur or Dropbox.
2.) Locate the option to upload a file or an image.
3.) Select the screenshot file from your computer or device and upload it to the platform.
4.) After the upload is complete, you will be provided with a shareable link or an embed code.
5.) Copy the link or code and include it in your message or response to provide us with the screenshot.Thank you for taking the time to share the screenshot. It will help us better understand the issue you’re facing and provide appropriate assistance.
Best regards,
IsmaelApril 4, 2024 at 12:20 pm #1439190Hi,
Yeah i see that it is working now.
It is probably because the caching have been cleared. It do that after some time.I can send a new website when we spot it and i will do what you ask me in above steps.
Best regards,
MortenApril 4, 2024 at 4:07 pm #1439210Hi,
Thanks for the update, we’ll keep this thread open for you.
Best regards,
RikardMay 1, 2024 at 9:54 am #1441556Hi,
So we are now seen this issue again. I post some of the websites that have the issue in the private content.
Can you take a look at them?May 1, 2024 at 3:55 pm #1441597Hi,
All the site you posted in your last reply are loading the styling fine on my end, how can we reproduce the result you are seeing on your end?
Best regards,
RikardMay 1, 2024 at 3:57 pm #1441599Hi,
The problem is the issue get fixed if the cache are been cleared.
I have talked with our host that says this:
what happens is that the Enfold theme/plugin generates a CSS file, the page cache is then created during a visit and this cache contains a link to the CSS file.The theme then randomly changes either the path or the name of the CSS file but the cache isn’t cleared so the site shows broken.
If you check one of those files you’ll see that they no longer exist:https[:]//webiste-name[.]com/wp-content/uploads/dynamic_avia/avia_posts_css/post-14[.]css?ver=ver-1711102485
So you need to check in with theme support or developer for an option that disables the dynamic file creation 🙏 This is not something that can be done on our side, as it is an issue with the theme itself 🙏
May 2, 2024 at 9:09 am #1441821Hi,
When the theme options are saved, then the theme resources are regenerated. There is nothing random about it. If you want to remove the version number and time stamp from the CSS files, then you can do so under Enfold->Performance->Show Advanced Options. If you want to disable the post CSS file creation, then you can add this to your functions.php file:
/** * Filter to skip css file generation. * You can add logic to skip for certain pages/posts only. * * @since 4.8.6.1 * @param boolean $create * @return boolean true | false or anything else to skip generation of css file */ function custom_avf_post_css_create_file( $create ) { return false; } add_filter( 'avf_post_css_create_file', 'custom_avf_post_css_create_file', 10, 1 );
Best regards,
RikardMay 2, 2024 at 2:54 pm #1441930Hi,
Which one of the settings should i choose (see link in privat ssection) and should i also add the script that you posted or would i be enough to disable the timestamps?
May 2, 2024 at 8:23 pm #1441986Hi,
Query strings are under the Remove Query String From Static Resources option, and I can’t really tell you what you should or should not do with the post CSS snippet. If you don’t want separate CSS files for each post, then please add it.
Best regards,
RikardMay 2, 2024 at 8:43 pm #1441991Hi Rikard,
I’m not sure what you are writing about here.
1. The script you mention i can add to the functions.php, how will that help that the websites losing the styling?
2. The image i posted, which one would you suggest to use if i wan’t it not to add unique timestamps, and it is because of that the styling are missing?
3. What are this “Remove Query String From Static Resources option”?
Why should i do that, and should i combined to disable it which the other things above?I can figure out what solution should fix the issue.
May 3, 2024 at 8:57 am #1442082Hi,
I think it’s wrong to call this an issue, since clearing cache is something you should do every time some sort of styling has changed on your site. Most of the settings in Enfold are styling settings, and cache should be cleared after something has been changed. If you don’t want to clear your cache for whatever reason, then I would suggest that you remove the query string first of all to see if that achieves what you are looking for. If not, then we’ll take it from there. Query string are the characters which are added after the file name.
Best regards,
RikardMay 3, 2024 at 9:04 am #1442086Hi,
I will call it an issue since this happens randomly on our pages.
So we do not make any changes it just happens out of the blue and yes it get fixed when we clear the cache and we have set our server up up to clear cache every hour but if a client get into the website in that hour where it haven’t be cleared and see this they will ask questions.Normally we manually clear cache when we make changes, so i agree to clear the cache if changes have been made.
I will try test to remove Query string from some of our websites and try some others which the function you wrote may 2.
I will get back to you if nothing works :-)
May 3, 2024 at 2:33 pm #1442177Hi,
Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardJune 12, 2024 at 9:14 am #1448966Hi,
So i now tried with both solutions and i still get sites that are missing all the styling, what can we now do?
I have shared website and screenshot of what i see.June 15, 2024 at 5:43 pm #1450617Hi,
Thank you for your patience, I checked the sites that you linked to but I found no errors like your screenshots.
In your original thread using the avf_post_css_create_file snippet seemed to help you and two other users.
It also seem to be due to a server setting: X-Content-Type-Options “nosniff” another user found that when they change this on their server the issue was solved. But as I recall you can not change this on your server, so you should use the avf_post_css_create_file snippet.
I am unable to reproduce this issue even if I change the server settings to: X-Content-Type-Options “nosniff” so it seems that only certain servers have this error and it doesn’t seem to be directly a result of the theme settings but how the server handles X-Content-Type-Options “nosniff”Best regards,
MikeJune 17, 2024 at 8:43 am #1451611Hi Mike,
Thank you for getting back to me. It get fixed when the cache have been cleared so that maybe why you can see the error on the live website, thats why i add the screenshots of it and the error.
But i can say that using the avf_post_css_create_file snippet do not fix it, because i have tried test it on some sites and they get the error and i tried on some other sites use remove query string and tiemstamps and they do also get this error.
So i need a another solution to this.
June 17, 2024 at 11:25 am #1451617Hi,
Try having your webserver disable X-Content-Type-Options “nosniff”, this seems to be the root of the problem.Best regards,
MikeJune 18, 2024 at 8:13 am #1451845Hello,
So i talked with our hosting provider and they response to your disable X-Content-Type-Options “nosniff” are this:
“Disabling this header would expose your site to potential security risks by allowing browsers to guess the MIME type of files, which can lead to unintended behavior and vulnerabilities such as XSS attacks.And I’m afraid we will not disable it from the server end for security purposes.”
They do also say this after a dialogue:
“The theme developers should be working with you on solving this and checking compatibility with other plugins”“ it’s a good idea to check further with the theme devs and tell them besides disabling that header we are happy to help with other tests or check logs if they need us to”
So are this something you can look into?
June 20, 2024 at 12:14 am #1452069Hi,
I reviewed the other thread with the solution and see that they didn’t disable the X-Content-Type-Options “nosniff” they only changed it from being in the nginx http and https directives additional headers box in plesk apache and nginx settings but instead are in the htaccess file.
Try asking your webhost to try this, the nosniff is still activate but in a different way. Perhaps they will understand this better and can adjust your server settings to suit.
The theme can not make these changes to your server and thus can not correct the error that the web browser is having with the server.
From our research there has only been three examples of this issue from the thousands of activate users using Enfold and the other two both found this code in their functions.php to solve:function custom_avf_post_css_create_file( $create ){ return true; } add_filter( 'avf_post_css_create_file', 'custom_avf_post_css_create_file', 10, 1 );
Best regards,
MikeJune 20, 2024 at 2:42 pm #1452345Hi,
So i have talked with our host again and regarding to the “Nosniff” thing they say this:
“We don’t use plesk nor apache, so no htaccess. We do use nginx and that ‘nosniff’ header is, I’m afraid, unalterable.”The function that you mention do not work, i have tried insert it on some pages and the issue still occurs and even if i changed the performance settings:
1. Unique Timestamp Of Merged Files And WP Object Cache Bug -> Fix WP bug, disable unique timestamps
2. Remove Query String From Static Resources -> Remove query stringsWe can see in the console that the issue always are this URL: “/wp-content/uploads/dynamic_avia/avia_posts_css/post-555.css?ver=ver-####”
#### are a different number each time.And we can see that AVIA post are some from /themes/enfold/ so it is a theme issue and i need you to look further into this because our solution do not work.
They did also say this
“We (our host and us) found an issue on site X at this time.
Kinsta tech jump on the site – he found the error on the console:
“MIME type error” and clicked on the CSS link in that error – which showed a 404 page (which explains the MIME type as the page is not CSS).
He then jumped onto the server where the actual file in question was not found
“Screenshot 1”
During investigations the cache was invalidated (expired) and the site ‘fixed itself’ and was working without intervention – the tech at Kinsta then checked and the file was there again.
“Screenshot 2”
“stat screenshot”June 20, 2024 at 10:15 pm #1452890Hi,
Thanks for the feedback, but it looks like the filter was not enabled:function custom_avf_post_css_create_file( $create ){ return true; } add_filter( 'avf_post_css_create_file', 'custom_avf_post_css_create_file', 10, 1 );
if this was enabled the css files in the screenshot would not be present, please put the filter in and try again.
Best regards,
MikeJune 20, 2024 at 10:27 pm #1452903Hi Mike,
As i mentioned before I have tried the function on other sites and the issue are still happening.
I posted a site in the private section that have had the issue 3 times and 2/3 times were after i added it.
The site x in the previous comment were just a other site we found and our host could test on it while the issue were there.
June 20, 2024 at 10:55 pm #1452938Hi,
Perhaps you have made an error in adding this filter, please include an admin login in the Private Content area so we can check.Best regards,
MikeJune 25, 2024 at 3:22 pm #1458645Hi,
I have created a login for you.
This site have had the issue 3 timesJune 27, 2024 at 4:09 am #1459801Hi,
Thanks, I see the filter in place, but I don’t find the post-css or this error on your site.Best regards,
MikeJune 27, 2024 at 7:26 am #1459816Hi Mike,
As mention the issue happens randomly so you need to monitor the site, because we can recreate the issue.
What post css? We have our child theme for extra styling but the dynamic css are from the parent theme.
If the filter are placed correctly, it do not work because the site still have had the issue.
June 28, 2024 at 11:02 pm #1460018 -
AuthorPosts
- You must be logged in to reply to this topic.