`wordfence_security_event` hook gets the wrong IP address
-
I’m using the
wordfence_security_event
hook in a custom must-use plugin to log Wordfence events and block the offending IP address via fail2ban.
Unfortunately, on ‘increasedAttackRate’ events the IP address passed to the hook is that of the server and not attacking IP because it’s triggered within a cron job and code inwordfence/lib/wordfenceClass.php
around line 8537 is usingwfUtils::getIP()
to get the IP address.I’m a bit disappointed to see the poor code quality of Wordfence plugin. For one, using
@
to silence possible errors is a bad practice and is strongly discouraged, yet Wordfence code is littered with those even in places where that doesn’t make any sense. And that’s only one example of code smell.
- The topic ‘`wordfence_security_event` hook gets the wrong IP address’ is closed to new replies.