Title: error when reading the &#039;ngfb_options&#039; array from the database
Last modified: August 20, 2016

---

# error when reading the 'ngfb_options' array from the database

 *  Resolved [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/)
 * Ok, so I appear to have fubared this one up something fierce.
 * As of this morning I had version 2.40 working fine, with no issues.
 * I attempted to update to the latest version with 2 other plugins, and in doing
   so ended up with the “0 is a protected WP option and may not be modified” error
   that took my entire site down.
 * I removed the plugin for NGFB by deleting the plugin folder and everything came
   back up. I updated each of the other plugins in question individually, and the
   second time 3.1.1 installed correctly. However, when activating, I am getting
   the warning message that
 * `WordPress returned an error when reading the 'ngfb_options' array from the database.`
 * Moreover, the settings page once active does not go beyond the Default Image 
   ID line (the rest of the settings are not loading), and any attempt to change
   them results in:
 * `Using $this when not in object context in /wp-content/plugins/nextgen-facebook/
   nextgen-facebook.php on line 402"`
 * Attempting to put 2.4 back generates an error
 * `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`
 * 2.41 generates a similar error:
 * `Warning: array_key_exists() expects parameter 2 to be array, wp-content/plugins/
   nextgen-facebook/nextgen-facebook.php on line 275`
 * What should be next step be here? Thanks.
 * [http://wordpress.org/extend/plugins/nextgen-facebook/](http://wordpress.org/extend/plugins/nextgen-facebook/)

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

1 [2](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/page/2/?output_format=md)

 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362831)
 * Hmmmm… I might have gotten a little too fancy in calling sanitize_options() (
   in the NGFB class) from the ngfbAdmin class.
 * Give the dev version a spin and let me know if that fixes your problem:
 * [http://downloads.wordpress.org/plugin/nextgen-facebook.zip](http://downloads.wordpress.org/plugin/nextgen-facebook.zip)
 * If you’re still having an issue, here’s what you can try:
 * – Remove the plugin and visit the admin settings page. This should deactivate
   the plugin (WP will detect that it is no longer there and de-activate it automatically).
 * – Then extract the dev version back into the plugins folder.
 * – Then in your wp-config.php file, add the following:
 *     ```
       define('NGFB_RESET', true);
       ```
   
 * – Then go back to the plugins admin page, and activate NextGEN Facebook OG.
 * NGFB should re-create the default options.
 * – Go to the NGFB settings page and save them.
 * – Then remove the NGFB_RESET constant you defined earlier.
 * Hopefully that’ll clear-up whatever pesky issue there is with NGFB’s option entry
   in the database…
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362850)
 * Thanks.
 * This was a partial fix. I did use the reset line in wp-config and managed to 
   have it save the settings. I am now able to activate and deactivate the dev (
   3.1.2) without error messages.
 * However, in the plugin settings area while active, I am not seeing any of the
   settings below “Default Image ID “. So instead of getting the laundry list if
   buttons, meta-tags, etc., I am only seeing the first 5 or so options.
 * It’s a big step in the right direction though.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362852)
 * Ok, I’ve added even more checks around the options-related methods.
 * Download the dev version again and let me know if you get a little farther.
 * If you don’t, then I’ll need a little more info… Would you mind installing and
   activating the “BlackBox Debug Bar” plugin? It’ll show you all PHP related errors
   as you move from page to page. When you visit the NGFB settings page, hopefully
   it’ll show an error that I can use to track down the source (normally there shouldn’t
   be any errors from NGFB).
 * Don’t be surprised if you see a lot of errors from other plugins… Not everyone
   checks their code for PHP error msgs. 😉
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362873)
 * I’m guessing I use the same link as the post above? I did manually remove and
   re-add it. I had to do the wp-config reset again though.
 * No luck on getting the settings page to show all of the settings. I did install
   the BlackBox plugin, but it didn’t seem to load the toolbar for the NGFB settings
   page. All of the other settings pages and menu pages within the admin menu seem
   to load the bar and mention at least 1 error, so I found that a bit strange it
   wouldn’t even load the bar…
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362883)
 * Yes, the dev link always points to the current dev code.
 * Ok, then I guess you can de-activate Blackbox. It’s a little odd that it doesn’t
   load, but then again, we’re tracking down what’s probably a code WP bug or somekind…
 * Let’s at least try and rule out any issue with the NGFB options…
 * Do you have phpmyadmin installed to manage your MySQL database? If so, you could
   try to:
 * 1) Deactivate NGFB.
    2) Sort the {prefix}_options table in MySQL by name, then
   look for an entry called ‘ngfb_options’, and delete it. 3) Activate NGFB again.
 * If you don’t have phpmyadmin installed, or you don’t feel comfortable with it,
   you could try:
 * 1) Deactivate NGFB.
    2) Define the following constant. 3) Activate NGFB again.
 *     ```
       define( 'NGFB_OPTIONS_NAME', 'ngfb_options_new' );
       ```
   
 * If that works, then we know it’s something in the options. If it doesn’t, then
   the problem is somewhere else… Somekind of incompatibility maybe…
 * BTW, are you running NextGEN Gallery, and if so, what version?
 * Hm. Have you tried disabling other plugins to see if NGFB starts working? Maybe
   another plugin is getting in the way…
 * Thanks,
 * js.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362887)
 * BTW, you might also want to take a look at WP-DBManager, and WP Clean Up. 😉
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362888)
 * Okay, I went and removed the options table and then re-activated. Alas, no change
   there. I also went through and de-activated each plugin-in one by one with no
   change.
 * I also have a test blog I use as a sandbox that is a separate database. I installed
   the official 3.1.1 version there as well as 2.4 and 2.41. For each of them, I
   am getting the same behavior as described here.
 * Neither of the installations have any other NextGen plugin besides the FB one.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362892)
 * Ok, well, at least we’re taking some things off the table. 😉
 * Thanks for being patient.
 * I’m thinking maybe it’s a PHP issue, so re-wrote some of the code around the “
   Default Image ID” section — same thing, just written different. 😉
 * Download the current dev version ( [http://downloads.wordpress.org/plugin/nextgen-facebook.zip](http://downloads.wordpress.org/plugin/nextgen-facebook.zip))
   and let me know if you get a little farther… 🙂
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362897)
 * Oh I am nothing if not patient, and I appreciate the effort.
 * I tried the one provided. Alas, no change.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362900)
 * Well, since Blackbox didn’t work, and you have a sandbox, you might as well turn
   WP_DEBUG on. 😉
 *     ```
       define('WP_DEBUG', true);
       ```
   
 * Let me know if you get a little more info and I’ll continue to investigate on
   this end…
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362905)
 * The only debug messages that appear from what I see include:
 * `register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget()
   instead. on line 2824 in file /wp-includes/functions.php` (twice)
 * and
 * `has_cap was called with an argument that is deprecated since version 2.0! Usage
   of user levels by plugins and themes is deprecated. Use roles and capabilities
   instead. on line 2908 in file /wp-includes/functions.php`
 * The first message appears both in the admin console and the main page itself.
   The second only appears in the admin console.
 * Lastly, I don’t know if it means anything, but on the main page (not on the admin
   console), I do see these three:
 *     ```
       Undefined index: og_img_max on line 562 in file /wp-content/plugins/nextgen-facebook/nextgen-facebook.php
       Undefined index: og_vid_max on line 565 in file /wp-content/plugins/nextgen-facebook/nextgen-facebook.php
       Undefined index: link_publisher_url on line 1110 in file /wp-content/plugins/nextgen-facebook/nextgen-facebook.php
       ```
   
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362968)
 * Ok, those first ones are not NGFB, but the `Undefined index` stuff is. 😉
 * It shouldn’t be an issue, but I went and rewrote the whole NGFB::sanitize_options()
   method — it’s more streamlined now, and missing options are added, so those warnings
   shouldn’t pop up.
 * Hopefully we’ve got a winner now. 🙂
 * Try out the dev version and let me know how it goes…
 * [http://downloads.wordpress.org/plugin/nextgen-facebook.zip](http://downloads.wordpress.org/plugin/nextgen-facebook.zip)
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362969)
 * Gave it a shot. Still no dice I’m afraid.
 * I did notice that the settings page was not loading the PHP beyond the Image 
   ID line, so it isn’t an issue of the settings not displaying properly. For sake
   of testing I also tried on different browsers with no change.
 * For me the biggest variable I notice is that that every single other page in 
   the admin panel Blackbox is active and working fine on. I went so far as to test
   out NextGen gallery and some add-ons for that, and those also show Blackbox. 
   It is only the NGFB one that doesn’t.
 * I don’t know if Blackbox loads before the page or after, but I’m guessing the
   two symptoms are related.
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362970)
 * Would you mind doing a view source and pasting the last line(s)? Knowing exactly
   where it stops would help…
 * What’s the WP debug output like?
 * Thanks,
 * js.
 *  Thread Starter [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * (@rlaflamme)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/#post-3362971)
 * From what I can see of the list, only the ones you mentioned that weren’t NGFB
   related are showing. I do get a
    `Warning: Cannot modify header information -
   headers already sent by (output started at /wp-includes/functions.php:2824) in/
   wp-includes/pluggable.php on line 876`
 * when activating the plugin but I’m guessing that isn’t pertaining to much. The
   plugin still starts and I can go to the settings page.
 * The code for the page ends at:
 *     ```
       <tr>
       				<th>Default Image ID</th>
       				<td><input type="text" name="ngfb_options[og_def_img_id]" class="number" value="" /> in the <select name="ngfb_options[og_def_img_id_pre]" style="width:160px;">
       <option value="wp" >Media Library</option>
       ```
   

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

1 [2](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/page/2/?output_format=md)

The topic ‘error when reading the 'ngfb_options' array from the database’ 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/)

 * 26 replies
 * 2 participants
 * Last reply from: [rlaflamme](https://wordpress.org/support/users/rlaflamme/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/error-when-reading-the-ngfb_options-array-from-the-database/page/2/#post-3363049)
 * Status: resolved