Record Password from Login
-
Hi Pär I hope you well. In my site I’m having troubles with force brute attack, last time someone used a known username but Simple History didn’t record the password. I found this snipet in your site to record passwords. But it doesn’t work with 2.33.2 plugin versión and WP 5.3.2.
add_action( ‘login_form_postpass’, function() {
$postPass = isset($_POST[‘post_password’]) ? $_POST[‘post_password’] : null;if (!$postPass) {
return;
}$urlPath = parse_url(wp_get_referer(), PHP_URL_PATH);
$pageByPath = get_page_by_path($urlPath);if (!$pageByPath) {
return;
}$correctPasswordEntered = ($pageByPath->post_password === $postPass);
if ($correctPasswordEntered) {
apply_filters(
‘simple_history_log’,
‘A user correctly entered the password for page “{page_name}”‘,
array(‘page_name’ => $pageByPath->post_title)
);
} else {
apply_filters(
‘simple_history_log’,
‘A user entered the wrong password for page “{page_name}”‘,
array(‘page_name’ => $pageByPath->post_title)
);
}
});The page I need help with: [log in to see the link]
The topic ‘Record Password from Login’ is closed to new replies.