-
Author
-
March 14, 2016 at 19:05 #110427wachaParticipant
Hello,
I have a strange problem. Sometimes my website load perfectly and sometimes not.
After some reseach i found that sometimes my dynamic.css don’t load because of a 404 error.
Did you already saw this problem ?
Best regards
Jérémy
Attachments:
You must be logged in to view attached files.March 14, 2016 at 21:36 #110518RaduModeratorHi,
Go to wp-content/uploads/ and give 755 permission to that folder custom_styles.
This css file is generated when you press save settings from theme options and visit homepage of site.
Let me know
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 16, 2016 at 10:52 #110937wachaParticipantHi Radu,
Thank you for this fast answer.
I made the permission change but i still have the same issue.
Sometimes the css load perfectly some other not.
(I don’t have any cache plugin).Regards
March 16, 2016 at 19:53 #111033RaduModeratorI see that you have 4.0.1 theme version please update the theme to 4.0.3 then you should update the plugins to, check form wp-admin -> appearance -> install plugins.
Let me know if the update will solve your issue.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 17, 2016 at 11:34 #111200wachaParticipantDear Radu,
How can i know that there is an update because wordpress didn’t tell me about your update ?
Thank you,
JérémyMarch 17, 2016 at 12:22 #111206wachaParticipantUpdate for theme & plugin done but i have still the same problem.
Thank you Radu,
JérémyMarch 17, 2016 at 20:02 #111353RaduModeratorCan you please provide credentials to take a look ?
FTP and Wp-admin credentials
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 18, 2016 at 17:26 #111560RaduModeratorHi,
Did you had installed any cache plugin before this issue ? Or you have used cache service like cloudflare ?
Let me know
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 18, 2016 at 17:34 #111568wachaParticipantHello Radu,
I have w3 total cache witch i installed AND disable before the installation of kleo.
Thank you,
JérémyMarch 22, 2016 at 17:39 #112227AndreiModeratorHi @wacha,
This might happen only and only when you make some changes to the theme options and you have some caching systems enabled on your site. So after you’ve made any changes to the theme, please be sure you clear all your cache systems.
We’ll try to make some improvements in next updates to find a workaround for this common caching behavior.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 22, 2016 at 18:00 #112233wachaParticipantHi andrei,
As i said i disable before the installation of kleo.
Moreover i just delete the plugin.So i have no cache problem right now.
As far as i know with this bug :
– without making any change to the backoffice of wordpress just by refreshing the same page the dynamic.css sometimes load and someother time is 404.What can i do ?
Thank you
March 22, 2016 at 18:08 #112234wachaParticipantMy problem is the exact same as :
https://archived.seventhqueen.com/forums/topic/error-at-loading/March 25, 2016 at 13:18 #112717AndreiModeratorIn that user case the issue comes from the fact that she had some caching systems activated, that’s why I firstly recommended you to check your cache settings.
I will need some extra time to investigate a little bit more about what’s happening in your case.
I’ll let you know once I have any news. Please let the ftp credentials available.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 25, 2016 at 16:18 #112741wachaParticipantAndrei,
Thank you for your answer.
Just want to let you know that while working on the site i temporarily copy all dynamic.css in a tmp.css that i load from a direct link.
April 3, 2016 at 19:18 #114319AndreiModeratorThanks for the tip. I’ll keep you updated on how this goes, we’ll gonna give a closer look into this issue in the following days to see if the issue comes from the theme or from some hosting environment settings.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 24, 2016 at 11:01 #118641wachaParticipantHello,
One month have past since your last message and i still having this issue.
Do you have find something ?Thank you,
JérémyApril 25, 2016 at 19:42 #118831AbeKeymasterHi there, we already fixed that and should be available in KLEO 4.0.6
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 26, 2016 at 16:24 #119024AbeKeymasterI just looked at your site and there is not 404 for the dynamic css resource
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 26, 2016 at 16:37 #119036wachaParticipantDear Abe,
It’s not happen all the time it can be once every or twice every 10 pages.
And as i said earlier check the css loaded because i force to load all the kleo style with a tmp.css to solve the problem.Best regards
April 26, 2016 at 19:33 #119086AbeKeymasterI see you are using a lots of modifications and the css is loaded in the header and the dynamic css is not even registered. Please make sure you have the latest theme update and disable any extra plugins or caching.
The thing is that KLEO only regenerates the dynamic css when you re-save theme options, otherwise it does not get removed.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 27, 2016 at 10:01 #119193wachaParticipantHello Abe,
Ok i’ll check this out.
Can you tell me few things about your theme.
1/ Why sometimes styles are included by dynamic.css and why sometimes it’s included inline ?
2/ Can you explain me this “the dynamic css is not even registered” ? What is a registered css ?
3/ Dynamic.css is only generate when re-saving theme option or when the site is loaded and the file didn’t exist ?Thank you for your help !
JérémyApril 27, 2016 at 10:03 #119194wachaParticipantAnd one more :
Do /wp-content/uploads/custom_styles/ folder need special permission ?
Thank you !
April 27, 2016 at 20:38 #119284AbeKeymasterMaybe you don’t have write permission to the /wp-content/uploads/custom_styles/ folder
if is rendered inline then it is not registered as a css file that loads
If the file does not exist the it will try to generate it and the file is deleted when theme options is changedHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 28, 2016 at 10:14 #119436wachaParticipant2/ Can you explain me this “the dynamic css is not even registered” ? What is a registered css ?
April 28, 2016 at 17:47 #119557AbeKeymasterif is rendered inline then it is not registered as a css file that loads
Example of css style
COPY CODE<link rel='stylesheet' href='//seventhqueen.com/support/wp-content/plugins/bbpress-vip-support-plugin/templates/css/bbps-style.css' type='text/css' media='all'/>
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 27, 2017 at 16:37 #151109wachaParticipantHello,
After all this month i still have this problem.
As you can see, sometimes the dynamic.css is generated, sometimes it’s a 404.Try by resfreshing this url few times :
https://www.mycake.fr/wp-content/uploads/custom_styles/dynamic.css?ver=4.1.7Any advice ?
January 27, 2017 at 17:11 #151111AbeKeymaster@wacha please see if the file exists on the location wp-content/uploads/custom_styles/dynamic.css via Ftp or file manager from cpanel. when a 404 is given try to see on the server it that is actually there.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 27, 2017 at 17:19 #151113AbeKeymasterThe file is regenerated only after you re-save theme options or customizer. Make sure you don’t have any custom codes added that can trigger that.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.May 17, 2017 at 23:17 #161800TreyParticipantI’ve been trying to track this down as well for the last couple of weeks. It seems completely random, none of the settings screens are open when it happens. We don’t have any caching plugins, and the directory is writable by wordpress. I guess something is triggering the file to be regenerated and the front end is getting loaded at that precise moment, before the file is finished saving. It seems that this could be easily fixed in the dynamic-css.php file by adding a file_exists check to the wp_is_writable check on line 29.
In the interim, I’ve just added this to my child theme, so far so good.
COPY CODEif ( ! is_admin() && has_action( 'wp_enqueue_scripts', 'kleo_load_dynamic_css' )) { global $kleo_config; if(!file_exists(trailingslashit( $kleo_config['custom_style_path'] ) . 'dynamic.css')){ remove_action( 'wp_enqueue_scripts', 'kleo_load_dynamic_css', 22 ); add_action( 'wp_head', 'kleo_custom_head_css' ); } }
May 17, 2017 at 23:55 #161817TreyParticipantOk, I tracked down where it happens. It triggers after admin-init, so even on the front end if there is an ajax call. In /kleo-framework/options/framework.php the _register_settings method triggers it when it’s checking for “wrong” media URLs. We serve ALL of our media from S3, so the check to see if its URL contains the WP_CONTENT_URL ALWAYS fails, meaning that it is constantly regenerating the file.
I removed the files and it solved the problem completely. I was able to check because if I pressed enter in the search box the dynamic.css file was never loaded (the live search feature uses ajax which triggers admin-init and deletes the old file), made it much easier to track down when I could replicate the problem.
May 22, 2017 at 17:31 #162314AbeKeymasterhi @trey
So the fix in your case was the above code?
we do have a file_exist check.
see line 22 from lib/dynamic-css.php
if ( $needs_update || ! file_exists ( trailingslashit( $kleo_config[‘custom_style_path’] ) . ‘dynamic.css’ ) ) {Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.May 22, 2017 at 17:45 #162320TreyParticipantNo, actually after some more testing that didn’t work. The problem was that any ajax callback was triggering the file to be regenerated, so if any user used the header search, or facetwp, or loaded an admin page, the file was deleted and rebuilt. The issue was that sometimes another page would be loaded before Kleo was finished writing the new file. As I said in my last comment, the source of the problem was us using S3 to host our icon and logo. The check determines that those files aren’t local and flags the CSS for update. I just put the link to a local file there instead and it “fixed” the problem.
It would be easier to diagnose if when the framework determined that the CSS needed to be rebuilt due to a setting it thinks is “wrong”, it put up a message on the admin side explaining what triggered the rebuild, even if this was only done when debug mode was on. It never let me know that it expected those images to be local files, which could also just be added into the field description.
May 22, 2017 at 17:50 #162322TreyParticipantTo elaborate, the S3 plugin alters the file URL to point to S3, so it is a valid media resource, with an attachment ID, but the framework thinks that since it has an attachment ID, and the URL is NOT local, it must be wrong, so it tried to get the image URL again and flag the CSS for rebuild, when that happens, S3 again changes the URL to point to the correct file and the next time that an admin endpoint is loaded it goes through the process again. This could also be mitigated by only flagging the css for update when someone actually loads the theme options, instead of every single admin URL
May 22, 2017 at 18:10 #162323TreyParticipantIncidentally, the issue is here:
kleo/kleo-framework/options/framework.php line 450:
The method “set_default_args”, which is called from the construct magic method, sets “opt_name” to a blank string. This is altered in the subsequent filters in construct to contain what I’m guessing is the name of the activated theme (because mine is a child theme).
then on
kleo/kleo-framework/options/framework.php line 258:
it checks to see if that array value (
$this->args['opt_name']
) is empty, which it is not, so it continues to line 355, where it adds the admin_init hook to call the _register_settings method, which is where the framework determines if the CSS needs to be updated.So, in fact, your comment that:
“The file is regenerated only after you re-save theme options or customizer.”is incorrect. The file is regenerated if _register_settings thinks it needs to be on ANY admin page load.
May 24, 2017 at 11:54 #162538AbeKeymasterHi, the removal process happens only with this function: kleo_write_dynamic_css_file() that is called when the theme options or the customizer are saved.
On every request indeed there is a check for the file if it exists and if it doesn’t exist then it will be generated with this function kleo_generate_dynamic_css() but this one doesn’t delete the file.
I am trying to see why this happens but it doesn’t make sense. If the URL is changed by the plugin and on our file_exists check it fails to find it then it will try to create it but not delete it. And if it was trying to delete it, it couldn’t since the path is changed with the S3..
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.May 25, 2017 at 18:38 #162689TreyParticipantThe URL to the stylesheet isn’t changed. It’s the logo and favicon attachments, the theme expects them to be in a local directory.
If you walk through my last post you will see that, in fact, kleo_write_dynamic_css_file() is called any time an admin page is loaded when the ReduxFramework::_register_settings() method determines it needs to be.
It sets a flag to do an update here:
File: /kleo-framework/options/framework.php
Lines: 2212-2284If I can find time I’ll try to set up a backtrace and post it later.
Install WP Offload S3 and upload a logo, you can add some debug output to the kleo_write_dynamic_css_file() function and see that it triggers every time an admin page is loaded.
-
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.