-
AuthorPosts
-
February 3, 2020 at 5:37 pm #1181000
What is this and why is it calling so often?
February 6, 2020 at 5:14 am #1181954Hey Illingco,
Thank you for the inquiry.
They are the merged scripts and stylesheets. Looks like the server or its configuration is denying access to these files. Unfortunately, we are not sure what’s causing it. Temporarily, you can disable the Performance > File Compression settings to get rid of the issue. If you need to minify the scripts and stylesheets, try to use Autoptimize or BWP Minify instead.
Best regards,
IsmaelFebruary 6, 2020 at 9:26 pm #1182159Your answer is to disable part of your theme’s functionality and use someone else’s?? That does not instill much confidence in your theme. Seems like some error in how Enfold is merging those scripts with the most recent version. I wonder what happens if Enfold is rolled back.
February 6, 2020 at 10:30 pm #1182167This is what is in one file. Is there something wrong in here??
February 9, 2020 at 2:29 pm #1182734Hi,
A few releases ago we added a unique timestamp to the merged filename because when updating the content of a CSS or js file or of Custom CSS option without changing theme version the generated hash for the filename remained unchanged and browsers did not recognize to reload the file but used the cached version instead until this cache expires – means the changes are not visible to visitors.
The problem you have is server related. It seems that your server is caching WP database options and returning that cache instead of the last updated values.
As we save the generated filenames in WP database options Enfold gets the wrong info that the merged files do not exist and therefore creates new ones on every pageload.For the next version (4.7.2.1 or later) I added a filter where you can remove the timestamp.
This means that each created file has the same filename and overwrites the already existing one until your server returns the correct DB value that the file exists and Enfold can stop creating new files.
To functions.php of your child theme add the following (https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/Performance/avf_merged_files_unique_id.php):
function my_custom_merged_files_unique_id( $uniqid, $file_type, $data, $enqueued, $file_group_name, $conditions ) { return ''; } add_filter( 'avf_merged_files_unique_id', 'my_custom_merged_files_unique_id', 10, 6 );
Best regards,
GünterFebruary 11, 2020 at 12:21 pm #1183414This doesn’t work at all. Sorry!
February 11, 2020 at 1:43 pm #1183459February 11, 2020 at 1:53 pm #1183467Hey, everything is automatically up-to-date and server cache is cleared almost everyday in every week.
February 11, 2020 at 3:03 pm #1183529Hi,
@dorisa Günter asked me to check your installed files via FTP, so I replied to your other post because it was your and you can add info in the Private Content area there, this post is not yours so it’s not private.
Lets please continue there.Best regards,
MikeFebruary 11, 2020 at 5:57 pm #1183622I updated to 4.7.3. Do i still need this PHP code, or does the update take care of it?
February 11, 2020 at 6:01 pm #1183626And upon updating the test site, I now get a new error: An error of type E_COMPILE_ERROR was caused in line 177 of the file /home/website/staging/wp-content/themes/enfold/framework/php/inc-autoconfig.php. Error message: require(): Failed opening required ‘/home/website/staging/wp-content/themes/enfold/framework/php/avia_shortcodes/shortcodes.php’ (include_path=’.:/usr/local/php71/pear’).
Cmon people…
February 11, 2020 at 6:01 pm #1183627It doesn’t matter that you updated, you cleared your cache or anything else. The dynamic-avia is never stopping making calls and rewriting scripts over and over again. I even put this PHP code and it does nothing.
February 12, 2020 at 12:54 am #1183708Hi,
@Illingco if you do not want the theme to use a timestamp with the file merging and compression then you would continue to use this filter. I have tested it on my install and the filter works correctly, for example I replaced the timestamp with “my_stamp” using the filter like this:function my_custom_merged_files_unique_id( $uniqid, $file_type, $data, $enqueued, $file_group_name, $conditions ) { return 'my_stamp'; } add_filter( 'avf_merged_files_unique_id', 'my_custom_merged_files_unique_id', 10, 6 );
and this is the results:
So the steps I took were to add the above filter then go to Performance > File Compression and enable “Delete old CSS and JS files” at the bottom of the page, enable css & js file merging and compression, and “save all changes”, then go to the front page and reload.
If css & js file merging and compression was already enabled, then go to the Quick CSS and add a blank space to make the “save all changes” clickable and change the css in the theme to force a new file to be created when the front page is reloaded.
Another example of the filter being used, I saved a copy of the merged files and forced the theme to create a new file, in the screenshot notice the time of the file, these files have the same name and would have overwritten each other because there is no timestamp.
As for your update error, this looks like you tried to overwrite the theme folder instead of deleting it and creating a new theme folder. Is this correct?
Best regards,
MikeFebruary 12, 2020 at 3:29 pm #1183914Hi guys. So if you exactly do, but really exactly, then Mike’s method works, at least it seems like it’s working pretty well until now while we didn’t detect any continuous calling or overwriting issue on dynamic-avia. So far, this is the only reliable solution that provides result, and yes just adding the filter won’t do the work. You must do exactly and apply how Mike described. Good luck to you all and thank you Mike, you nailed it!
February 12, 2020 at 4:25 pm #1183936For the update error, no I did not overwrite. I never do. I rename the existing Enfold folder to Enfold_old, then copy the new Enfold folder over, test, and delete Enfold_old.
Circling back to the filter, do I just copy and paste your PHP into a snippet (don’t have a child theme)? Any changes necessary? Also, not sure what you mean when you say “If css & js file merging and compression was already enabled, then go to the Quick CSS and add a blank space to make the “save all changes” clickable and change the css in the theme to force a new file to be created when the front page is reloaded.” I get the blank space to force the save button to activate, but the part about changing the css in the theme to force a new file to be created is a bit confusing. What css am I changing to force the file to be created? Or do you just mean adding that blank space? Thanks, hopefully a more elegant, hands-off solution will be written into the next release…
February 12, 2020 at 5:16 pm #1183944Also got this when updating the live site. Enfold seems to have more issues lately…
An error of type E_COMPILE_ERROR was caused in line 51 of the file /home/website/public_html/wp-content/themes/enfold/functions.php. Error message: require_once(): Failed opening required ‘config-layerslider/config.php’ (include_path=’.:/usr/local/php71/pear’)
February 12, 2020 at 6:11 pm #1183963For those of us monitoring this thread who are concerned about our own sites… Gunter et al, is this impacting all Enfold installations or only the ones where performance settings are turned on? So far I have not received an email from my hosting provider but want to make sure that does not happen.
Thanks!
February 13, 2020 at 11:58 am #1184113Hi,
@Illingco, what I meant was that adding a blank space into the Quick CSS changes the css by one blank space, thus the theme writes a new file. You can copy the function into your theme’s functions.php, as I posted it.
If you don’t feel comfortable doing this, please include an admin login and FTP access in the Private Content area and we could assist.
@goldengate415, this seems to occur on some servers, we have not been able to recreate.Best regards,
MikeFebruary 13, 2020 at 4:54 pm #1184212I prefer to use a snippet if possible, since functions.php will be overwritten on every update. Is that feasible? Can i just do that, add the space to quick css, save, and be good to go?
February 14, 2020 at 12:29 pm #1184466Hi,
I recommend using a child theme, Read about using a Child ThemeBest regards,
MikeFebruary 14, 2020 at 4:25 pm #1184550So for many who don’t have child themes and can’t do that, then what? Seems to me fixing this at it’s core would be priority #1, not making your users jump through hoops to accommodate code discrepancies that aren’t being addressed. Not to mention needing to totally reconfigure the child theme to match what we already have customized in the main theme…
February 14, 2020 at 10:33 pm #1184618Hi,
A child theme is recommended by WordPress and Enfold, and it is included with EnfoldBest regards,
MikeFebruary 14, 2020 at 11:15 pm #1184626Great. Doesn’t answer my question. Why can’t I just put it into a snippet and be done? A child theme at this point means reconfiguring all my theme customization settings. On a live site no less.
February 14, 2020 at 11:42 pm #1184629Hi,
If you add a snippet to your parent theme functions.php then it will be lost on your next update, that holds true for any file you edit.
You could use a plugin like: My Custom FunctionsBest regards,
MikeFebruary 25, 2020 at 5:09 pm #1187773I have added your filter exactly as you sent it (my_stamp) to a staging site to test, using Snippets (I believe it’s nearly identical to My Custom Functions when used to insert custom PHP to functions.php). Is that correct?
February 27, 2020 at 11:15 am #1188383Hi,
Yes, that should work fine. Please delete the cache and try to enable the File Compression settings again. Let us know if the site still generates multiple copies of the merged files.
Thank you for your patience.
Best regards,
IsmaelMarch 9, 2020 at 7:24 am #1191390Seems this is related to https://kriesi.at/support/topic/4-7-3-js-merge-compression-aviaasset_avia-head-scripts-error-generating-file/#post-1191381
This new timestamp code is flakey.
March 10, 2020 at 2:10 am #1191672Hey!
Yes, the issue is related to database caching. Removing the default timestamp and defining a static ID should fix the issue.
// https://kriesi.at/support/topic/dynamic_avia-making-way-too-many-calls/#post-1182734
Please continue on the next thread.
Cheers!
Ismael -
AuthorPosts
- The topic ‘dynamic_avia making WAY too many calls’ is closed to new replies.