• You are doing a great job with this plugin, and I’ d like to congratulate you on your achievement.

    In case no-one else has reported it to you, there are some errors that are generated in the logs related to your plugin. I don’t think it affects the functionality at all but, I am sure you would agree, it would be nice if it didn’t generate them at all.

    Please see them below:

    WordPress: The ***deprecated function*** "__ngettext" was called from wp-content/plugins/nextgen-gallery/admin/admin.php on line 31. Use "_n" instead.
    WordPress: The ***deprecated function*** "__ngettext" was called from wp-content/plugins/nextgen-gallery/admin/admin.php on line 35. Use "_n" instead.
    PHP Notice:  Undefined index:  galAjaxNav in /path/to/public_html/content/wp-content/plugins/nextgen-gallery/nggallery.php on line 316

    I hope this is useful to you.
    Best of luck with your continuing success
    Hal

    http://ww.wp.xz.cn/extend/plugins/nextgen-gallery/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter halwp

    (@halwp)

    That’s great, alex, well done!
    Do you think you can resolve the warning too (PHP Notice: Undefined index)? I know how to resolve these warnings but, funnily enough, I can’t actually find galAjaxNav in nggallery.php on line 316, which is strange.

    I will check up this tomorrow

    Thread Starter halwp

    (@halwp)

    Thanks for that, alex!

    The solution to the warning notice is simply to test that a variable exists before using it. For example,

    if ($options['allfeeds'] || $options['commentfeeds'])

    would be changed to:

    if (array_key_exists('allfeeds', $options) && $options['allfeeds'] || array_key_exists('commentfeeds', $options) && $options['commentfeeds'])

    While some may argue that isset is better for testing arrays, because it performs slightly better, you need to bear in mind that if the array key does indeed exist but it has been set to null, isset will return false, whereas array_key_exists returns the result that you would expect.

    With scalars, you would simply use isset.

    Hope this is all useful to you (although I imagine that you know all this already) 😉

    Cheers
    Hal

    Thread Starter halwp

    (@halwp)

    Alex

    I just wanted to caution you about substituting the function “__ngettext” with “_n” – are you aware that this may make NextGen incompatible with some earlier versions of WordPress. I am afraid I cannot tell you which versions it will affect.

    In contrast, the other changes that I suggested, which fix the PHP “Undefined index” notices, are good practice for all versions, and so I would still encourage you implement them.

    Thank you again
    Hal

    I know and it’s no problem (for me)…. after each new WP version I will increase the needed version. I cannot (and will not) maintain backward compat.

    I will check how I can circle around the notice bug, as I want to keep my code readable… tooo many “array_key_exists” will destroy the code, although it’s the correct way 🙂

    Hi, thanks for the great plug-in!

    From the posts here it appears that these problems have been fixed; however I still get the following error for every page in the browser:

    Notice: Undefined index: galAjaxNav in /home/nealio/web/wordpress/drumlab/wp-content/plugins/nextgen-gallery/nggallery.php on line 337

    I’m using:
    WordPress 2.9.2
    NextGEN Gallery 1.5.0

    If it helps, here are my server settings (my development machine):

    * Operating System : Linux (32 Bit)
    * Server : Apache/2.2.12 (Ubuntu)
    * Memory usage : 13.85 MByte
    * MYSQL Version : 5.1.37-1ubuntu5.1
    * SQL Mode : Not set
    * PHP Version : 5.2.10-2ubuntu6.4
    * PHP Safe Mode : Off
    * PHP Allow URL fopen : On
    * PHP Memory Limit : 32M
    * PHP Max Upload Size : 2M
    * PHP Max Post Size : 8M
    * PCRE Backtracking Limit : 100000
    * PHP Max Script Execute Time : 30s
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

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

The topic ‘[Plugin: NextGEN Gallery] Minor errors in logs’ is closed to new replies.