This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require kirby()->roots()->index() . DS . 'vendor' . DS . 'autoload.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Limit Login Attempts Reloaded (https://en-gb.wordpress.org/plugins/limit-login-attempts-reloaded/) | |
# doesn’t currently offer a way to quickly add logged IP addresses to the blacklist. The following | |
# one-liner uses WP-CLI and JQ (https://stedolan.github.io/jq/) to quickly merge the entire lockouts | |
# log with the blacklist, which is useful when the site is experiencing distributed brute force | |
# attempts on wp-login.php | |
cat <(wp option get limit_login_blacklist --format=json | jq -r '.[]') <(wp option get limit_login_logged --format=json | jq -r 'keys_unsorted | .[]') | jq -s -R 'split("\n") | .[0:-1] | unique' | wp option update limit_login_blacklist --format=json |