ATX, as proof of concept I did the following, it worked. Fun. Apologies for any typos, I was in a hurry when I changed all the file names from my own to the examples. The concept is there…
1. I made a modified /wordfence/lib/wf503.php file I like, named it something like wf503-special.php, and placed in /wordfence/lib/ folder
2. Made a PHP script called (for example) wf503-change-script.php that looks something like the following and placed in /wordfence/lib/ folder. Set file permissions to the same as other scripts in that folder, which is 644.
(following is pseudo code to avoid violating forum guidelines)
echo copy(“wf503-special.php”,”wf503.php”)
3. Placed the following statement in my top level .htaccess file, this allows the script to run even though /wordfence/lib/.htaccess has a “deny from all”. Could put this statement in the /wordfence/lib/.htaccess but it would get written over by the Wordfence updates. (following is pseudo, I’m not sure what’s allowed on the forum here.)
FilesMatch “wf503-change-script.php”
Allow From All
/FilesMatch
I tested this manually by running the script from my browser. Works. Now I need to create a Cron job that runs the script every so often, depending on my sense of how often Wordfence does their updates. Or perhaps I’ll just run it manually when I see that ubiquitous “Wordfence Update!” message.
Wordfence Scan will probably see all this stuff and sound an alarm. Easily handled.
The script could probably be run from site root, with the modified wf503.php file residing there as well, to avoid adding files to the /wordfence/lib folder. I kept it simple and didn’t do that.
Apologies if my amateurish attempt at this creates any security issues. Use at your own risk.
MTN