Title: Warning: array_key_exists():
Last modified: August 20, 2016

---

# Warning: array_key_exists():

 *  Resolved [knutsson](https://wordpress.org/support/users/knutsson/)
 * (@knutsson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/)
 * I get this message when I activate the plugin, in the header.
 * Warning: array_key_exists(): The second argument should be either an array or
   an object in wp-content/plugins/nextgen-facebook/nextgen-facebook.php on line
   277
 * Whats wrong?
 * [http://wordpress.org/extend/plugins/nextgen-facebook/](http://wordpress.org/extend/plugins/nextgen-facebook/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/warning-array_key_exists-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/warning-array_key_exists-5/page/2/?output_format=md)

 *  [theshae](https://wordpress.org/support/users/theshae/)
 * (@theshae)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348925)
 * I’m getting the same error on a fresh install running 2012 theme
 *  [RMJ](https://wordpress.org/support/users/rmj/)
 * (@rmj)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348939)
 * Possibly related error but I updated my plugin (from dev version) to public 2.4
   and I’m getting this error:
 * `0 is a protected WP option and may not be modified`
 * The plugin won’t activate anymore. I even tried to delete it and re-install but
   same thing happens. Instlalling older version works just fine.
 * (I did not see the array error anywhere even turned on WP debug info. Just some
   notices of undefined variables related to this plugin)
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348940)
 * Thank you for letting me know. I’m just finishing up a major update and will 
   be releasing v3.0 this afternoon.
 * Line 277 in v2.4 refers to a section that checks to see if all the options exist,
   and if one doesn’t (in case of an update, for example), it creates it with a 
   default value.
 *     ```
       foreach ( $this->default_options as $opt => $def )
           if ( ! array_key_exists( $opt, $opts ) ) $opts[$opt] = $def;
       ```
   
 * This section of code, like pretty much all the rest of the code, has been revised.
   That specific line hasn’t changed much, except that I’ve added a check to make
   sure the associative key has a value.
 *     ```
       foreach ( $this->default_options as $def_key => $def_val )
           if ( $def_key && ! array_key_exists( $def_key, $opts ) )
               $opts[$def_key] = $def_val;
       ```
   
 * If you wouldn’t mind, could you give the DEV version a spin?
 * [http://downloads.wordpress.org/plugin/nextgen-facebook.zip](http://downloads.wordpress.org/plugin/nextgen-facebook.zip)
 * It’ll show v2.9 for now, until I release the final code as v3.0 this afternoon.
 * Thanks,
 * js.
 *  Thread Starter [knutsson](https://wordpress.org/support/users/knutsson/)
 * (@knutsson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348945)
 * The Warning has gone away, but in my theme I cant get the meta tags to show. 
   But in the standard Twentyelven it works fine.
 * you can check my site at kmagazine.se
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348950)
 * Hm. Ok…
 * Would you mind turning on debugging? It’s an option at the bottom of the NGFB
   settings page.
 * Thanks,
 * js.
 *  Thread Starter [knutsson](https://wordpress.org/support/users/knutsson/)
 * (@knutsson)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348956)
 * I have done it, but you have to check at [http://www.eypaco.se](http://www.eypaco.se)
   beacuse the other page I dont want to mess with so much:)
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348958)
 * BTW, if you take a look at your HTML source, there are a few issues…
 * – You should remove those blank lines before the !DOCTYPE.
 * – There’s a `<div id="fb-root"></div>` in the head section — that’s a no-no.
 * – The first anchor `<a href="http://kmagazine.se" rel="bookmark" class="linklogo"/
   >` shouldn’t have a “/” at the end there…
 * – You have nested `<header>` tags, which is a no-no in HTML5.
 * You may want to run your website through the W3 validator. 😉
 * js.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348968)
 * Can you download and try-out the latest DEV version again? I’ve added a little
   more debug info – specifically to see if wp_head() and wp_footer() are available…
   When in debug mode, you should see the following:
 * * First line of your page:
 *     ```
       <!-- NextGEN Facebook OG 2.9 Plugin Loaded -->
       ```
   
 * * As the first and last lines in your header:
 *     ```
       <!-- NextGEN Facebook OG wp_head() Test : Priority 1 = Passed -->
       ```
   
 *     ```
       <!-- NextGEN Facebook OG wp_head() Test : Priority 9999 = Passed -->
       ```
   
 * * And at the bottom of your page, in the footer section:
 *     ```
       <!-- NextGEN Facebook OG wp_footer() Test : Priority 1 = Passed -->
       ```
   
 *     ```
       <!-- NextGEN Facebook OG wp_footer() Test : Priority 9999 = Passed -->
       ```
   
 * Let’s start with that and see if that works. I’ll probably add hooks to other
   WP functions to help debug situations like this…
 * Thanks,
 * js.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3348972)
 * I also tagged v2.4.1 which should fix that array error:
 * [http://downloads.wordpress.org/plugin/nextgen-facebook.2.4.1.zip](http://downloads.wordpress.org/plugin/nextgen-facebook.2.4.1.zip)
 * I was hoping to release v3.0 this afternoon — it’s been rock solid for me, and
   tested on several different websites — but I’d like to get this odd non-running
   plugin issue solved before. 😉
 * Let me know if you get a little farther with v2.9.
 * Thanks,
 * js.
 *  [RMJ](https://wordpress.org/support/users/rmj/)
 * (@rmj)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349042)
 * I still get the error with the dev version. It kills the whole page, all I get
   is (minus header):
 *     ```
       <body id="error-page">
       	<p>0 is a protected WP option and may not be modified</p>
       </body>
       ```
   
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349043)
 * It would help to know which line the problem is on… Do you have access to the
   server’s logs? The error log should have more info.
 * BTW, I released v3.0 last night, and the DEV version is now an in-progress v3.1.
   Not many changes, except adding goo.gl as an URL shortener for Twitter (though
   that code is not complete yet).
 * Would you mind using the stable v3.0 code and letting me know what line number
   is tripping up WP?
 * BTW, what version of PHP are you using? I’ll have to check into known bugs for
   the version you’re using…
 * Thanks,
 * js.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349047)
 * [@rmj](https://wordpress.org/support/users/rmj/),
 * flokohlert reported the same issue in another support thread. A little research
   seems to suggest this might be related to a MultiUser environment issue. There
   are a number of bug reports, but the reports themselves have vanished. Which 
   version of WP are you running?
 * Thanks,
 * js.
 *  [RMJ](https://wordpress.org/support/users/rmj/)
 * (@rmj)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349051)
 * I’m running the newest version of WP.
 * And I cannot give any line number since it’s not a PHP error. I turned on debug
   on in WP also but I get nothing useful.
 * 2.3.1 (dev) version of the plugin is working just fine. After that it breaks.
 * ANYWAYS…
 * I just installed 3.0 version of the plugin and it solved the problem !
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349052)
 * Ah, ok, excellent! Good to hear. 🙂
 * Hopefully it’ll be smooth sailing from here on. 😉
 * Thanks,
 * js.
 *  [DenisBY](https://wordpress.org/support/users/denisby/)
 * (@denisby)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/#post-3349062)
 * I just installed 3.0 to wp 3.5 and have this at the top of my page:
    Warning:
   array_key_exists() expects parameter 2 to be array, boolean given in /var/www/
   htpc.by/wp/wp-content/plugins/nextgen-facebook/nextgen-facebook.php on line 290

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/warning-array_key_exists-5/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/warning-array_key_exists-5/page/2/?output_format=md)

The topic ‘Warning: array_key_exists():’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/nextgen-facebook_f2c17e.svg)
 * [NextGEN Facebook](https://wordpress.org/plugins/nextgen-facebook/)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-facebook/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-facebook/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-facebook/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-facebook/reviews/)

 * 18 replies
 * 5 participants
 * Last reply from: [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/warning-array_key_exists-5/page/2/#post-3349065)
 * Status: resolved