• Dear Mr. Takayuki Miyoshi san,

    I found this entry in our php-error.log:

    /data/log/php-error.log: [17-Jan-2026 03:13:56 Europe/Helsinki] PHP Fatal error: Uncaught Error: Call to undefined function plugin_basename() in /data/wordpress/htdocs/wp-content/plugins/contact-form-7/wp-contact-form-7.php:23
    /data/log/php-error.log: thrown in /data/wordpress/htdocs/wp-content/plugins/contact-form-7/wp-contact-form-7.php on line 23

    Do you have an idea, what causes this? We are using WordPress 6.9 with php 8.4.

    Thank you for your Help.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    How often do you get this error in the log?

    Hi rb285,

    This does not indicate a critical problem with Contact Form 7 itself.

    The error is caused by the plugin file being accessed directly, in which case WordPress core is not loaded and WordPress functions such as plugin_basename() are unavailable.

    You can confirm this behavior by directly accessing the following URL in your browser:

    https://<your-site-domain>/wp-content/plugins/contact-form-7/wp-contact-form-7.php

    Some plugins explicitly prevent this type of direct access by adding a guard like the following at the top of the file:

    if ( ! defined( 'WPINC' ) ) {
        die;
    }
    

    This avoids fatal errors when the file is accessed outside of WordPress, but the absence of this check does not mean the plugin is malfunctioning.

    Since the cause is relatively clear and reproducible, I’ll leave this comment here in case it helps clarify the situation.

    Thread Starter rb285

    (@rb285)

    Dear all,

    This was the first time, I got this error. And I think @ytsuyuzaki is right. We have a lot of bots and spamers, trying to hack our website. It is not the first time, we think a plugin causes an error and it was caused by a bot actually.

    Thank you all for your help, I will mark the case as solved.

    I’m glad to hear that this helped clarify the situation.

    Wishing you all the best with your site and its continued smooth operation.

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

You must be logged in to reply to this topic.