Support » Plugin: Woocommerce Customers Order History » Many errors, and proposed fixes

  • Resolved alx359


    Nice plugin. Unfortunately, when WP_DEBUG is On, there are many outdated code issues (WP5.1.1/WC3.6.2/PHP7.2x) appearing in the php_error.log and over the WP back-end UI that makes the tool unusable.

    The ones I’ve bumped into so far:

    PHP Notice: Undefined variable: userid in admin_dashboard_style.php on lines: ~ 382, 460, and 535

    These can be fixed by adding the line die(); after wp_redirect( site_url('/wp-admin/users.php') ); on lines 8, and 12.

    PHP Notice:  'status' was called incorrectly
    PHP Notice:  'customer_id' was called incorrectly
    PHP Notice:  'id' was called incorrectly

    These can be fixed by refactoring the outdated functions calls like this:

    switch ($value->status) to
    switch ($value->get_status()) on lines: ~ 104, 298, and 414

    $customer_id = $order_details->customer_id; to
    $customer_id = $order_details->get_customer_id(); on line ~276

    $Output .= "<a href='". esc_url( add_query_arg(array('post' => $orders[0]->id ... to
    $Output .= "<a href='". esc_url( add_query_arg(array('post' => $orders[0]->get_id() ... on line ~480



Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author javmah


    Daer alx359,
    Thank you so much for Yor Topic, Very soon I will release a new version. With improved code and bug fixed. Thank you.

    Ps: If you need any Particular feature, Please let me Know.

    Thanks for your kind reply, @javmah.

    Some more feedback if you don’t mind it 🙂

    When hitting Customers Order History > User Order History I’m getting just redirected to Users > All Users. But this screenshot implies I should be seeing other stuff. Why it isn’t showing for me?

    A typo in spelling of 'generated'; woocommerce-customers-order-history.php lines 78, and 339:
    echo "<span class='tips' data-tip=' This order is from a Guest or ganarated by software'>

    For extra clarity, would suggest to rename Customers Order History > Customers Order History to something like Customers Order History > Colour Codes instead.

    Thanks again!

    Plugin Author javmah


    Dear alx 359,
    Thank you so much, for your Nice Topic and findings, Actually, I redirect the Users > All Users to Show that individual user report Can be found On User All User List.

    I will fix those typos.

    Thank you again,

    Sorry, not sure I follow. How exactly do I arrive to this screen?


    Caught an error that happens from a screen of a different plugin that has nothing to do with orders (it seems your plugin is called globally?)

    Uncaught Error: Call to a member function get_customer_id() on boolean in \wp-content\plugins\woo-customers-order-history\woocommerce-customers-order-history.php:276

    The fix that seems to work for me is adding a check before that line:

    public function wcchpo_Order_table_Previous_Orders_columns_content_row($column, $post_id){
       # Gatting order info
       $order_details = wc_get_order( $post_id );
       if(! $order_details ) return; //fix when post_id is not an order
       # Customer ID
      //$customer_id = $order_details->customer_id;
        $customer_id = $order_details->get_customer_id(); //fix for outdated call


    Have fixed and commented too many compatibility issues with admin_dashboard_style.php to describe them here. If interested, please tell how to send the page/plugin to you.

    (PS. Understood from code that orders should be > 1 to redirect to admin_dashboard_style.php. That’s why I didn’t notice that page earlier.)

    Plugin Author javmah


    Daer alx359,
    Thank you brother, Thank you So much for Your effort.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Many errors, and proposed fixes’ is closed to new replies.