lesterchan / wp-polls

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
https://wordpress.org/plugins/wp-polls/
91 stars 78 forks source link

wp-polls.php direct invocation #129

Open pkirk opened 5 years ago

pkirk commented 5 years ago

Dear Lester, I'm using your plugin since, I think, 2006. And from time to time I see that Google bot try to access it directly, causing an error 500 (add_action() not defined). Do you remember if any time ago it was used to be called directly? What do you think about adding a little code to avoid direct call?

Something like this below or a redirect to the home?

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
        die;
}

Thanks for your work,

Paolo

lesterchan commented 5 years ago

Nope, there should not be anytime they are called directly. In fact Google Bot should not index wp-content/plugins folder.