Skip to content

Regenerate post CSS (in wp-content/uploads/elementor/css) when missing #7237

Description

@tristanleboss

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Elementor.

Description

If a post CSS file auto-generated by Elementor in the folder wp-content/uploads/elementor/css folder is missing, it's not recreated when either a logged-in or not logged-in user displays the page.

I have the feeling that it was different at some point and the behaviror changed recently. Indeed, when we deploy a site, we flush the CSS cache using the dedicated WP CLI command. Beofre, Elementor was recreating the styles automatically (don't know exactly when). Now, it doesn't and we have to go to "Tools" > "Regenerate CSS".

I think it would be a good idea to regenerate the CSS file if missing on page load.
Adding a WP Cli command to regenerate the CSS cache globally after being flushed could be usefull.

Steps to reproduce

Create a post with Elementor. Publish it. Go to the wp-content/uploads/elementor/css folder. Delete the post-XX.css file. Browse to the page. You will get a 404 error on the style file you just deleted. Elementor will never recreate it.

Isolating the problem

  • This bug happens with only Elementor plugin active (and Elementor Pro).
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

Environment

Elementor v2.4.7
Elementor Pro v2.4.5
WordPress 5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/wp-cliReferences any component related to the integration with WP-CLI.mod*[Temp.] For internal use only.tools/regenerate-cssReferences the Regenerate CSS & Data option in the Elementor Tools admin page.type/developer-apiIndicates when a topic is related to the Developer API and Documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions