• Resolved Ryan

    (@ryanlifex)


    YITH Wishlist plugin is enabled and functioning on the site. However, when I review frontend pages with the Query Monitor plugin also enabled, Query Monitor reports two missing dependencies, as follows:

    1. prettyPhoto, called by yith-woocommerce-wishlist/assets/js/jquery.yith-wcwl.min.js
    2. woocommerce_prettyPhoto_css, called by yith-woocommerce-wishlist/assets/css/style.css

    Is this a plugin version conflict, a theme issue, or something else entirely? Thanks in advance!

    WordPress 6.0.3
    Query Monitor 3.10.1
    WooCommerce 7.1.0
    YITH WooCommerce Wishlist 3.14.0
    PHP 7.4.32

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    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.

    Plugin Support Juan Coronel

    (@juaancmendez)

    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!

    Thread Starter Ryan

    (@ryanlifex)

    Done, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Missing dependencies’ is closed to new replies.