• 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:

    [12-Jan-2010 00:08:29] PHP Warning:  include(../../../wp-load.php) [0function.include0]: failed to open stream: No such file or directory in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/uninstall.php on line 8
    [12-Jan-2010 00:08:29] PHP Warning:  include() [0function.include0]: Failed opening '../../../wp-load.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/uninstall.php on line 8
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined index:  wp_cache_key in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 192
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: gz in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 421
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: fr2 in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 441
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: gz in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 445
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: log in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 449
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: fr2 in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 463
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined variable: gz in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 472
    [11-Jan-2010 23:52:25] PHP Notice:  Undefined index:  Content-Type in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 649
    [11-Jan-2010 23:52:33] PHP Notice:  Undefined index:  Content-Type in /home/myhome/public_html/content/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 649

    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) 😉

    Best wishes
    Hal

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thanks Hal, I’ve fixed a lot of these warnings in the past but it’s good to see these ones.

    Looks like your wp-load.php isn’t in the directory that most people have it in. I should trap that in a better way and warn the user.

    Thread Starter halwp

    (@halwp)

    donncha – I was concerned that you would think that I was making a criticism, which was not my intention, so it is fantastic that you have responded with such a positive attitude.
    Thank you – and I will let you know if my installation logs any more.

    Do you know when the next update will be available, so that I can give you further feedback?

    Kind wishes
    Hal

    God, no. It’s great to get good feedback 🙂

    No plans for the next update, up the walls with MU merge and WordPress 3.0!

    Thread Starter halwp

    (@halwp)

    That’s OK. I’ll just look out for it, then. Thank you, and good luck with your work.

    Best wishes
    Hal

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

The topic ‘[Plugin: WP Super Cache] Minor Errors in Log files’ is closed to new replies.