• Resolved Cliff

    (@drrichbunk)


    Yesterday the Breeze plugin caused a fatal error during a WooCommerce customer checkout:

    2025-09-26T05:58:08+00:00 Critical Uncaught TypeError: Breeze_PurgeCache::purge_post_on_update_content(): Argument #2 ($post) must be of type WP_Post, null given, called in /var/www/html/public_html/wp-includes/class-wp-hook.php on line 324 and defined in /var/www/html/public_html/wp-content/plugins/breeze/inc/cache/purge-cache.php:214

    Additional context

    {

    "error": {

    "type": 1,

    "file": "/var/www/html/public_html/wp-content/plugins/breeze/inc/cache/purge-cache.php",

    "line": 214

    },

    "remote-logging": true,

    "backtrace": [

    "",

    "#0 /var/www/html/public_html/wp-includes/class-wp-hook.php(324): Breeze_PurgeCache->purge_post_on_update_content()",

    "#1 /var/www/html/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",

    "#2 /var/www/html/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",

    "#3 /var/www/html/public_html/wp-includes/post.php(5110): do_action()",

    "#4 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php(86): wp_insert_post()",

    "#5 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php(106): Abstract_WC_Order_Data_Store_CPT->create()",

    "#6 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): WC_Order_Data_Store_CPT->create()",

    "#7 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(224): WC_Data_Store->create()",

    "#8 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(273): WC_Abstract_Order->save()",

    "#9 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(471): WC_Order->save()",

    "#10 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1336): WC_Checkout->create_order()",

    "#11 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(543): WC_Checkout->process_checkout()",

    "#12 /var/www/html/public_html/wp-includes/class-wp-hook.php(324): WC_AJAX::checkout()",

    "#13 /var/www/html/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",

    "#14 /var/www/html/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",

    "#15 /var/www/html/public_html/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(116): do_action()",

    "#16 /var/www/html/public_html/wp-includes/class-wp-hook.php(324): WC_AJAX::do_wc_ajax()",

    "#17 /var/www/html/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",

    "#18 /var/www/html/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",

    "#19 /var/www/html/public_html/wp-includes/template-loader.php(13): do_action()",

    "#20 /var/www/html/public_html/wp-blog-header.php(19): require_once('/var/www/html/p...')",

    "#21 /var/www/html/public_html/index.php(17): require('/var/www/html/p...')",

    "#22 {main}",

    "thrown"

    ]

    }

    The customer was using the Sezzle payment gateway when checking out. There were no Sezzle errors in the log, but I want to mention that in case it may be related to this error.

    • This topic was modified 2 months ago by Cliff.
Viewing 1 replies (of 1 total)
  • Plugin Author owaisalam

    (@owaisalam)

    The issue comes from the hook where the cache is cleared on post/CPT update. The second argument ($post) is expected to be a WP_Post object, but in your case it’s coming through as NULL. Something in your environment is altering this value.

    To make the function more flexible, we can loosen the verification and allow a NULL value. That way, if the function relies on the WP_Post object, we add extra checks/verification to ensure nothing else breaks.

    So instead of:

    public function purge_post_on_update_content( int $post_id, WP_Post $post, bool $update ) {

    It becomes:

    public function purge_post_on_update_content( int $post_id, $post = null, bool $update ) {

    We’ll also update the method’s head comment accordingly.

    For proper verification, we would ideally need access to a staging environment. If you’d like our Breeze team to test this on your setup, please reach out to breeze@cloudways.com.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.