Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1191378

    Hi there,

    Since installing 4.7.3 I found that my site was going crazy; incredibly slow, increased I/O, increased CPU.

    After about a week my database was going nuts and the site barely loaded. The wp_options aviaAsset_avia-head-scripts was over 10MB and full of errors, eg.
    a:1:{s:61:"avia-head-scripts-97639d5c4a28847dbc8b7a5b3c67b221---5e659a935e205";s:21:"error-generating-file";}

    It appears that adding the timestamp to the error is causing the error to be re-generated and appended to the wp_options table EVERY SINGLE TIME A PAGE IS LOADED 🤦‍♂️ Did you guys do any testing?

    The error itself appears to be generated because avia is only injecting one script into the head and it is the compat script which has print set to 1 — meaning there is no content to include in the head script.

    Array
    (
        [hash] => avia-head-scripts-97639d5c4a28847dbc8b7a5b3c67b221---5e659a935e205
        [version] => 4.7.3
        [remove] => Array
            (
                [avia-compat-js] => Array
                    (
                        [name] => avia-compat
                        [url] => https://[site]/wp-content/themes/enfold/js/avia-compat.js
                        [path] => wp-content/themes/enfold/js/avia-compat.js
                        [print] => 1
                        [type] => js
                        [file_content] => 
                    )
    
            )
    
        [file_group_name] => avia-head-scripts
    )

    Can you please confirm:
    1. Should there be anything else in the head?
    2. Why Enfold is not handling the scenario where there is no file to generate gracefully
    3. Why you repeatedly log the same error into wp_options, filling up the table

    Cheers,
    Jason

    #1191381

    PS: my workaround was to edit line 507 of /themes/enfold/config-templatebuilder/avia-template-builder/php/asset-manager.class.php to
    $content = ";";

    This makes a dummy file so the routine does not spew errors on every page load.

    • This reply was modified 7 months, 2 weeks ago by  Jason.
    #1191674

    Hi!

    Thank you for the inquiry.

    Is database object caching enabled in your server?

    // https://wpengine.com/support/wp-engines-object-caching/

    This caching option doesn’t go well with the theme’s file compression settings because of how the theme appends timestamp to the merged files. A fix is provided in the following thread.

    // https://kriesi.at/support/topic/dynamic_avia-making-way-too-many-calls/#post-1182734

    Best regards,
    Ismael

    #1191726

    I am not using WP Engine nor am I doing any database caching.

    The fix in that thread does not work. Please re-read my message where I have given specific data as to what the cause is.

    • This reply was modified 7 months, 2 weeks ago by  Jason.
    #1192658

    Hi,

    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.

    Have you tried adding following code to Functions.php file in Appearance > Editor?

    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 );

    If not, please do so and then go to Enfold theme options > Performance and enable “Delete old CSS and JS files?” at the bottom and save.

    This would replace timestamp with “my_stamp” and therefore new files will not be generated.

    Best regards,
    Yigit

    #1192689

    Hi there,
    !!! Very important !!! You have to delete in table wp_options the row with option_name ‘aviaAsset_avia-head-scripts’.
    After this your web-side will speed up immense!
    There is a bug in enfold. See code above:
    If [print] => true you will get ever an error message in wp_options and this row will grow up endless and your web-side slow down!
    The workaround from enfold is not working.
    Only this is working:

    function whv_update_option_aviaAsset_avia_head_scripts($value, $old_value, $option) {
        /*
         * Enfold Error from 4.7.0
         * 
         * Enfold is writing in table options endless option_name aviaAsset_avia-head-scripts 'error-generating-file' ...
         * So web-side will slow down immense
         */
        
        if (in_array('error-generating-file', $value)) {
            return $old_value;
        }
        else {
            return $value;
        }
    }
    add_filter( 'pre_update_option_aviaAsset_avia-head-scripts', 'whv_update_option_aviaAsset_avia_head_scripts', 10,3 );
    

    And don`t forget to delete ‘aviaAsset_avia-head-scripts’ in wp_options!

    Best regards,

    Wilfried

    #1192872

    Yigit,

    I have stated above what I believe to be the cause – having no scripts in the head, causing the script generation error – compounded with the timestamp on the options entry.

    Your suggested fix still results in the error being generated when it shouldn’t be. It is a workaround, not an actual solution. The optimizer will try to generate a new head script every page load even though there is nothing to include. This is bad for performance.

    I am a bit gobsmacked that you guys haven’t released an update to resolve this as there must be thousands of sites running Enfold with this issue. It’s nothing to do with my server, or caching.

    Cheers,
    Jason

    #1193455

    Hi,

    Thanks for the info. We will forward this thread to our devs :)

    Best regards,
    Yigit

    #1193558

    We also ran into this issue. We disabled all caching from enfold theme for a temporary fix.

    #1194981

    I tried // https://kriesi.at/support/topic/dynamic_avia-making-way-too-many-calls/#post-1182734 fix and although it stopped the increased entries of the generated errors in the aviaAsset_avia-merged-styles , aviaAsset_avia-head-scripts and aviaAsset_avia-footer-scripts option table entries and it overwrites the merged css and js script files, I am unable to get Enfold to even use the merged files vs the standard css and js files on my staging site.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.