Arrow

Series of php errors | Peter's Custom Anti-Spam for WordPress | Forum

Back to the custom anti-spam plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Series of php errors
December 16, 2008
6:19 pm
Todd
Guest

Peter, I appreciate your help.

I am getting the following series of errors repeatedly in my log, can anyone help?:

[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Notice: Trying to get property of non-object in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 59
[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Notice: Trying to get property of non-object in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 152
[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Notice: Trying to get property of non-object in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 158
[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Notice: Trying to get property of non-object in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 161
[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Notice: Use of undefined constant get_option - assumed 'get_option' in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 409
[Tue Dec 16 09:37:00 2008] [error] [client 64.88.164.198] PHP Fatal error: Call to undefined function add_action() in .../wp-content/plugins/peters-custom-anti-spam-image/custom_anti_spam.php on line 422

December 16, 2008
8:52 pm
Peter
Admin
Forum Posts: 841
Offline

Looks robots (or humans) directly accessing the plugin file. The notices appear because you probably have a sensitive error logger; however, no matter what, you’d get the last error message because the plugin file is being directly loaded. Add this to the top of the plugin file:

if (file_exists('custom_anti_spam.php') && empty($_GET)) {
    die ('Not intended for direct access.');
}