Doesn’t seem to be a problem with the plugin, that error seems to be coming from when it is being loaded outside of wordpress. You probably have to google for “wordpress undefined function add_action”
Hi Lester, you’re right but from where coming the ERRORs. I search in google but i found no hints. Only one … if( function_exists( ….
PLZ, try this google search:
wp-postviews.php on line 33
I find many error logs…
It is possible the plugin_basename() is incorrect?
Unlikely. To be honest I have not come across this error on my end on standard WP installs. So there might be a problem with your WP itself.
Hi Lester, now I know where come this ERROR.
If you open wp-postviews.php directly in the brower … then you get
mod_fcgid: stderr: PHP Fatal error: undefined function add_action () ... on line 33
… I think some bots crawl every day your wp-postviews.php 😉
We had experienced that error
It was produced when accessing directly to wp-postviews.php, in our case it was a bot (we think a fake GoogleBot).
At webserver level, with Apache we can avoid direct accessing, placing an .htaccess file inside wp-content directory.
Order deny,allow
Deny from all
<Files ~ “.(xml|css|jpe?g|png|gif|js)$”>
Allow from all
</Files>
This configuration could also be done in the main conf file for the domain or the whole server.
If server has memory and processing power enough, it could be good to use firewall rules (iptables) to avoid this request to reach Apache
What do you think about this approach?