Support » Plugin: Wordfence Security - Firewall & Malware Scan » PHP Notice: Undefined index: SCRIPT_FILENAME

  • Resolved Sam


    Hi there,

    Been using Wordfence for ages but recently needed to enable the debug log and noticed every 15 mins when the cron is triggered (15 min limit by host) the following error is entered in the log:

    PHP Notice: Undefined index: SCRIPT_FILENAME in /home/website/public_html/wp-content/plugins/wordfence/lib/wordfenceClass.php on line 1000

    Using the latest version of Wordfence, WordPress and php 7.2. It does it with wp-cron or if wp-cron is disabled and server side cron setup. Any help would be appreciated.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support wfdave


    Hi @sam69,

    Who is your host provider?

    Can you try running this script (if you have access to shell on your server)

    print("sapi_name: " . php_sapi_name());

    Run this on your server with php this_file.php

    It should read sapi_name: cli. If not, you will need to contact your host provider in order to get PHP-cli to run the cron file.



    Didn’t get an alert on this but i just ran the file and it read sapi_name: cli. And since turned logging off but is this error a concern?

    Plugin Support wfdave


    Hi again,

    I checked the source code, and there is no concern.

    When Wordfence is loaded, it will run initProtection() which checks if the user is attempting a Slider Revolution Hack, this hack only works when executed on admin-ajax.php however.

    Since for your case, the error only shows when running from cron, initProtection() still runs, but it doesn’t matter if it throws a warning.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Notice: Undefined index: SCRIPT_FILENAME’ is closed to new replies.