WC 10.0.3 DOMPurify bug
-
When using WC 10.0.3 or higher and BookingWP, BeaverBuilder doesn’t work and it throws this error:
jQuery.Deferred exception: DOMPurify is not defined ReferenceError: DOMPurify is not defined
at HTMLSpanElement.<anonymous> (https://domain.com/wp-content/plugins/woocommerce/assets/js/jquery-tiptip/jquery.tipTip.min.js?ver=10.0.4:1:660)
jquery.min.js?ver=3.7.1:2 Uncaught ReferenceError: DOMPurify is not defined
at HTMLSpanElement.<anonymous> (jquery.tipTip.min.js?ver=10.0.4:1:660)Disabling BookingWP works. But keeping BookingWP enabled and using WC 10.0.2 also works.
Curent hotfix is to enqueue the DOMPurify script:
function fix_missing_dompurify_script() {
wp_enqueue_script(
'dompurify',
'https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.2.6/purify.min.js',
[],
'3.2.6',
true
);
}
add_action('admin_enqueue_scripts', 'fix_missing_dompurify_script', 5);
add_action('wp_enqueue_scripts', 'fix_missing_dompurify_script', 5);—
WooCommerce 10.0.3 introduced DOMPurify for sanitizing tooltip content. However:
- DOMPurify is not always enqueued when WooCommerce code that uses it is run.
- When BookingWP triggers WC tooltip-related scripts (e.g., in admin booking/product UI),
- And Beaver Builder uses or extends UI components via
jQuery.Deferred, - DOMPurify is expected to exist on
window, but hasn’t been defined yet — resulting in a fatal JS error.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘WC 10.0.3 DOMPurify bug’ is closed to new replies.
