• Resolved vollcom

    (@vollcom)


    Hello, I hope someone can help me. The plugin works fine, but I found every day in my error log this warning:

    [Thu May 21, 2015 08:44:15] [warning] [Client 212.197 *** *** ..] mod_fcgid: stderr: PHP Fatal error: undefined function add_action () in / var / www / vhosts Call /....../ httpdocs / wp-content / plugins / wp-PostViews / wp-postviews.php on line 33

    The warning is not often … only 5 to 10 times.

    https://ww.wp.xz.cn/plugins/wp-postviews/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Lester Chan

    (@gamerz)

    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”

    Thread Starter vollcom

    (@vollcom)

    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?

    Plugin Author Lester Chan

    (@gamerz)

    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.

    Thread Starter vollcom

    (@vollcom)

    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?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘undefined function add_action()’ is closed to new replies.