Incorrectly called function warning
-
Hi,
I’m running WPC Linked Variation for WooCommerce v4.4.3 and getting the following notice in the admin panel, surfaced via Query Monitor:
Function WP_Scripts::add was called incorrectly. The script with the handle “wpclv-backend” was enqueued with dependencies that are not registered: wc-enhanced-select, selectWoo.
It shows up on unrelated admin pages, for example on the Advanced Discount Prices plugin’s settings page, not just on product edit screens.
Looking at wpc-linked-variation.php, admin_enqueue_scripts() is hooked to the admin_enqueue_scripts action without any screen check, so it runs on every admin page. wc-enhanced-select and selectWoo are only registered by WooCommerce on its own screens, so on other admin pages they don’t exist yet when wpclv-backend declares them as dependencies.
Environment: WordPress 6.9.1, WPC Linked Variation 4.4.3, WooCommerce (latest).
Thanks in advance
You must be logged in to reply to this topic.