Home Forums Pro Themes Profitmag Pro Javascript Warnings

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20017
    Arman
    Participant

    Hello, I have this kind of warnings on my website. Please inform me how can I fix this kind of warnings. It comes from profitmag-pro/js/ folder. Also here is my website http://microphone-expert.com
    jquery.mCustomScrollbar.min.js?ver=1.0.0&nocache=1:1 A Parser-blocking, cross-origin script, http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.

    #20136
    wensolutions
    Keymaster

    Hello @Arman

    This is noted down as a known issue. Which will be fix in upcoming updates as soon as possible.

    The error due to minified version of one of the js so to remove that error for now you need to remove that minified version of js and add unminified version.

    To do that first you need to create and activate child theme.
    You can create child theme manually taking help with the following link:

    https://codex.wordpress.org/Child_Themes

    Or you can take help of some plugin. Below is the link for one of them.

    https://wordpress.org/plugins/wp-child-theme-generator/

    After that all you need to add below code in child theme’s functions.php file.

    
    function profitmag_dequeue_error_scripts() {
    	wp_dequeue_script( 'profitmag-pro-scrolljs', get_template_directory_uri() . '/js/jquery.mCustomScrollbar.min.js', array('jquery'), '1.0.0', true  );
    }
    add_action( 'wp_print_scripts', 'profitmag_dequeue_error_scripts' );
    
    function profitmag_enqueue_unminified_scripts() {
       
        wp_enqueue_script( 'profitmag-pro-scrolljs-unminified', get_template_directory_uri() . '/js/jquery.mCustomScrollbar.js', array('jquery'), '1.0.0', true );
        
    }
    add_action( 'wp_enqueue_scripts', 'profitmag_enqueue_unminified_scripts' );
    

    Hope this will help to resolve your issue.

    Best Regards!!!

    #20476
    Arman
    Participant

    I’am sorry but this doe not helped. after adding this code there is a disclaimer – Unexpected “}”

    #20477
    Arman
    Participant

    Parse error: syntax error, unexpected ‘}’ in /home/content/a2pnexwpnas02_data03/20/3288820/html/wp-content/themes/profitmag-pro-child/functions.php on line 22

    #21425
    wensolutions
    Keymaster

    Hello @Arman,

    We have tested the code in our side and the code is working fine.

    Please make sure that you have created the child theme properly and have properly copied ALL of the code given above.

    Also make sure that you have added the code in the child-theme’s functions.php file at the end of the file without removing any of the code lines already present in the file.

    Please write back to us if the issue persists even after following all the instructions.

    Best Regards !!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.