[Plugin: WP Super Cache] Minor Errors in Log files
-
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 649The 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
The topic ‘[Plugin: WP Super Cache] Minor Errors in Log files’ is closed to new replies.