GithubHelp home page GithubHelp logo

WP Rocket compatibility: so-widgets-bundle is executing rocket_clean_domain and rocket_clean_minify 4 times after updating a post. This causes server problems in some cases about so-widgets-bundle HOT 3 OPEN

sandyfigueroa avatar sandyfigueroa commented on July 4, 2024
WP Rocket compatibility: so-widgets-bundle is executing rocket_clean_domain and rocket_clean_minify 4 times after updating a post. This causes server problems in some cases

from so-widgets-bundle.

Comments (3)

Misplon avatar Misplon commented on July 4, 2024

Thanks, Sandy. We'll attend as soon as we have a gap. You're also welcome to email us directly at any time at [email protected]. Cheers.

from so-widgets-bundle.

AlexGStapleton avatar AlexGStapleton commented on July 4, 2024

Hi Sandy,

Thank you for providing a copy of the log, and your detailed response. I've had a look at the provided logs and it doesn't appear this issue is related to the Widgets Bundle. It appears to be related to Page Builder. Specifically, the below lines in the provided log appear to highlight what's going on:

9) /nas/content/live/k9uchstaging/wp-content/plugins/siteorigin-panels/inc/admin.php(1015): apply_filters('widget_update_c...', Array, Array, Array, Object(SiteOrigin_Panels_Widgets_Layout))
10) /nas/content/live/k9uchstaging/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
11) /nas/content/live/k9uchstaging/wp-includes/class-wp-hook.php(326): rocket_widget_update_callback(Array)
12) /nas/content/live/k9uchstaging/wp-content/plugins/wp-rocket/inc/common/purge.php(27): rocket_clean_domain()

Here's an outline of what's happening here:

Page Builder is updated.
We [trigger widget_update_callback here](https://github.com/siteorigin/siteorigin-panels/blob/develop/inc/admin.php#L1015).
WP Rocket picks up on this through `rocket_widget_update_callback`.
WP Rocket then fires `rocket_clean_domain`

WP Rocket is clearing the site cache when the user updates a widget in Page Builder. This makes sense based on traditional WordPress Widget usage (basically, all widgets are in global Widget areas), but Page Builder (and other plugins) add them to pages so a widget update can occur outside of that context. In this specific instance, the WP Rocket callback is triggered multiple times presumably due to there being multiple widgets on the page. Whether that's something we should prevent, or you should on your end isn't clear. Open to ideas, and happy to work with you on this.

Regarding the rocket_clean_minify you mentioned, that code is run when 'upgrader_process_complete', 'switch_theme', and 'activated_plugin' actions. This is to allow for the Widgets Bundle CSS cache to be safely cleared. We make use of rocket_clean_post when clearing it on a post by post basis.

Kind regards,
Alex

from so-widgets-bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.