[wp-trac] [WordPress Trac] #24224: Hello Dolly causing errors, probably hello.php called directly by URL
WordPress Trac
noreply at wordpress.org
Mon Apr 29 14:36:50 UTC 2013
#24224: Hello Dolly causing errors, probably hello.php called directly by URL
--------------------------+-----------------------------
Reporter: kitchin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 3.5.1
Severity: minor | Keywords:
--------------------------+-----------------------------
My error log is filling up with these:
{{{
[01-Jan-2013 12:00:00] PHP Fatal error: Call to undefined function
add_action() in /.../wp-content/plugins/hello.php on line 60
}}}
I assume someone is calling the URL directly, and I can reproduce it that
way:
http://example.tld/wp-content/plugins/hello.php
To end the annoyance, the plugin should start with:
if (! defined('ABSPATH')) exit;
Or whatever is the standard way to check Wordpress is calling. And the
standard way to exit without an error.
Anyone interested in such activity should be checking server logs, not
getting errors logged by PHP.
Also it would be setting a good example for plugin authors to keep in mind
wp-content/plugins can be called directly via a URL.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24224>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list