• Resolved rlaflamme

    (@rlaflamme)


    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://ww.wp.xz.cn/extend/plugins/nextgen-facebook/

Viewing 11 replies - 16 through 26 (of 26 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    Ok, now we’re getting somewhere… I think. πŸ™‚

    Looks like your website doesn’t like this:

    if ( method_exists( 'nggdb', 'find_image' ) ) :

    Odd, but no problem. I’ll just change it into a ‘class_exists’ test instead…

    Give the new dev code a try and let me know. πŸ˜‰

    Thanks,

    js.

    Thread Starter rlaflamme

    (@rlaflamme)

    No such luck on that, but it feels like a step in the right direction! No changes on the debug list either.

    Plugin Author JS Morisset

    (@jsmoriss)

    Ok, I think we might have a winner here… Aside from a multitude of other small changes (mostly variable checks etc), I also moved the options load from the __construct() method to a WP init() method. This should load the options a little later, which might give more time for other WP related stuff to load (I hope). πŸ˜‰

    I QA the plugin on 5 different websites, so seeing these issues in the wild is a little frustrating. πŸ™‚ I might be away until tomorrow morning. Let me know how the current dev version fares.

    http://downloads.wp.xz.cn/plugin/nextgen-facebook.zip

    Thanks!

    js.

    Thread Starter rlaflamme

    (@rlaflamme)

    As often things can get worse right before they get better. That latest iteration makes the admin section crash. I had to manually remove it. So the code’s definitely different πŸ˜‰

    Plugin Author JS Morisset

    (@jsmoriss)

    I’ve tweaked the code a bit more – would you mind giving v3.1.2b2 a try?

    http://downloads.wp.xz.cn/plugin/nextgen-facebook.3.1.2b2.zip

    Let me know if you see anything in your webserver’s error log (as well as WP’s debug.log)…

    BTW, if it still doesn’t work, you could try commenting line #177 in nextgen-facebook.php:

    $this->load_is_active();

    From what I can see, your website might have a problem with some class/method checks (it’s a theory)…

    Thanks,

    js.

    Thread Starter rlaflamme

    (@rlaflamme)

    Alright, so progress:

    When trying this version after installation I get the debug message:
    Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /wp-includes/functions.php on line 2944

    This crashes the admin console again. However, when commenting out 177, I can get back in to the admin section. The debug list still shows the error, but I can navigate. (Webserver error log shows none, which is how I like it!)

    More useful, is that the NGFB menu shows the entire contents, and if I turn Blackbox on, it works on the NGFB options page like it’s supposed to.

    I hope that helps narrow down what could be causing it.

    Plugin Author JS Morisset

    (@jsmoriss)

    Yeah, I’ve been trying to streamline the activate/deactivate methods. That error is already fixed in 3.1.2b3. πŸ˜‰

    So, it’s as I suspected, there’s some function/method/class check, that for some reason, your PHP / WP installation doesn’t like… I’ll need your help on this one. πŸ˜‰

    Here’s the method in question in nextgen-facebook.php:

    function load_is_active() {
    
                            $this->is_active['ngg'] = method_exists( 'nggdb', 'find_image' ) ? 1 : 0;
                            $this->is_active['cdnlink'] = class_exists( 'CDNLinksRewriterWordpress' ) ? 1 : 0;
                            $this->is_active['wikibox'] = function_exists( 'wikibox_summary' ) ? 1 : 0;
                            $this->is_active['expages'] = function_exists( 'ep_get_excluded_ids' ) ? 1 : 0;
                            $this->is_active['postthumb'] = function_exists( 'has_post_thumbnail' ) ? 1 : 0;
    
                            $this->print_debug( '$this->is_active', $this->is_active );
                    }

    I would like you to comment each line, one by one, and see which one breaks the settings page.

    Once we know, I can see if there’s another way to code the check.

    Here’s the latest version:

    http://downloads.wp.xz.cn/plugin/nextgen-facebook.3.1.2b3.zip

    Thanks,

    js.

    Plugin Author JS Morisset

    (@jsmoriss)

    Also, in case it’s the method_exists() check, you could try changing this line:

    $this->is_active['ngg'] = method_exists( 'nggdb', 'find_image' ) ? 1 : 0;

    To this:

    $this->is_active['ngg'] = class_exists( 'nggdb' ) && method_exists( 'nggdb', 'find_image' ) ? 1 : 0;

    Thanks,

    js.

    Thread Starter rlaflamme

    (@rlaflamme)

    Not a problem.

    I commented out each line to be sure, but it is indeed the ‘ngg’ line call that is crashing it.

    Changing it to the latter code from the “method_exists” start to the “class_exists” start seems to correct that. All settings load and Blackbox reports no issues.

    Plugin Author JS Morisset

    (@jsmoriss)

    Ok, so you’re using the combination I suggested above ( class_exists( ‘nggdb’ ) && method_exists( ‘nggdb’, ‘find_image’ ) )?

    On the NGFB settings page, is “NextGEN Gallery” one of the choice for the Default Image ID?

    If you’re still running in NGFB_DEBUG mode, you should see something like the following (if you have NextGEN Gallery activated) at the top of your page source:

    <!-- NextGEN Facebook OG debug from load_is_active() $this->is_active :
    	cdnlink = 0
    	expages = 0
    	ngg = 1
    	postthumb = 1
    	wikibox = 0
     -->

    Thanks,

    js.

    Thread Starter rlaflamme

    (@rlaflamme)

    Correct, I was using the combination you suggested.

    I added the Gallery plugin for testing purposes, but I didn’t have in installed initially.

    With the plugin installed, yes, I see Gallery for Default ID.

    And in the debug mode with the plugin activated, it shows as you show it:

    <!-- NextGEN Facebook OG debug from load_is_active() $this->is_active :
    	cdnlink = 0
    	expages = 0
    	ngg = 1
    	postthumb = 1
    	wikibox = 0
     -->

    With the plugin not active, it shows ngg= 0 and the option in Default ID isn’t there (naturally).

Viewing 11 replies - 16 through 26 (of 26 total)

The topic ‘error when reading the 'ngfb_options' array from the database’ is closed to new replies.