Title: Multiple PHP notices
Last modified: October 30, 2021

---

# Multiple PHP notices

 *  Resolved [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/)
 * Hi,
 * Thank you for this awesome plugin.
 * I just installed this on my local installation with the following config:
    WooCommerce
   version: 5.8.0 WordPress version: 5.8.1 Order Status History for WooCommerce 
   by alx359 – 1.7.3
 * With debug.log enabled, I saw a few PHP notices / some errors:
    `[30-Oct-2021
   06:24:45 UTC] PHP Notice: Undefined variable: arg in [path]\wp-content\plugins\
   order-status-history-for-woocommerce\includes\class_osh.php on line 600`
 * `[30-Oct-2021 06:26:04 UTC] PHP Notice: Undefined variable: customer_address 
   in [path]\wp-content\plugins\order-status-history-for-woocommerce\includes\admin\
   order-history-customer.php on line 27`
 * `[30-Oct-2021 06:26:04 UTC] PHP Notice: Undefined variable: customer_phone in[
   path]\wp-content\plugins\order-status-history-for-woocommerce\includes\admin\
   order-history-customer.php on line 28`
 * Please review and guide / fix.
 * Thanks
 * Take care, stay safe!

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

 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15021184)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/),
 * Thanks for your feedback. Have just pushed `1.7.4` update that should address
   these notices. Please test and report back if you might find any further issues.
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15022163)
 * Hi,
 * Thank you for the prompt reply and the quick update.
 * I have updated to 1.7.4
 * With this update, the above reported notices have gone. Thanks a lot.
 * Now when I navigate to Woocommerce -> Customer History -> Products I get the 
   below notices:
 * `Notice: Undefined offset: 0 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 160`
 * `Notice: Undefined offset: 1 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 162`
 * Please review and guide / fix.
 * Thanks again.
 * Take care, stay safe!
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15035842)
 * [@alx359](https://wordpress.org/support/users/alx359/) I dug a bit into the notices
   and the source and found that it seems to be linked to the treatment of support
   for composite products and their components.
 * My store does not use a composite product / components.
 * Is there some other way to use this awesome plugin without errors?
 * Thanks
 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15051800)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/) ,
 * Sorry for the late reply. I didn’t receive the WP support email for some reason,
   and few moments back noticed your reply by chance.
 * I’ve pushed 1.7.5 update addressing the described issue. Please test and report
   back if you may find any further issues.
 * Thanks.
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15062026)
 * [@alx359](https://wordpress.org/support/users/alx359/) Thank you for your update.
 * I updated the plugin to v 1.7.5 and I STILL observe the below recurring notices
   when I navigate to Woocommerce -> Customer History -> Products
 * `Notice: Undefined offset: 0 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 161`
 * `Notice: Undefined offset: 1 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 163`
 * Please review and guide / fix.
 * Thanks again!
 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15064330)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/), thanks for your 
   feedback. I’ve pushed `1.7.5.1` that hopefully fixes the issue for you this time.
   Thanks.
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15066373)
 * [@alx359](https://wordpress.org/support/users/alx359/) Sorry, but even with 1.7.5.1
   I am **STILL **getting the recurring notices when I navigate to Woocommerce -
   > Customer History -> Products
 * `Notice: Undefined offset: 0 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 161`
 * `Notice: Undefined offset: 1 in [path]\wp-content\plugins\order-status-history-
   for-woocommerce\includes\admin\order-history-product.php on line 163`
 * Please review and guide / fix.
 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15068114)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/),
 * Hmm, that’s strange, it feels like some sort of a cache issue now, as in `1.7.5.1`
   such notices shouldn’t happen anymore.
 * Would you please check the code in `/wp-content/plugins/order-status-history-
   for-woocommerce/includes/admin/order-history-product.php`. Starting from `line
   159` it should read like this:
 *     ```
       # support for composite products and their components
       $meta_data    = $item->get_meta_data();
       $item_data    =  is_object( $meta_data[0] ) ? $meta_data[0]->get_data() : array();
       $is_composite = !empty( preg_grep('/.*component.*/i', flatten_array( $item_data ) ) );
       $item_data    =  is_object( $meta_data[1] ) ? $meta_data[1]->get_data() : array();
       $is_component = !empty( preg_grep('/.*component.*/i', flatten_array( $item_data ) ) );
       ```
   
 * If the above code block looks the same, would please comment out lines `161` 
   and `163`, and see what you get in the `debug.log` after a product page refresh?
   The path to that page should actually be:
 * `Woocommerce menu > Customer History menu > 'Orders History' button > Products
   tab`
 * Thank you.
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15068465)
 * [@alx359](https://wordpress.org/support/users/alx359/) Thank you for your continued
   interest in trying to fix this for me! I really appreciate this.
 * I could see the code as mentioned by you.
 * When I commented out lines 161 and 163 and refreshed the Product tab, I get a
   fatal error with the below in debug.log
 *     ```
       [15-Nov-2021 09:30:18 UTC] PHP Notice:  Undefined variable: item_data in [path]wp-content\plugins\order-status-history-for-woocommerce\includes\admin\order-history-product.php on line 162
       [15-Nov-2021 09:30:18 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to oshwoo\flatten_array() must be of the type array, null given, called in [path]wp-content\plugins\order-status-history-for-woocommerce\includes\admin\order-history-product.php on line 162 and defined in [path]wp-content\plugins\order-status-history-for-woocommerce\includes\php_ext.php:57
       Stack trace:
       #0 [path]wp-content\plugins\order-status-history-for-woocommerce\includes\admin\order-history-product.php(162): oshwoo\flatten_array(NULL)
       #1 [path]wp-content\plugins\order-status-history-for-woocommerce\includes\admin\order-history.php(40): include('F:\\laragon\\www\\...')
       #2 [path]wp-content\plugins\order-status-history-for-woocommerce\includes\class_osh.php(219): include('F:\\laragon\\www\\...')
       #3 [path]wp-includes\class-wp-hook.php(303): oshwoo\osh->add_order_history('')
       #4 [path]wp-includes\class-wp-hook.php(327): WP_Hook->apply_filters('', Arr in [path]wp-content\plugins\order-status-history-for-woocommerce\includes\php_ext.php on line 57
       ```
   
 * Please review and guide.
 * Thanks
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15068504)
 * [@alx359](https://wordpress.org/support/users/alx359/) If it helps, I did some
   trial and error and made the following changes to make it error free (so far!
   I don’t know what else I broke)
 * `/wp-content/plugins/order-status-history-for-woocommerce/includes/admin/order-
   history-product.php`
 * I removed
    1. Line 160 to line 164 2. Line 179 to line 181 and line 183 3. Line
   188 to line 190 and line 192
 * After this the Product Tab works for me without any errors in debug.log.
 * Does this help you in any way?
 * Thanks again for such a persistent interest in solving this issue.
 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15069189)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/), yes, getting rid
   of the composite support code shall indeed fix the issue, but I need that support
   to remain as I do actually use it.
 * Would you please return all code back to unedited state and instead for a moment
   add a new line of test code after line `160` this way:
 *     ```
       # support for composite products and their components
       $meta_data    = $item->get_meta_data();
       error_log( var_export( $meta_data ), true ) ); #<--add this line
       ```
   
 * and after reloading the products tab page send me the `debug.log` results to 
   <my_nickname>@gmail .
 * (You may clear any identifiable data if you want. I only need to know what’s 
   so special about that `$meta_data` variable you got that’s still giving such 
   issue.)
 * Thanks for your help.
 *  Thread Starter [koolpal](https://wordpress.org/support/users/koolpal/)
 * (@koolpal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15071937)
 * [@alx359](https://wordpress.org/support/users/alx359/) I have sent you the email
   just now. I hope it helps.
 *  Plugin Author [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15392481)
 * Hi [@koolpal](https://wordpress.org/support/users/koolpal/)
 * Version `1.8` was just deployed. It contains the fix you already got for your
   issue, and also some important performance improvements. I’m closing this ticket
   now, but you’re always welcome if you may encounter any issues. thanks.

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

The topic ‘Multiple PHP notices’ is closed to new replies.

 * ![](https://ps.w.org/order-status-history-for-woocommerce/assets/icon-256x256.
   png?rev=2283376)
 * [Order Status History for WooCommerce](https://wordpress.org/plugins/order-status-history-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/order-status-history-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/order-status-history-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/order-status-history-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/order-status-history-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/order-status-history-for-woocommerce/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [alx359](https://wordpress.org/support/users/alx359/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/multiple-php-notices-7/#post-15392481)
 * Status: resolved