Hello Ryan,
we hope you’re doing well!
This may be because our plugin uses dependencies only when needed, for performance optimization purposes, so you shouldn’t worry about the Query Monitor warning.
Anyway, you can try adding the following code in the functions.php file of your active theme:
if( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_enqueue_back_required_assets' ) ) {
function yith_wcwl_enqueue_back_required_assets() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$version = defined( 'WC_VERSION' ) ? WC_VERSION : '';
wp_enqueue_style( 'woocommerce_prettyPhoto_css', plugins_url( 'assets/css/prettyPhoto.css', WC_PLUGIN_FILE ), array(), $version );
wp_enqueue_script( 'prettyPhoto', plugins_url( 'assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', WC_PLUGIN_FILE ), array( 'jquery' ), '3.1.6' );
wp_enqueue_script( 'prettyPhoto-init', plugins_url( 'assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', WC_PLUGIN_FILE ), array( 'jquery' ), $version );
}
}
add_action( 'wp_enqueue_scripts', 'yith_wcwl_enqueue_back_required_assets', 9999 );
Check it out and tell us any news, please.
Have a nice day!
Thread Starter
Ryan
(@ryanlifex)
Thanks for your reply.
When I add that snippet to functions.php in the active theme, Query Monitor reports these missing handles on the front end:
- prettyPhoto
- prettyPhoto-init
- woocommerce_prettyPhoto_css
I can ignore the warning if it does not cause issues with the site.
Hello Ryan,
Then, you can remove the code that we have sent you. You can also not worry about this warning since it really does not affect your site or its performance.
If you have any other questions, feel free to contact us.
Have a nice day!