Title: Warning: array_key_exists() expects parameter 2 to be array, boolean given in
Last modified: February 5, 2021

---

# Warning: array_key_exists() expects parameter 2 to be array, boolean given in

 *  Resolved [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/)
 * Dears ,
 * when I migrate my website to new host I got this error .
 * Warning: array_key_exists() expects parameter 2 to be array, boolean given in
   ../
   wp-content/plugins/woocommerce/includes/admin/helper/class-wc-helper-options.
   php on line 54
 * I tried to uninstall woo commerce plugin and install the new fresh one . same
   problem appear .
 * PHP version: 7.3.6

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

 *  Thread Starter [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14017847)
 * can any one help
    -  This reply was modified 5 years, 4 months ago by [abonosir](https://wordpress.org/support/users/abonosir/).
 *  Plugin Support [Niall a11n](https://wordpress.org/support/users/wpniall/)
 * (@wpniall)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14171860)
 * Hi [@abonosir](https://wordpress.org/support/users/abonosir/),
 * Sorry to hear you’re having trouble with your site after migrating it to a new
   host.
 * Based on what you described, I suspect there may have been an issue during the
   migration.
 * It looks like the code it is trying to retrieve an option from the `wp_options`
   table, bit it’s being passed as `boolean` instead of an `array`.
 * Could you please provide the following details:
    - The page in your WP-Admin dashboard you are seeing that error on
    -  A screenshot of what you see and where it’s being shown. I recommend [https://snipboard.io](https://snipboard.io)
      for easily sharing screenshots – please follow the instructions on the page,
      then paste the URL in your reply here.
 * For now, please visit **WooCommerce > Status > Tools** and run the tools to `
   Clear Transients` and `Clear WooCommerce Transients`. Please let us know how 
   that goes.
 *  Thread Starter [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14180298)
 * Please find the below link
 * [https://snipboard.io/eolUwm.jpg](https://snipboard.io/eolUwm.jpg)
 * I did the below :
    For now, please visit WooCommerce > Status > Tools and run
   the tools to Clear Transients and Clear WooCommerce Transients. Please let us
   know how that goes.
 * but I got the same error
 *  [Niall Madhoo](https://wordpress.org/support/users/nm1com/)
 * (@nm1com)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14182082)
 * [@abonosir](https://wordpress.org/support/users/abonosir/) thanks for the screenshot
   and for letting me know you are still seeing the same error.
 * Based on the information you have provided so far, I suspect the issue may be
   caused by a conflict with your theme or with another plugin.
      The best way 
   to determine this is to:
    - Temporarily switch your theme to [Storefront](https://www.woocommerce.com/storefront/)
    - Disable all plugins except for WooCommerce
    - Repeat the action that is causing the problem
 * If you’re not seeing the same problem after completing the conflict test, then
   you know the problem was with the plugins and/or theme you deactivated. To figure
   out which plugin is causing the problem, reactivate your other plugins one by
   one, testing after each, until you find the one causing conflict. [You can find a more detailed explanation on how to do a conflict test here.](https://docs.woocommerce.com/document/how-to-test-for-conflicts/)`
 *  Thread Starter [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14185039)
 * I changed the theme . issue still there .
    when I disable woocommerce issue was
   gone I install new one issue came back .
 *  Plugin Support [Niall a11n](https://wordpress.org/support/users/wpniall/)
 * (@wpniall)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14187934)
 * That doesn’t sound good. Could you please confirm if you disabled all plugins
   except for WooCommerce and switched to the Storefront theme at the same time?
 *  Thread Starter [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14187993)
 * yes I did the same
 *  Plugin Support [Damianne P (a11n)](https://wordpress.org/support/users/drwpcom/)
 * (@drwpcom)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14205561)
 * Hi [@abonosir](https://wordpress.org/support/users/abonosir/). Please share your
   system report with me. You can find it by going to WooCommerce > Status > Get
   system report and then click Copy for support to be able to paste it in your 
   reply. Also, make sure that all your plugins and your theme are up to date.
 *  [freuxdesbois](https://wordpress.org/support/users/freuxdesbois/)
 * (@freuxdesbois)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14228681)
 * Ok, same issue as [@abonosir](https://wordpress.org/support/users/abonosir/) 
   with a bonus :
    [https://snipboard.io/qbi43P.jpg](https://snipboard.io/qbi43P.jpg)
 * So, I checked this
 *     ```
       public static function is_connected() {
       		$helper_options    = get_option( 'woocommerce_helper_data', array() );
       		if ( array_key_exists( 'auth', $helper_options ) && ! empty( $helper_options['auth'] ) ) {
       			return true;
       		}
       		return false;
       	}
       ```
   
 * VS
 *     ```
       public static function get( $key, $default = false ) {
       		$options = get_option( self::$option_name, array() );
       		if ( array_key_exists( $key, $options ) ) {
       			return $options[ $key ];
       		}
   
       		return $default;
       	}
       ```
   
 * It seems that the ‘woocommerce_helper_data’ returned false through get_option().
   
   So, I checked in my database the option_name ‘woocommerce_helper_data’ and it
   appeared that the email part in the serialized array was changed. ( Because of
   a replace-all occurences of hostname to the new one ).
 * Maybe this can help you too ? ( checking your option_name in DB )
 *  Plugin Support [Damianne P (a11n)](https://wordpress.org/support/users/drwpcom/)
 * (@drwpcom)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14259191)
 * Hi [@abonosir](https://wordpress.org/support/users/abonosir/). I hope that you
   have managed to resolve the issue. Since we have not heard back from you, I’m
   going to mark this topic solved but please start a new topic if you have any 
   remaining questions.
 *  Thread Starter [abonosir](https://wordpress.org/support/users/abonosir/)
 * (@abonosir)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14271731)
 * the issue still there
 *  [h_rehman90](https://wordpress.org/support/users/h_rehman90/)
 * (@h_rehman90)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14395992)
 * Thanks [@freuxdesbois](https://wordpress.org/support/users/freuxdesbois/) your
   suggestion resolved my issue.

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

The topic ‘Warning: array_key_exists() expects parameter 2 to be array, boolean 
given in’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [Woocommerce migration](https://wordpress.org/support/topic-tag/woocommerce-migration/)

 * 12 replies
 * 6 participants
 * Last reply from: [h_rehman90](https://wordpress.org/support/users/h_rehman90/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/warning-array_key_exists-expects-parameter-2-to-be-array-boolean-given-in-3/#post-14395992)
 * Status: resolved