JezK
Edit File: limit-login-protector.php
<?php if ( ! defined( 'WPINC' ) || ! defined( 'ABSPATH' ) ) { die; } class RBLimitLoginProtector { public function __construct() { if ( defined( 'RB_BOX_NAME' ) && ( defined( 'RB_LIMIT_LOGIN_PROTECTOR_BASE_URL' ) && RB_LIMIT_LOGIN_PROTECTOR_BASE_URL ) ) { add_action( 'wp_login_failed', array( $this, 'register_failed_login_attempt' ) ); } } public function register_failed_login_attempt() { $auth_key = hash_hmac( 'sha256', AUTH_KEY, AUTH_SALT, false ); $data = array( 'box_name' => RB_BOX_NAME, 'ip' => $_SERVER['REMOTE_ADDR'], ); wp_remote_post( RB_LIMIT_LOGIN_PROTECTOR_BASE_URL . '/register_failed_login_attempt', array( 'method' => 'POST', 'timeout' => 5, 'redirection' => 0, 'httpversion' => '1.1', 'user-agent' => RB_BOX_NAME . ' ' . $_SERVER['REMOTE_ADDR'], 'blocking' => false, 'headers' => array( 'Content-Type' => 'application/json', 'X-LLP-Auth-Key' => $auth_key, ), 'body' => wp_json_encode( $data ), ) ); } } new RBLimitLoginProtector();