• Resolved wiredwilliam

    (@wiredwilliam)


    After updating to WordPress 3.7 the following script is adding a huge chunk of html code to pages.

    <script type=”text/javascript”>
    var wc_product_block_data = JSON.parse( decodeURIComponent(

    It is being flagged by Quterra as “potentially suspicious”. If I revert to previous version of woo commerce this is an issue.

    What is this code? Why is it included?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    I’ve just had a look at the underlying code for WooCommerce although that doesn’t seem to be coming from the core WooCommerce plugin. You can see that directly by visiting the following search results link: https://github.com/woocommerce/woocommerce/search?q=wc_product_block_data&unscoped_q=wc_product_block_data

    Is this only happening on the front-end? Can you share a copy of your system status report as found under **WooCommerce > System Status**?

    Thanks!

    Hi, i have also seen this after updating to Woocommerce 3.7.

    It looks like it’s from WooCommerce Blocks, the comment on it says “This is used to map site settings & data into JS-accessible variables.” That’s all I know about it, maybe the WooCommerce Blocks support will have some ideas.

    Thread Starter wiredwilliam

    (@wiredwilliam)

    I went to the following: woocommerce\packages\woocommerce-blocks\src\Assets.php.

    (This location was identified by this user – freimaks – https://www.ads-software.com/support/topic/why-print_script_block_data-used-on-every-page/)

    Then I just deleted the following code:
    add_action( ‘wp_print_footer_scripts’, array( __CLASS__, ‘print_script_block_data’ ), 1 );

    Scans from Threatwise (by quterra) were flagging this chunk of code as “potentially suspicious”. This seems to have removed the code and solved my problem.

    Vikram S.

    (@jodhavishalsingh)

    Hi, Use this in functions.php

    add_action('wp_footer','wooexperts_remove_block_data',0);
    add_action('admin_enqueue_scripts','wooexperts_remove_block_data',0);
    function wooexperts_remove_block_data(){ 
        remove_filter('wp_print_footer_scripts',array('Automattic\WooCommerce\Blocks\Assets','print_script_block_data'),1);
        remove_filter('admin_print_footer_scripts',array('Automattic\WooCommerce\Blocks\Assets','print_script_block_data'),1);
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘3.7 Update Added Huge Chunk of Code’ is closed to new replies.