Title: array_key_exists() expects parameter 2 to be array
Last modified: July 20, 2018

---

# array_key_exists() expects parameter 2 to be array

 *  Resolved [Victor Font](https://wordpress.org/support/users/vfontj/)
 * (@vfontj)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/)
 * Installed the plugin, site crashes immediately upon attempting to connect to 
   account with following errors:
 * Warning: array_key_exists() expects parameter 2 to be array, string given in /
   home/bachmana/public_html/wp-content/plugins/constant-contact-forms/includes/
   class-settings.php on line 850
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/bachmana/public_html/wp-content/plugins/constant-contact-forms/includes/
   class-settings.php:850) in /home/bachmana/public_html/wp-includes/pluggable.php
   on line 1219
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Farray_key_exists-expects-parameter-2-to-be-array%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512123)
 * Hi [@vfontj](https://wordpress.org/support/users/vfontj/)
 * Sorry to hear that this happened to you. Hopefully you were able to get back 
   in to your admin and everything right away afterwards.
 * We have better checks around this, to help prevent these errors, within our next
   major release. We’re hoping to have it ready soon, but aren’t there quite yet.
 * Let us know if you need anything else.
 *  Thread Starter [Victor Font](https://wordpress.org/support/users/vfontj/)
 * (@vfontj)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512133)
 * I renamed the plugin folder to get the site back up.
 * Any idea when the next release will be out? I have 2 clients anxious to use the
   plugin. I’d rather not look for an alternative.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512156)
 * We can’t make any promises, but I’m personally hopeful it’s within the next few
   weeks.
 * If you would like, I can provide you a copy of the plugin that has just this 
   one fix in place, that you can use in the meantime.
 *  Thread Starter [Victor Font](https://wordpress.org/support/users/vfontj/)
 * (@vfontj)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512207)
 * Yes please. That would be awesome.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512236)
 * Here you go. Should be able to unzip it and then just upload it right into the
   plugins folder. Extracted folder should have a matching name to what you have
   now.
 * [https://www.dropbox.com/s/48z9ufzgobg11pw/constant-contact-forms-array_key_hotfix.zip?dl=0](https://www.dropbox.com/s/48z9ufzgobg11pw/constant-contact-forms-array_key_hotfix.zip?dl=0)
 * For anyone curious, this is the original line:
 *     ```
       } elseif ( array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
       ```
   
 * and this is the modified line to address the error:
 *     ```
       } elseif ( is_array( $opts ) && array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
       ```
   
 *  Thread Starter [Victor Font](https://wordpress.org/support/users/vfontj/)
 * (@vfontj)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512484)
 * Thank you. Error fixed. I’m marking this as resolved.

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

The topic ‘array_key_exists() expects parameter 2 to be array’ is closed to new 
replies.

 * ![](https://ps.w.org/constant-contact-forms/assets/icon-256x256.png?rev=2951825)
 * [Constant Contact Forms](https://wordpress.org/plugins/constant-contact-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/constant-contact-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/constant-contact-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/constant-contact-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/constant-contact-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/constant-contact-forms/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Victor Font](https://wordpress.org/support/users/vfontj/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array/#post-10512484)
 * Status: resolved