forked from vincentorback/clean-wordpress-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple-history.php
40 lines (35 loc) · 951 Bytes
/
simple-history.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Don't log failed logins
*
* @link https://github.com/bonny/WordPress-Simple-History/
*/
add_filter(
'simple_history/simple_logger/log_message_key',
function ( $doLog, $loggerSlug, $messageKey, $SimpleLoggerLogLevelsLevel, $context ) {
// Don't log login attempts to non existing users
if ( 'SimpleUserLogger' == $loggerSlug && 'user_unknown_login_failed' == $messageKey ) {
$doLog = false;
}
// Don't log failed logins to existing users
if ( 'SimpleUserLogger' == $loggerSlug && 'user_login_failed' == $messageKey ) {
$doLog = false;
}
return $doLog;
},
10,
5
);
/**
* Remove the "Clear log"-button, so a user with admin access can not clear the log
* and wipe their mischievous behaviors :)
*
* @link https://github.com/bonny/WordPress-Simple-History/
*/
add_filter(
'simple_history/user_can_clear_log',
function ( $user_can_clear_log ) {
$user_can_clear_log = false;
return $user_can_clear_log;
}
);