Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1491253

    Hi guys,

    We found out that no matter what we choose in “Delete Old CSS and JS files”, the files of /wp-content/uploads/dynamic_avia/avia_posts_css get deleted upon saving the changes.

    How can we make sure that Enfold respects the “Delete Old CSS and JS files” box?

    Thank you,

    #1491258

    Hey marcsteiner1,

    Thank you for the inquiry.

    Are all the files in the avia_posts_css folder deleted when saving changes to a post or page? This option should only delete files that are no longer needed. What happens when you disable the cache and compression plugin?

    Best regards,
    Ismael

    #1491278

    Hi Ismael,

    Sorry, what I meant is that all the files in the avia_posts_css folder get deleted when pressing the “Save all changes” button on the Enfold settings page. This button: https://i.imgur.com/2frX3XH.png

    And that happens even when the “Delete Old CSS And JS Files” is disabled and when there is no cache in place. You can see it by yourself in the staging site link I sent you before.

    Thanks!

    #1491307

    My customer’s website is having the same issue. It has the latest version of Enfold Parent theme. I made a couple edits per their request and Enfold Child stripped away all CSS.

    #1491320

    Hi,

    Thank you for the update.

    We created a test page with an element that has custom styling, so it has its own post css file. When we resave the theme options, the old css file is removed but then regenerated with a new timestamp. The custom styling of the elements is preserved as expected. Do you notice any changes on the page, such as missing element styling, when you resave the theme options? (see private field)


    @earthchilde
    : Please open a new thread, create a test page and provide the login details in the private field.

    Best regards,
    Ismael

    #1491371

    Hi Ismael,

    I think we are still not on the same page. Let me try to explain it again.

    The problem is that Enfold deletes the old CSS files when saving the theme options. That always happens. It doesn’t matter whether you have made changes to pages or not. It doesn’t matter whether the “Delete Old CSS And JS Files” option is disabled. It’s simple: you press the “Save all changes” button and the CSS files are deleted. Here’s a step by step to reproduce the problem:

    1. Open the homepage from an Incognito.
    2. See the /wp-content/uploads/dynamic_avia/avia_posts_css/post-1614.css file created.
    3. Open the theme options.
    4. Go to the Performance section.
    5. See that “Delete Old CSS And JS Files” is disabled.
    6. Press the “Save all changes” button.
    7. The /wp-content/uploads/dynamic_avia/avia_posts_css/post-1614.css file gets deleted. This should not happen. We explicitly chose these files not to be deleted.

    This is not a problem if there is no cache in place. But almost everyone has a cache plugin, a CDN, or server cache. This means that when the files get deleted, the pages in question still serve the deleted files, and the only solution is to clear the cache manually so that Enfold can regenerate the CSS.

    But the bottom line is that Enfold has a bug where it deletes the CSS files even when we choose not to.

    I hope that clarifies it.

    Thank you.

    #1491377

    marcsteiner1, That was a perfect explanation of what is happening on my customer’s website as well!

    #1491378

    The only part I wanted to add is that I received an email notification for my customers theme on October 10th I downloaded the update and installed it for my customer and shortly thereafter the problem started. In my case I had done some customizations in Enfold Child but not only were the customizations removed all CSS was removed. I cannot use unfold child at all for my customer and they are complaining that their website looks different now. My observation is that you cannot use Enfold child with this newest updated version of Enfold.

    #1491390

    Hi,

    The post css files are not actually deleted; the timestamp of the post css file is just updated, so you won’t be able to access the same file without updating or using the correct timestamp. We tested this again on the test page and didn’t find any changes to the element with the custom styling. Do you see any styling issues on the page after resaving the theme options? We posted the post css file of the test page in the private field, with and without its timestamp.

    We did notice that the post css file has a “ver” prefix on the query parameter in its timestamp. This is not the case on our installation. Do you have any idea why it’s prefixed? Is this a custom modification?

    https://app.site.com/wp-content/uploads/dynamic_avia/avia_posts_css/post-25947.css?ver=ver-1763353330

    Best regards,
    Ismael

    #1491392

    Hi Ismael,

    Again, it’s not about losing the styling or not. It’s about the theme’s functionality. Please follow these steps, and feel free to try them yourself. This time I am adding screenshots:

    1) Go to the custom CSS folder. You can see that the CSS file exists: https://i.imgur.com/YLUSIKJ.png

    2) Go to Theme Options > Performance and scroll down. You will see the option that says “Delete Old CSS And JS Files” is unchecked: https://i.imgur.com/saPibEH.png

    3) Toggle the option on and then off again so the button to save the changes becomes available: https://i.imgur.com/UKA29Ny.png

    4) Save the changes. The CSS files should not be deleted, correct? Now check the folder again: https://i.imgur.com/NTTBKLb.png

    5) The link now redirects to a 404: https://app.site.com/wp-content/uploads/dynamic_avia/avia_posts_css/post-25947.css

    6) On a live site, the CSS does not get regenerated because caching systems serve a cached page and prevent the request from reaching Enfold so it can regenerate the CSS. This is problematic because the CSS should not have been deleted in the first place.


    @earthchilde
    : Am I missing something here?

    #1491437

    Hi,

    4) Save the changes. The CSS files should not be deleted, correct? Now check the folder again: https://i.imgur.com/NTTBKLb.png

    This is normal since the theme actually deletes all css files when the theme options are saved, regardless of whether they’re expired or not. This ensures that the custom styles or post css reflect any changes made in the theme options. When we mentioned the css files are actually “not deleted”, we meant that they still exist in the database and will be regenerated on the frontend once the site or page is revisited.

    5) The link now redirects to a 404: https://app.site.com/wp-content/uploads/dynamic_avia/avia_posts_css/post-25947.css

    This is true, but only because you haven’t visited the page or post yet or utilize the updated timestamp as mentioned above. Once the page or post is revisited, the theme automatically generates the post css files again with the updated changes before displaying the page.

    6) On a live site, the CSS does not get regenerated because caching systems serve a cached page and prevent the request from reaching Enfold so it can regenerate the CSS. This is problematic because the CSS should not have been deleted in the first place.

    When we tested this in the staging site, we didn’t see any styling issues, even when the cache plugin was activated. As long as the styles of the site are preserved, we don’t see any issues here. If you can provide access to the live site, we’ll check it further.

    Best regards,
    Ismael

    #1491451

    Hi Ismael,

    The fact that files are physically deleted is a problem. Honestly, it’s a bit frustrating, because if you guys don’t see any problem, we are stuck with a theme that will cause display issues when you least expect it.

    Since you’d like to see style issues, here’s the steps you need to follow. It can also be reproduce on the staging site:

    1) Activate WP Rocket (the cache plugin we use)

    2) Flush WP Rocket’s cache.

    3) Visit the homepage from an Incognito window. Everything looks good. Notice the backgrounds and the file: https://i.imgur.com/Za2PKtu.png

    4) Go to Theme Options > Performance and scroll down. You will see the option that says “Delete Old CSS And JS Files” is unchecked: https://i.imgur.com/saPibEH.png

    5) Toggle the option on and then off again so the button to save the changes becomes available: https://i.imgur.com/UKA29Ny.png

    6) Save the changes.

    7) At this point, the physical CSS files are deleted.

    8) Close the previous Incognito window and open a new one.

    9) Visit the homepage again. Styles are missing: https://i.imgur.com/oqqtgWN.png

    The reason is clear. Enfold is deleting the files the cached page still references to. I think you need to solve this in any way:
    – Either flush the cache of the most popular cache plugins automatically,
    – or make the checkbox “Delete Old CSS And JS Files” do what it’s supposed to do (if anyway they’re deleted, why does this checkbox exist?),
    – or provide a solution (a filter or something) so that we can flush the cache programmatically when the “Save the changes” button is pressed.

    Thank you,

    #1491455

    Hi again,

    I managed to fix it. For those with the same problem, here’s a code snippet to add to the functions.php file that will flush both WP Rocket’s cache and object cache automatically, right after pressing Enfold’s “Save all changes” button.

    // Clear WP Rocket cache and Object Cache when Enfold Theme Options are saved
    add_action( 'avia_ajax_after_save_options_page', function( $new_options ) {
    	
    	// Object Cache Pro: flush object cache
        if ( function_exists( 'wp_cache_flush' ) ) {
            wp_cache_flush();
        }
    	
    	// WP Rocket: full cache purge
        if ( function_exists( 'rocket_clean_domain' ) ) {
            rocket_clean_domain();
        }
    
    }, 20 );


    @Ismael
    , I suggest you forward this to your team, as there is clearly something wrong here:
    – The checkbox “Delete Old CSS And JS Files” is confusing. One expects to not have the CSS deleted if it’s unchecked.
    – If there’s object cache in place, even when all caches are flushed after saving Enfold’s settings, the new CSS is not generated. Object cache needs to be cleared too.

    By the way, the ver=ver-1763353330 parameter is not something of our website. Even Enfold’s demo has it: https://kriesi.at/themes/enfold-2017/

    Thank you.

    #1491470

    Hi,

    thank you very much for providing the solution.

    It will be added to core in the next release 7.1.4.

    We will also add support for more popular plugins and filter ‘ava_force_clear_caches’ for not supported plugins.

    Best regards,
    Günter

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.