• Resolved stathisstr

    (@stathisstr)


    Hello, i’m trying to view my orders in woocomerce and it shows me just 7 with a message at the bottom “there is a critical error in your website please check your inbox for more information”

    In my indox came an email referring that code snippets are mulfunctioning. I deleted the last snippet added and still the same error shows up.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Just a guess but the Redux plugin had serious issues this morning knocking a few sites offline. If you have Redux installed, upgrade to 4.2.9 which should fix it.

    If you don’t use Redux, please ignore this message.

    Thread Starter stathisstr

    (@stathisstr)

    Thanks Edith, but Redux is not installed. The following error i think is the reason.

    2021-07-08T08:22:32+00:00 CRITICAL Uncaught Error: Call to a member function get_category_ids() on bool in /var/www/vhosts/randp.gr/public_html/traumaedu/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code:23
    Stack trace:
    #0 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-includes/class-wp-hook.php(294): shop_order_posts_custom_column()
    #1 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters()
    #2 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-includes/plugin.php(484): WP_Hook->do_action()
    #3 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-admin/includes/class-wp-posts-list-table.php(1282): do_action()
    #4 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-admin/includes/class-wp-list-table.php(1447): WP_Posts_List_Table->column_default()
    #5 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-admin/includes/class-wp-posts-list-table.php(1315): WP_List_Table->single_row_columns()
    #6 /var/www/vhosts/randp.gr/public_html/traumaedu/wp-admin/includes/class-wp-posts-list-ta μ?σα στο /var/www/vhosts/randp.gr/public_html/traumaedu/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code στην γραμμ? 23

    Hi, stathisstr, are you able to post the full code snippet that’s causing the issue?

    I’m assuming that you have a custom code snippet that invokes the get_category_ids() function.

    Thread Starter stathisstr

    (@stathisstr)

    Hello Ian, i think it’s this one

    add_filter( ‘manage_edit-shop_order_columns’, ‘shop_order_columns’ );
    function shop_order_columns( $columns ){
    $new_columns = (is_array($columns)) ? $columns : array();

    $new_columns[‘category’] = ‘Κατηγορ?ε?’;

    return $new_columns;
    }

    add_action( ‘manage_shop_order_posts_custom_column’, ‘shop_order_posts_custom_column’ );
    function shop_order_posts_custom_column( $column ){
    global $post, $the_order;

    if ( empty( $the_order ) || $the_order->get_id() != $post->ID ) {
    $the_order = wc_get_order( $post->ID );
    }

    $category_name_array = array();
    $i=0;

    foreach ($the_order->get_items() as $item_id => $item_data) {
    $product = $item_data->get_product();
    $category = $product->get_category_ids();

    $name = get_product_category_by_id($category[0]);
    $category_name_array[$i] = $name;
    $i++;
    }

    if ( $column == ‘category’ ) {
    $arrlength = count($category_name_array);
    $category_to_display = ”;
    for($x = 0; $x < $arrlength; $x++){
    if($x == 0){
    $category_to_display = $category_name_array[$x];
    } else{
    $category_to_display = $category_to_display.”, “.$category_name_array[$x];
    }
    }
    echo($category_to_display);
    }
    }

    function get_product_category_by_id( $category_id ) {
    $term = get_term_by( ‘id’, $category_id, ‘product_cat’, ‘ARRAY_A’ );
    return $term[‘name’];
    }

    Plugin Support Cara

    (@dcka)

    Hi, @stathisstr!

    Sorry for the delayed response here. Could you try disabling the Code Snippets plugin entirely to see if that fixes the error? If it does, then one of your other snippets may have been causing the issue, and you can start narrowing the issue down from there.

    If the issue isn’t from any of your other snippets, you may need to run a full conflict test according to the steps here: How to Test for Plugin and Theme Conflicts.

    Thread Starter stathisstr

    (@stathisstr)

    Good morning Cara and thanks for your advice.
    I deactivated the plugin code snippets and everyting worked correctly.
    I activated the plugin and disabled 2 snippets and everything worked correctly.
    The main problem now is what could i do to fix the snippets that causing the problem.

    Hi @stathisstr

    The main problem now is what could i do to fix the snippets that causing the problem.

    I’m going to leave it open for a bit to see if anyone is able to chime in to help you out. I can also recommend the following places for more development-oriented questions:

    WooCommerce Slack Community: https://woocommerce.com/community-slack/WooCommerce Community on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Critical Error in your Website’ is closed to new replies.