Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter saydex

    (@saydex)

    Hello Jeremy!

    Thank you for the response. Out of curiosity, I tried dump out $file_data_option and realize this variable was an serialized string (!!) instead of an array.

    The serialized string:

    string(3293) "a:1:{s:5:"4.7.1";a:52:{s:32:"31e5b9ae08b62c2b0cd8a7792242298b";a:14:{s:4:"name";s:20:"Spelling and Grammar";s:11:"description";s:40:"Check your spelling, style, and grammar.";s:14:"jumpstart_desc";s:0:"";s:4:"sort";s:1:"6";s:20:"recommendation_order";s:0:"";s:10:"introduced";s:3:"1.1";s:7:"changed";s:0:"";s:10:"deactivate";s:0:"";s:4:"free";s:0:"";s:19:"requires_connection";s:3:"Yes";s:13:"auto_activate";s:3:"Yes";s:11:"module_tags";s:7:"Writing";s:7:"feature";s:7:"Writing";s:25:"additional_search_queries"......
    

    So doing this following also solves the bug:

    2323         $file_data_option = unserialize( $file_data_option );
    2324         $file_data_option[ JETPACK__VERSION ][ $key ] = $data;

    Interesting observation is that after running the fixed code once, the second time around $file_data_option was able to output a proper array. One thing to note is that we did upgrade Jetpack from 3.8.x to 4.x, so there could be some old data that just won’t work under the new version.

    Hope this helps.

    PS. I have sent a support request to Jetpack as well to report the bug & fix.

    Thread Starter saydex

    (@saydex)

    Further update:

    Hi Wordfence, I believe the bug was partially due to the fact we have a premium WordPress plugin that doesn’t provide the URL required to check for updates…and hence the notice…

    Since we cannot change the fact that those premium plugins not offering a URL, would you be able to add a isset() check to $vals->url so this notice can be avoided when $vals->url doesn’t exist?’

    Thank you!

    Thread Starter saydex

    (@saydex)

    Hi Rustaurius,

    I see. The production site is using the Headway theme (https://headwaythemes.com/) and I’m not sure if might have something to do with causing the error. (Needs to try switch to the default WP theme to test)

    It seemed like the Ultimate FAQ plugin was called before the existence of the WooCommerce class and hence rendered the issue…

    Adding a check against the existence of WooCommerce would help?

    /**
     * Check if WooCommerce is active
     **/
    if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
        // Put your plugin code here
    }

    https://docs.woothemes.com/document/create-a-plugin/

    OR using the WC Integration Class

    https://docs.woothemes.com/document/implementing-wc-integration/

    Thread Starter saydex

    (@saydex)

    The error showed up on a WooCommerce Product Single page (https://domain.com/products/product-name) with the Ultimate FAQ plugin version 1.2.4. The error has already been temporarily fixed with my above ‘hack’ so I cannot show you on the actual production site though.

    I imagine the main problem was that global $product didn’t work as expected.

    According to your code:

    global $product;
    $Product_Post = get_post($product->get_id());
    $Category = get_term_by('name', $Product_Post->post_title, 'ufaq-category');

    The main purpose here is to grab the Post Title (Which is the WooCommerce product name), I imagine it’ll make more sense to use get_the_ID() to get the actual ID of the post / product?

    Not quite sure why the global $product doesn’t seem to work with the filter woocommerce_product_tabs.

Viewing 4 replies - 1 through 4 (of 4 total)