Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: CSS files are always deleted #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.

    in reply to: CSS files are always deleted #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,

    in reply to: CSS files are always deleted #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?

    in reply to: CSS files are always deleted #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.

    in reply to: CSS files are always deleted #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!

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