Limit Login Attempts - Version 1.7.0

Version Description

  • Added filter that allows whitelisting IP. Please use with care!!
  • Update to Spanish translation, thanks to Marcelo Pedra
  • Updated Swedish translation
  • Tested against WordPress 3.3.2
Download this release

Release Info

Developer johanee
Plugin Icon wp plugin Limit Login Attempts
Version 1.7.0
Comparing to
See all releases

Code changes from version 1.6.2 to 1.7.0

limit-login-attempts-sv_SE.mo CHANGED
Binary file
limit-login-attempts-sv_SE.po CHANGED
@@ -7,8 +7,8 @@ msgid ""
7
  msgstr ""
8
  "Project-Id-Version: limit-login-attempts 1.2\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/limit-login-attempts\n"
10
- "POT-Creation-Date: 2011-02-17 15:08:09+00:00\n"
11
- "PO-Revision-Date: 2011-02-17 16:15+0100\n"
12
  "Last-Translator: Johan Eenfeldt <johan.eenfeldt@kostdoktorn.se>\n"
13
  "Language-Team: Swedish\n"
14
  "MIME-Version: 1.0\n"
@@ -16,222 +16,230 @@ msgstr ""
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
- #: limit-login-attempts.php:474
20
  msgid "%d hour"
21
  msgid_plural "%d hours"
22
  msgstr[0] "%d timme"
23
  msgstr[1] "%d timmar"
24
 
25
- #: limit-login-attempts.php:480
26
  msgid "%d minute"
27
  msgid_plural "%d minutes"
28
  msgstr[0] "%d minut"
29
  msgstr[1] "%d minuter"
30
 
31
- #: limit-login-attempts.php:485
 
 
 
 
32
  msgid "[%s] Too many failed login attempts"
33
  msgstr "[%s] För många misslyckade inloggningar"
34
 
35
- #: limit-login-attempts.php:487
36
  msgid "%d failed login attempts (%d lockout(s)) from IP: %s"
37
  msgstr "%d misslyckade inloggningar (blockad %d gång(er)) från IP: %s"
38
 
39
- #: limit-login-attempts.php:491
40
  msgid "Last user attempted: %s"
41
  msgstr "Misslyckades senast med användare : %s"
42
 
43
- #: limit-login-attempts.php:494
 
 
 
 
44
  msgid "IP was blocked for %s"
45
  msgstr "IP blockerades i %s"
46
 
47
- #: limit-login-attempts.php:551
48
  msgid "<strong>ERROR</strong>: Too many failed login attempts."
49
  msgstr "<strong>Fel</strong>: F&ouml;r m&aring;nga misslyckade f&ouml;rs&ouml;k."
50
 
51
- #: limit-login-attempts.php:555
52
  msgid "Please try again later."
53
  msgstr "F&ouml;rs&ouml;k igen senare."
54
 
55
- #: limit-login-attempts.php:562
56
  msgid "Please try again in %d hour."
57
  msgid_plural "Please try again in %d hours."
58
  msgstr[0] "F&ouml;rs&ouml;k igen om %d timme."
59
  msgstr[1] "F&ouml;rs&ouml;k igen om %d timmar."
60
 
61
- #: limit-login-attempts.php:564
62
  msgid "Please try again in %d minute."
63
  msgid_plural "Please try again in %d minutes."
64
  msgstr[0] "F&ouml;rs&ouml;k igen om %d minut."
65
  msgstr[1] "F&ouml;rs&ouml;k igen om %d minuter."
66
 
67
- #: limit-login-attempts.php:593
68
  msgid "<strong>%d</strong> attempt remaining."
69
  msgid_plural "<strong>%d</strong> attempts remaining."
70
  msgstr[0] "<strong>%d</strong> f&ouml;rs&ouml;k &aring;terst&aring;r."
71
  msgstr[1] "<strong>%d</strong> f&ouml;rs&ouml;k &aring;terst&aring;r."
72
 
73
- #: limit-login-attempts.php:658
74
  msgid "<strong>ERROR</strong>: Incorrect username or password."
75
  msgstr "<strong>Fel</strong>: Felaktigt anv&auml;ndarnamn eller l&ouml;senord."
76
 
77
- #: limit-login-attempts.php:826
78
  msgctxt "Internet address"
79
  msgid "IP"
80
  msgstr "IP"
81
 
82
- #: limit-login-attempts.php:826
83
  msgid "Tried to log in as"
84
  msgstr "F&ouml;rs&ouml;kte logga in som"
85
 
86
- #: limit-login-attempts.php:831
87
  msgid "%d lockout"
88
  msgid_plural "%d lockouts"
89
  msgstr[0] "%d blockering"
90
  msgstr[1] "%d blockeringar"
91
 
92
- #: limit-login-attempts.php:860
93
  msgid "Cleared IP log"
94
  msgstr "Rensade IP loggen"
95
 
96
- #: limit-login-attempts.php:868
97
  msgid "Reset lockout count"
98
  msgstr "Nollst&auml;llde r&auml;knaren f&ouml;r blockeringar"
99
 
100
- #: limit-login-attempts.php:876
101
  msgid "Cleared current lockouts"
102
  msgstr "Tog bort aktuella blockeringar"
103
 
104
- #: limit-login-attempts.php:905
105
  msgid "Options changed"
106
  msgstr "Inst&auml;llningar &auml;ndrade"
107
 
108
- #: limit-login-attempts.php:923
109
  msgid "It appears the site is reached directly (from your IP: %s)"
110
  msgstr "Sajten tycks vara direktansluten (från din IP: %s)"
111
 
112
- #: limit-login-attempts.php:925
113
  msgid "It appears the site is reached through a proxy server (proxy IP: %s, your IP: %s)"
114
  msgstr "Sajten tycks ansluta genom en proxy server (proxy IP: %s, din IP: %s)"
115
 
116
- #: limit-login-attempts.php:933
117
  msgid "<strong>Current setting appears to be invalid</strong>. Please make sure it is correct. Further information can be found <a href=\"%s\" title=\"FAQ\">here</a>"
118
  msgstr "<strong>Nuvarande inställningar kan vara fel</strong>. Säkerställ att de är korrekta. Mer information kan hittas <a href=\"%s\" title=\"FAQ\">här</a>"
119
 
120
- #: limit-login-attempts.php:941
121
  msgid "Limit Login Attempts Settings"
122
  msgstr "Limit Login Attempts Inst&auml;llningar"
123
 
124
- #: limit-login-attempts.php:942
125
  msgid "Statistics"
126
  msgstr "Statistik"
127
 
128
- #: limit-login-attempts.php:947
129
  msgid "Total lockouts"
130
  msgstr "Antal blockeringar"
131
 
132
- #: limit-login-attempts.php:950
133
  msgid "Reset Counter"
134
  msgstr "Nollst&auml;ll r&auml;knare"
135
 
136
- #: limit-login-attempts.php:951
137
  msgid "%d lockout since last reset"
138
  msgid_plural "%d lockouts since last reset"
139
  msgstr[0] "%d blockering sedan r&auml;knaren nollst&auml;lldes"
140
  msgstr[1] "%d blockeringar sedan r&auml;knaren nollst&auml;lldes"
141
 
142
- #: limit-login-attempts.php:952
143
  msgid "No lockouts yet"
144
  msgstr "Inga blockeringar har skett &auml;nnu"
145
 
146
- #: limit-login-attempts.php:957
147
  msgid "Active lockouts"
148
  msgstr "Aktiva blockeringar"
149
 
150
- #: limit-login-attempts.php:959
151
  msgid "Restore Lockouts"
152
  msgstr "Ta bort blockeringar"
153
 
154
- #: limit-login-attempts.php:960
155
  msgid "%d IP is currently blocked from trying to log in"
156
  msgstr "%d IP &auml;r f&ouml;r n&auml;rvarande blockerade fr&aring;n att logga in"
157
 
158
- #: limit-login-attempts.php:966
159
  msgid "Options"
160
  msgstr "Inst&auml;llningar"
161
 
162
- #: limit-login-attempts.php:971
163
  msgid "Lockout"
164
  msgstr "Blockering"
165
 
166
- #: limit-login-attempts.php:973
167
  msgid "allowed retries"
168
  msgstr "till&aring;tna misslyckanden"
169
 
170
- #: limit-login-attempts.php:974
171
  msgid "minutes lockout"
172
  msgstr "minuters blockering"
173
 
174
- #: limit-login-attempts.php:975
175
  msgid "lockouts increase lockout time to"
176
  msgstr "blockeringar &ouml;kar tiden till"
177
 
178
- #: limit-login-attempts.php:975
179
  msgid "hours"
180
  msgstr "timmar"
181
 
182
- #: limit-login-attempts.php:976
183
  msgid "hours until retries are reset"
184
  msgstr "timmar tills misslyckanden nollst&auml;lls"
185
 
186
- #: limit-login-attempts.php:980
187
  msgid "Site connection"
188
  msgstr "Sajten ansluter"
189
 
190
- #: limit-login-attempts.php:986
191
  msgid "Direct connection"
192
  msgstr "Direktansluten"
193
 
194
- #: limit-login-attempts.php:991
195
  msgid "From behind a reversy proxy"
196
  msgstr "Bakom en reverse proxy"
197
 
198
- #: limit-login-attempts.php:997
199
  msgid "Handle cookie login"
200
  msgstr "Hantera inloggning med kakor"
201
 
202
- #: limit-login-attempts.php:999
203
  msgid "Yes"
204
  msgstr "Ja"
205
 
206
- #: limit-login-attempts.php:999
207
  msgid "No"
208
  msgstr "Nej"
209
 
210
- #: limit-login-attempts.php:1003
211
  msgid "Notify on lockout"
212
  msgstr "Notifiera om blockering"
213
 
214
- #: limit-login-attempts.php:1005
215
  msgid "Log IP"
216
  msgstr "Logga IP"
217
 
218
- #: limit-login-attempts.php:1006
219
  msgid "Email to admin after"
220
  msgstr "E-post till administrat&ouml;r efter"
221
 
222
- #: limit-login-attempts.php:1006
223
  msgid "lockouts"
224
  msgstr "blockeringar"
225
 
226
- #: limit-login-attempts.php:1011
227
  msgid "Change Options"
228
  msgstr "&Auml;ndra Inst&auml;llningar"
229
 
230
- #: limit-login-attempts.php:1019
231
  msgid "Lockout log"
232
  msgstr "Log &ouml;ver blockeringar"
233
 
234
- #: limit-login-attempts.php:1024
235
  msgid "Clear Log"
236
  msgstr "Rensa Log"
237
 
7
  msgstr ""
8
  "Project-Id-Version: limit-login-attempts 1.2\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/limit-login-attempts\n"
10
+ "POT-Creation-Date: 2012-05-20 10:43:32+00:00\n"
11
+ "PO-Revision-Date: 2012-05-20 12:51+0100\n"
12
  "Last-Translator: Johan Eenfeldt <johan.eenfeldt@kostdoktorn.se>\n"
13
  "Language-Team: Swedish\n"
14
  "MIME-Version: 1.0\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
+ #: limit-login-attempts.php:522
20
  msgid "%d hour"
21
  msgid_plural "%d hours"
22
  msgstr[0] "%d timme"
23
  msgstr[1] "%d timmar"
24
 
25
+ #: limit-login-attempts.php:528
26
  msgid "%d minute"
27
  msgid_plural "%d minutes"
28
  msgstr[0] "%d minut"
29
  msgstr[1] "%d minuter"
30
 
31
+ #: limit-login-attempts.php:534
32
+ msgid "[%s] Failed login attempts from whitelisted IP"
33
+ msgstr "[%s] För många misslyckade inloggningar från IP i vitlista"
34
+
35
+ #: limit-login-attempts.php:538
36
  msgid "[%s] Too many failed login attempts"
37
  msgstr "[%s] För många misslyckade inloggningar"
38
 
39
+ #: limit-login-attempts.php:543
40
  msgid "%d failed login attempts (%d lockout(s)) from IP: %s"
41
  msgstr "%d misslyckade inloggningar (blockad %d gång(er)) från IP: %s"
42
 
43
+ #: limit-login-attempts.php:547
44
  msgid "Last user attempted: %s"
45
  msgstr "Misslyckades senast med användare : %s"
46
 
47
+ #: limit-login-attempts.php:551
48
+ msgid "IP was NOT blocked because of external whitelist."
49
+ msgstr "IP blockerades INTE på grund av extern vitlista."
50
+
51
+ #: limit-login-attempts.php:553
52
  msgid "IP was blocked for %s"
53
  msgstr "IP blockerades i %s"
54
 
55
+ #: limit-login-attempts.php:615
56
  msgid "<strong>ERROR</strong>: Too many failed login attempts."
57
  msgstr "<strong>Fel</strong>: F&ouml;r m&aring;nga misslyckade f&ouml;rs&ouml;k."
58
 
59
+ #: limit-login-attempts.php:619
60
  msgid "Please try again later."
61
  msgstr "F&ouml;rs&ouml;k igen senare."
62
 
63
+ #: limit-login-attempts.php:626
64
  msgid "Please try again in %d hour."
65
  msgid_plural "Please try again in %d hours."
66
  msgstr[0] "F&ouml;rs&ouml;k igen om %d timme."
67
  msgstr[1] "F&ouml;rs&ouml;k igen om %d timmar."
68
 
69
+ #: limit-login-attempts.php:628
70
  msgid "Please try again in %d minute."
71
  msgid_plural "Please try again in %d minutes."
72
  msgstr[0] "F&ouml;rs&ouml;k igen om %d minut."
73
  msgstr[1] "F&ouml;rs&ouml;k igen om %d minuter."
74
 
75
+ #: limit-login-attempts.php:657
76
  msgid "<strong>%d</strong> attempt remaining."
77
  msgid_plural "<strong>%d</strong> attempts remaining."
78
  msgstr[0] "<strong>%d</strong> f&ouml;rs&ouml;k &aring;terst&aring;r."
79
  msgstr[1] "<strong>%d</strong> f&ouml;rs&ouml;k &aring;terst&aring;r."
80
 
81
+ #: limit-login-attempts.php:728
82
  msgid "<strong>ERROR</strong>: Incorrect username or password."
83
  msgstr "<strong>Fel</strong>: Felaktigt anv&auml;ndarnamn eller l&ouml;senord."
84
 
85
+ #: limit-login-attempts.php:896
86
  msgctxt "Internet address"
87
  msgid "IP"
88
  msgstr "IP"
89
 
90
+ #: limit-login-attempts.php:896
91
  msgid "Tried to log in as"
92
  msgstr "F&ouml;rs&ouml;kte logga in som"
93
 
94
+ #: limit-login-attempts.php:901
95
  msgid "%d lockout"
96
  msgid_plural "%d lockouts"
97
  msgstr[0] "%d blockering"
98
  msgstr[1] "%d blockeringar"
99
 
100
+ #: limit-login-attempts.php:930
101
  msgid "Cleared IP log"
102
  msgstr "Rensade IP loggen"
103
 
104
+ #: limit-login-attempts.php:938
105
  msgid "Reset lockout count"
106
  msgstr "Nollst&auml;llde r&auml;knaren f&ouml;r blockeringar"
107
 
108
+ #: limit-login-attempts.php:946
109
  msgid "Cleared current lockouts"
110
  msgstr "Tog bort aktuella blockeringar"
111
 
112
+ #: limit-login-attempts.php:975
113
  msgid "Options changed"
114
  msgstr "Inst&auml;llningar &auml;ndrade"
115
 
116
+ #: limit-login-attempts.php:993
117
  msgid "It appears the site is reached directly (from your IP: %s)"
118
  msgstr "Sajten tycks vara direktansluten (från din IP: %s)"
119
 
120
+ #: limit-login-attempts.php:995
121
  msgid "It appears the site is reached through a proxy server (proxy IP: %s, your IP: %s)"
122
  msgstr "Sajten tycks ansluta genom en proxy server (proxy IP: %s, din IP: %s)"
123
 
124
+ #: limit-login-attempts.php:1003
125
  msgid "<strong>Current setting appears to be invalid</strong>. Please make sure it is correct. Further information can be found <a href=\"%s\" title=\"FAQ\">here</a>"
126
  msgstr "<strong>Nuvarande inställningar kan vara fel</strong>. Säkerställ att de är korrekta. Mer information kan hittas <a href=\"%s\" title=\"FAQ\">här</a>"
127
 
128
+ #: limit-login-attempts.php:1011
129
  msgid "Limit Login Attempts Settings"
130
  msgstr "Limit Login Attempts Inst&auml;llningar"
131
 
132
+ #: limit-login-attempts.php:1012
133
  msgid "Statistics"
134
  msgstr "Statistik"
135
 
136
+ #: limit-login-attempts.php:1017
137
  msgid "Total lockouts"
138
  msgstr "Antal blockeringar"
139
 
140
+ #: limit-login-attempts.php:1020
141
  msgid "Reset Counter"
142
  msgstr "Nollst&auml;ll r&auml;knare"
143
 
144
+ #: limit-login-attempts.php:1021
145
  msgid "%d lockout since last reset"
146
  msgid_plural "%d lockouts since last reset"
147
  msgstr[0] "%d blockering sedan r&auml;knaren nollst&auml;lldes"
148
  msgstr[1] "%d blockeringar sedan r&auml;knaren nollst&auml;lldes"
149
 
150
+ #: limit-login-attempts.php:1022
151
  msgid "No lockouts yet"
152
  msgstr "Inga blockeringar har skett &auml;nnu"
153
 
154
+ #: limit-login-attempts.php:1027
155
  msgid "Active lockouts"
156
  msgstr "Aktiva blockeringar"
157
 
158
+ #: limit-login-attempts.php:1029
159
  msgid "Restore Lockouts"
160
  msgstr "Ta bort blockeringar"
161
 
162
+ #: limit-login-attempts.php:1030
163
  msgid "%d IP is currently blocked from trying to log in"
164
  msgstr "%d IP &auml;r f&ouml;r n&auml;rvarande blockerade fr&aring;n att logga in"
165
 
166
+ #: limit-login-attempts.php:1036
167
  msgid "Options"
168
  msgstr "Inst&auml;llningar"
169
 
170
+ #: limit-login-attempts.php:1041
171
  msgid "Lockout"
172
  msgstr "Blockering"
173
 
174
+ #: limit-login-attempts.php:1043
175
  msgid "allowed retries"
176
  msgstr "till&aring;tna misslyckanden"
177
 
178
+ #: limit-login-attempts.php:1044
179
  msgid "minutes lockout"
180
  msgstr "minuters blockering"
181
 
182
+ #: limit-login-attempts.php:1045
183
  msgid "lockouts increase lockout time to"
184
  msgstr "blockeringar &ouml;kar tiden till"
185
 
186
+ #: limit-login-attempts.php:1045
187
  msgid "hours"
188
  msgstr "timmar"
189
 
190
+ #: limit-login-attempts.php:1046
191
  msgid "hours until retries are reset"
192
  msgstr "timmar tills misslyckanden nollst&auml;lls"
193
 
194
+ #: limit-login-attempts.php:1050
195
  msgid "Site connection"
196
  msgstr "Sajten ansluter"
197
 
198
+ #: limit-login-attempts.php:1056
199
  msgid "Direct connection"
200
  msgstr "Direktansluten"
201
 
202
+ #: limit-login-attempts.php:1061
203
  msgid "From behind a reversy proxy"
204
  msgstr "Bakom en reverse proxy"
205
 
206
+ #: limit-login-attempts.php:1067
207
  msgid "Handle cookie login"
208
  msgstr "Hantera inloggning med kakor"
209
 
210
+ #: limit-login-attempts.php:1069
211
  msgid "Yes"
212
  msgstr "Ja"
213
 
214
+ #: limit-login-attempts.php:1069
215
  msgid "No"
216
  msgstr "Nej"
217
 
218
+ #: limit-login-attempts.php:1073
219
  msgid "Notify on lockout"
220
  msgstr "Notifiera om blockering"
221
 
222
+ #: limit-login-attempts.php:1075
223
  msgid "Log IP"
224
  msgstr "Logga IP"
225
 
226
+ #: limit-login-attempts.php:1076
227
  msgid "Email to admin after"
228
  msgstr "E-post till administrat&ouml;r efter"
229
 
230
+ #: limit-login-attempts.php:1076
231
  msgid "lockouts"
232
  msgstr "blockeringar"
233
 
234
+ #: limit-login-attempts.php:1081
235
  msgid "Change Options"
236
  msgstr "&Auml;ndra Inst&auml;llningar"
237
 
238
+ #: limit-login-attempts.php:1089
239
  msgid "Lockout log"
240
  msgstr "Log &ouml;ver blockeringar"
241
 
242
+ #: limit-login-attempts.php:1094
243
  msgid "Clear Log"
244
  msgstr "Rensa Log"
245
 
limit-login-attempts.php CHANGED
@@ -6,9 +6,9 @@
6
  Author: Johan Eenfeldt
7
  Author URI: http://devel.kostdoktorn.se
8
  Text Domain: limit-login-attempts
9
- Version: 1.6.2
10
 
11
- Copyright 2008 - 2011 Johan Eenfeldt
12
 
13
  Thanks to Michael Skerwiderski for reverse proxy handling suggestions.
14
 
@@ -43,7 +43,7 @@ define('LIMIT_LOGIN_LOCKOUT_NOTIFY_ALLOWED', 'log,email');
43
  /*
44
  * Variables
45
  *
46
- * Assignments are for default value -- change in admin page.
47
  */
48
 
49
  $limit_login_options =
@@ -175,10 +175,40 @@ function limit_login_get_address($type_name = '') {
175
  }
176
 
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  /* Check if it is ok to login */
179
  function is_limit_login_ok() {
180
  $ip = limit_login_get_address();
181
 
 
 
 
 
 
182
  /* lockout active? */
183
  $lockouts = get_option('limit_login_lockouts');
184
  return (!is_array($lockouts) || !isset($lockouts[$ip]) || time() >= $lockouts[$ip]);
@@ -324,6 +354,9 @@ function limit_login_clear_auth_cookie() {
324
  *
325
  * Increase nr of retries (if necessary). Reset valid value. Setup
326
  * lockout if nr of retries are above threshold. And more!
 
 
 
327
  */
328
  function limit_login_failed($username) {
329
  $ip = limit_login_get_address();
@@ -369,20 +402,34 @@ function limit_login_failed($username) {
369
 
370
  /* lockout! */
371
 
372
- global $limit_login_just_lockedout;
373
- $limit_login_just_lockedout = true;
374
 
375
- /* setup lockout, reset retries as needed */
376
  $retries_long = limit_login_option('allowed_retries')
377
- * limit_login_option('allowed_lockouts');
378
- if ($retries[$ip] >= $retries_long) {
379
- /* long lockout */
380
- $lockouts[$ip] = time() + limit_login_option('long_duration');
381
- unset($retries[$ip]);
382
- unset($valid[$ip]);
 
 
 
 
 
383
  } else {
384
- /* normal lockout */
385
- $lockouts[$ip] = time() + limit_login_option('lockout_duration');
 
 
 
 
 
 
 
 
 
 
 
386
  }
387
 
388
  /* do housecleaning and save values */
@@ -394,9 +441,9 @@ function limit_login_failed($username) {
394
  /* increase statistics */
395
  $total = get_option('limit_login_lockouts_total');
396
  if ($total === false || !is_numeric($total)) {
397
- add_option('limit_login_lockouts_total', 1, '', 'no');
398
  } else {
399
- update_option('limit_login_lockouts_total', $total + 1);
400
  }
401
  }
402
 
@@ -451,6 +498,7 @@ function is_limit_login_multisite() {
451
  /* Email notification of lockout to admin (if configured) */
452
  function limit_login_notify_email($user) {
453
  $ip = limit_login_get_address();
 
454
 
455
  $retries = get_option('limit_login_retries');
456
  if (!is_array($retries)) {
@@ -482,8 +530,16 @@ function limit_login_notify_email($user) {
482
 
483
  $blogname = is_limit_login_multisite() ? get_site_option('site_name') : get_option('blogname');
484
 
485
- $subject = sprintf(__("[%s] Too many failed login attempts", 'limit-login-attempts')
486
- , $blogname);
 
 
 
 
 
 
 
 
487
  $message = sprintf(__("%d failed login attempts (%d lockout(s)) from IP: %s"
488
  , 'limit-login-attempts') . "\r\n\r\n"
489
  , $count, $lockouts, $ip);
@@ -491,7 +547,11 @@ function limit_login_notify_email($user) {
491
  $message .= sprintf(__("Last user attempted: %s", 'limit-login-attempts')
492
  . "\r\n\r\n" , $user);
493
  }
494
- $message .= sprintf(__("IP was blocked for %s", 'limit-login-attempts'), $when);
 
 
 
 
495
 
496
  $admin_email = is_limit_login_multisite() ? get_site_option('admin_email') : get_option('admin_email');
497
 
@@ -600,6 +660,12 @@ function limit_login_retries_remaining_msg() {
600
 
601
  /* Return current (error) message to show, if any */
602
  function limit_login_get_message() {
 
 
 
 
 
 
603
  if (!is_limit_login_ok()) {
604
  return limit_login_error_msg();
605
  }
6
  Author: Johan Eenfeldt
7
  Author URI: http://devel.kostdoktorn.se
8
  Text Domain: limit-login-attempts
9
+ Version: 1.7.0
10
 
11
+ Copyright 2008 - 2012 Johan Eenfeldt
12
 
13
  Thanks to Michael Skerwiderski for reverse proxy handling suggestions.
14
 
43
  /*
44
  * Variables
45
  *
46
+ * Assignments are for default value -- change on admin page.
47
  */
48
 
49
  $limit_login_options =
175
  }
176
 
177
 
178
+ /*
179
+ * Check if IP is whitelisted.
180
+ *
181
+ * This function allow external ip whitelisting using a filter. Note that it can
182
+ * be called multiple times during the login process.
183
+ *
184
+ * Note that retries and statistics are still counted and notifications
185
+ * done as usual for whitelisted ips , but no lockout is done.
186
+ *
187
+ * Example:
188
+ * function my_ip_whitelist($allow, $ip) {
189
+ * return ($ip == 'my-ip') ? true : $allow;
190
+ * }
191
+ * add_filter('limit_login_whitelist_ip', 'my_ip_whitelist', 10, 2);
192
+ */
193
+ function is_limit_login_ip_whitelisted($ip = null) {
194
+ if (is_null($ip)) {
195
+ $ip = limit_login_get_address();
196
+ }
197
+ $whitelisted = apply_filters('limit_login_whitelist_ip', false, $ip);
198
+
199
+ return ($whitelisted === true);
200
+ }
201
+
202
+
203
  /* Check if it is ok to login */
204
  function is_limit_login_ok() {
205
  $ip = limit_login_get_address();
206
 
207
+ /* Check external whitelist filter */
208
+ if (is_limit_login_ip_whitelisted($ip)) {
209
+ return true;
210
+ }
211
+
212
  /* lockout active? */
213
  $lockouts = get_option('limit_login_lockouts');
214
  return (!is_array($lockouts) || !isset($lockouts[$ip]) || time() >= $lockouts[$ip]);
354
  *
355
  * Increase nr of retries (if necessary). Reset valid value. Setup
356
  * lockout if nr of retries are above threshold. And more!
357
+ *
358
+ * A note on external whitelist: retries and statistics are still counted and
359
+ * notifications done as usual, but no lockout is done.
360
  */
361
  function limit_login_failed($username) {
362
  $ip = limit_login_get_address();
402
 
403
  /* lockout! */
404
 
405
+ $whitelisted = is_limit_login_ip_whitelisted($ip);
 
406
 
 
407
  $retries_long = limit_login_option('allowed_retries')
408
+ * limit_login_option('allowed_lockouts');
409
+
410
+ /*
411
+ * Note that retries and statistics are still counted and notifications
412
+ * done as usual for whitelisted ips , but no lockout is done.
413
+ */
414
+ if ($whitelisted) {
415
+ if ($retries[$ip] >= $retries_long) {
416
+ unset($retries[$ip]);
417
+ unset($valid[$ip]);
418
+ }
419
  } else {
420
+ global $limit_login_just_lockedout;
421
+ $limit_login_just_lockedout = true;
422
+
423
+ /* setup lockout, reset retries as needed */
424
+ if ($retries[$ip] >= $retries_long) {
425
+ /* long lockout */
426
+ $lockouts[$ip] = time() + limit_login_option('long_duration');
427
+ unset($retries[$ip]);
428
+ unset($valid[$ip]);
429
+ } else {
430
+ /* normal lockout */
431
+ $lockouts[$ip] = time() + limit_login_option('lockout_duration');
432
+ }
433
  }
434
 
435
  /* do housecleaning and save values */
441
  /* increase statistics */
442
  $total = get_option('limit_login_lockouts_total');
443
  if ($total === false || !is_numeric($total)) {
444
+ add_option('limit_login_lockouts_total', 1, '', 'no');
445
  } else {
446
+ update_option('limit_login_lockouts_total', $total + 1);
447
  }
448
  }
449
 
498
  /* Email notification of lockout to admin (if configured) */
499
  function limit_login_notify_email($user) {
500
  $ip = limit_login_get_address();
501
+ $whitelisted = is_limit_login_ip_whitelisted($ip);
502
 
503
  $retries = get_option('limit_login_retries');
504
  if (!is_array($retries)) {
530
 
531
  $blogname = is_limit_login_multisite() ? get_site_option('site_name') : get_option('blogname');
532
 
533
+ if ($whitelisted) {
534
+ $subject = sprintf(__("[%s] Failed login attempts from whitelisted IP"
535
+ , 'limit-login-attempts')
536
+ , $blogname);
537
+ } else {
538
+ $subject = sprintf(__("[%s] Too many failed login attempts"
539
+ , 'limit-login-attempts')
540
+ , $blogname);
541
+ }
542
+
543
  $message = sprintf(__("%d failed login attempts (%d lockout(s)) from IP: %s"
544
  , 'limit-login-attempts') . "\r\n\r\n"
545
  , $count, $lockouts, $ip);
547
  $message .= sprintf(__("Last user attempted: %s", 'limit-login-attempts')
548
  . "\r\n\r\n" , $user);
549
  }
550
+ if ($whitelisted) {
551
+ $message .= __("IP was NOT blocked because of external whitelist.", 'limit-login-attempts');
552
+ } else {
553
+ $message .= sprintf(__("IP was blocked for %s", 'limit-login-attempts'), $when);
554
+ }
555
 
556
  $admin_email = is_limit_login_multisite() ? get_site_option('admin_email') : get_option('admin_email');
557
 
660
 
661
  /* Return current (error) message to show, if any */
662
  function limit_login_get_message() {
663
+ /* Check external whitelist */
664
+ if (is_limit_login_ip_whitelisted()) {
665
+ return '';
666
+ }
667
+
668
+ /* Is lockout in effect? */
669
  if (!is_limit_login_ok()) {
670
  return limit_login_error_msg();
671
  }
limit-login-attempts.pot CHANGED
@@ -1,238 +1,246 @@
1
- # Copyright (C) 2010 Limit Login Attempts
2
  # This file is distributed under the same license as the Limit Login Attempts package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Limit Login Attempts 1.6.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/limit-login-attempts\n"
7
- "POT-Creation-Date: 2011-02-17 15:08:09+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: limit-login-attempts.php:474
16
  msgid "%d hour"
17
  msgid_plural "%d hours"
18
  msgstr[0] ""
19
  msgstr[1] ""
20
 
21
- #: limit-login-attempts.php:480
22
  msgid "%d minute"
23
  msgid_plural "%d minutes"
24
  msgstr[0] ""
25
  msgstr[1] ""
26
 
27
- #: limit-login-attempts.php:485
 
 
 
 
28
  msgid "[%s] Too many failed login attempts"
29
  msgstr ""
30
 
31
- #: limit-login-attempts.php:487
32
  msgid "%d failed login attempts (%d lockout(s)) from IP: %s"
33
  msgstr ""
34
 
35
- #: limit-login-attempts.php:491
36
  msgid "Last user attempted: %s"
37
  msgstr ""
38
 
39
- #: limit-login-attempts.php:494
 
 
 
 
40
  msgid "IP was blocked for %s"
41
  msgstr ""
42
 
43
- #: limit-login-attempts.php:551
44
  msgid "<strong>ERROR</strong>: Too many failed login attempts."
45
  msgstr ""
46
 
47
- #: limit-login-attempts.php:555
48
  msgid "Please try again later."
49
  msgstr ""
50
 
51
- #: limit-login-attempts.php:562
52
  msgid "Please try again in %d hour."
53
  msgid_plural "Please try again in %d hours."
54
  msgstr[0] ""
55
  msgstr[1] ""
56
 
57
- #: limit-login-attempts.php:564
58
  msgid "Please try again in %d minute."
59
  msgid_plural "Please try again in %d minutes."
60
  msgstr[0] ""
61
  msgstr[1] ""
62
 
63
- #: limit-login-attempts.php:593
64
  msgid "<strong>%d</strong> attempt remaining."
65
  msgid_plural "<strong>%d</strong> attempts remaining."
66
  msgstr[0] ""
67
  msgstr[1] ""
68
 
69
- #: limit-login-attempts.php:658
70
  msgid "<strong>ERROR</strong>: Incorrect username or password."
71
  msgstr ""
72
 
73
- #: limit-login-attempts.php:826
74
  msgctxt "Internet address"
75
  msgid "IP"
76
  msgstr ""
77
 
78
- #: limit-login-attempts.php:826
79
  msgid "Tried to log in as"
80
  msgstr ""
81
 
82
- #: limit-login-attempts.php:831
83
  msgid "%d lockout"
84
  msgid_plural "%d lockouts"
85
  msgstr[0] ""
86
  msgstr[1] ""
87
 
88
- #: limit-login-attempts.php:860
89
  msgid "Cleared IP log"
90
  msgstr ""
91
 
92
- #: limit-login-attempts.php:868
93
  msgid "Reset lockout count"
94
  msgstr ""
95
 
96
- #: limit-login-attempts.php:876
97
  msgid "Cleared current lockouts"
98
  msgstr ""
99
 
100
- #: limit-login-attempts.php:905
101
  msgid "Options changed"
102
  msgstr ""
103
 
104
- #: limit-login-attempts.php:923
105
  msgid "It appears the site is reached directly (from your IP: %s)"
106
  msgstr ""
107
 
108
- #: limit-login-attempts.php:925
109
  msgid ""
110
  "It appears the site is reached through a proxy server (proxy IP: %s, your "
111
  "IP: %s)"
112
  msgstr ""
113
 
114
- #: limit-login-attempts.php:933
115
  msgid ""
116
  "<strong>Current setting appears to be invalid</strong>. Please make sure it "
117
  "is correct. Further information can be found <a href=\"%s\" title=\"FAQ"
118
  "\">here</a>"
119
  msgstr ""
120
 
121
- #: limit-login-attempts.php:941
122
  msgid "Limit Login Attempts Settings"
123
  msgstr ""
124
 
125
- #: limit-login-attempts.php:942
126
  msgid "Statistics"
127
  msgstr ""
128
 
129
- #: limit-login-attempts.php:947
130
  msgid "Total lockouts"
131
  msgstr ""
132
 
133
- #: limit-login-attempts.php:950
134
  msgid "Reset Counter"
135
  msgstr ""
136
 
137
- #: limit-login-attempts.php:951
138
  msgid "%d lockout since last reset"
139
  msgid_plural "%d lockouts since last reset"
140
  msgstr[0] ""
141
  msgstr[1] ""
142
 
143
- #: limit-login-attempts.php:952
144
  msgid "No lockouts yet"
145
  msgstr ""
146
 
147
- #: limit-login-attempts.php:957
148
  msgid "Active lockouts"
149
  msgstr ""
150
 
151
- #: limit-login-attempts.php:959
152
  msgid "Restore Lockouts"
153
  msgstr ""
154
 
155
- #: limit-login-attempts.php:960
156
  msgid "%d IP is currently blocked from trying to log in"
157
  msgstr ""
158
 
159
- #: limit-login-attempts.php:966
160
  msgid "Options"
161
  msgstr ""
162
 
163
- #: limit-login-attempts.php:971
164
  msgid "Lockout"
165
  msgstr ""
166
 
167
- #: limit-login-attempts.php:973
168
  msgid "allowed retries"
169
  msgstr ""
170
 
171
- #: limit-login-attempts.php:974
172
  msgid "minutes lockout"
173
  msgstr ""
174
 
175
- #: limit-login-attempts.php:975
176
  msgid "lockouts increase lockout time to"
177
  msgstr ""
178
 
179
- #: limit-login-attempts.php:975
180
  msgid "hours"
181
  msgstr ""
182
 
183
- #: limit-login-attempts.php:976
184
  msgid "hours until retries are reset"
185
  msgstr ""
186
 
187
- #: limit-login-attempts.php:980
188
  msgid "Site connection"
189
  msgstr ""
190
 
191
- #: limit-login-attempts.php:986
192
  msgid "Direct connection"
193
  msgstr ""
194
 
195
- #: limit-login-attempts.php:991
196
  msgid "From behind a reversy proxy"
197
  msgstr ""
198
 
199
- #: limit-login-attempts.php:997
200
  msgid "Handle cookie login"
201
  msgstr ""
202
 
203
- #: limit-login-attempts.php:999
204
  msgid "Yes"
205
  msgstr ""
206
 
207
- #: limit-login-attempts.php:999
208
  msgid "No"
209
  msgstr ""
210
 
211
- #: limit-login-attempts.php:1003
212
  msgid "Notify on lockout"
213
  msgstr ""
214
 
215
- #: limit-login-attempts.php:1005
216
  msgid "Log IP"
217
  msgstr ""
218
 
219
- #: limit-login-attempts.php:1006
220
  msgid "Email to admin after"
221
  msgstr ""
222
 
223
- #: limit-login-attempts.php:1006
224
  msgid "lockouts"
225
  msgstr ""
226
 
227
- #: limit-login-attempts.php:1011
228
  msgid "Change Options"
229
  msgstr ""
230
 
231
- #: limit-login-attempts.php:1019
232
  msgid "Lockout log"
233
  msgstr ""
234
 
235
- #: limit-login-attempts.php:1024
236
  msgid "Clear Log"
237
  msgstr ""
238
 
1
+ # Copyright (C) 2012 Limit Login Attempts
2
  # This file is distributed under the same license as the Limit Login Attempts package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Limit Login Attempts 1.7.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/limit-login-attempts\n"
7
+ "POT-Creation-Date: 2012-05-20 10:43:32+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: limit-login-attempts.php:522
16
  msgid "%d hour"
17
  msgid_plural "%d hours"
18
  msgstr[0] ""
19
  msgstr[1] ""
20
 
21
+ #: limit-login-attempts.php:528
22
  msgid "%d minute"
23
  msgid_plural "%d minutes"
24
  msgstr[0] ""
25
  msgstr[1] ""
26
 
27
+ #: limit-login-attempts.php:534
28
+ msgid "[%s] Failed login attempts from whitelisted IP"
29
+ msgstr ""
30
+
31
+ #: limit-login-attempts.php:538
32
  msgid "[%s] Too many failed login attempts"
33
  msgstr ""
34
 
35
+ #: limit-login-attempts.php:543
36
  msgid "%d failed login attempts (%d lockout(s)) from IP: %s"
37
  msgstr ""
38
 
39
+ #: limit-login-attempts.php:547
40
  msgid "Last user attempted: %s"
41
  msgstr ""
42
 
43
+ #: limit-login-attempts.php:551
44
+ msgid "IP was NOT blocked because of external whitelist."
45
+ msgstr ""
46
+
47
+ #: limit-login-attempts.php:553
48
  msgid "IP was blocked for %s"
49
  msgstr ""
50
 
51
+ #: limit-login-attempts.php:615
52
  msgid "<strong>ERROR</strong>: Too many failed login attempts."
53
  msgstr ""
54
 
55
+ #: limit-login-attempts.php:619
56
  msgid "Please try again later."
57
  msgstr ""
58
 
59
+ #: limit-login-attempts.php:626
60
  msgid "Please try again in %d hour."
61
  msgid_plural "Please try again in %d hours."
62
  msgstr[0] ""
63
  msgstr[1] ""
64
 
65
+ #: limit-login-attempts.php:628
66
  msgid "Please try again in %d minute."
67
  msgid_plural "Please try again in %d minutes."
68
  msgstr[0] ""
69
  msgstr[1] ""
70
 
71
+ #: limit-login-attempts.php:657
72
  msgid "<strong>%d</strong> attempt remaining."
73
  msgid_plural "<strong>%d</strong> attempts remaining."
74
  msgstr[0] ""
75
  msgstr[1] ""
76
 
77
+ #: limit-login-attempts.php:728
78
  msgid "<strong>ERROR</strong>: Incorrect username or password."
79
  msgstr ""
80
 
81
+ #: limit-login-attempts.php:896
82
  msgctxt "Internet address"
83
  msgid "IP"
84
  msgstr ""
85
 
86
+ #: limit-login-attempts.php:896
87
  msgid "Tried to log in as"
88
  msgstr ""
89
 
90
+ #: limit-login-attempts.php:901
91
  msgid "%d lockout"
92
  msgid_plural "%d lockouts"
93
  msgstr[0] ""
94
  msgstr[1] ""
95
 
96
+ #: limit-login-attempts.php:930
97
  msgid "Cleared IP log"
98
  msgstr ""
99
 
100
+ #: limit-login-attempts.php:938
101
  msgid "Reset lockout count"
102
  msgstr ""
103
 
104
+ #: limit-login-attempts.php:946
105
  msgid "Cleared current lockouts"
106
  msgstr ""
107
 
108
+ #: limit-login-attempts.php:975
109
  msgid "Options changed"
110
  msgstr ""
111
 
112
+ #: limit-login-attempts.php:993
113
  msgid "It appears the site is reached directly (from your IP: %s)"
114
  msgstr ""
115
 
116
+ #: limit-login-attempts.php:995
117
  msgid ""
118
  "It appears the site is reached through a proxy server (proxy IP: %s, your "
119
  "IP: %s)"
120
  msgstr ""
121
 
122
+ #: limit-login-attempts.php:1003
123
  msgid ""
124
  "<strong>Current setting appears to be invalid</strong>. Please make sure it "
125
  "is correct. Further information can be found <a href=\"%s\" title=\"FAQ"
126
  "\">here</a>"
127
  msgstr ""
128
 
129
+ #: limit-login-attempts.php:1011
130
  msgid "Limit Login Attempts Settings"
131
  msgstr ""
132
 
133
+ #: limit-login-attempts.php:1012
134
  msgid "Statistics"
135
  msgstr ""
136
 
137
+ #: limit-login-attempts.php:1017
138
  msgid "Total lockouts"
139
  msgstr ""
140
 
141
+ #: limit-login-attempts.php:1020
142
  msgid "Reset Counter"
143
  msgstr ""
144
 
145
+ #: limit-login-attempts.php:1021
146
  msgid "%d lockout since last reset"
147
  msgid_plural "%d lockouts since last reset"
148
  msgstr[0] ""
149
  msgstr[1] ""
150
 
151
+ #: limit-login-attempts.php:1022
152
  msgid "No lockouts yet"
153
  msgstr ""
154
 
155
+ #: limit-login-attempts.php:1027
156
  msgid "Active lockouts"
157
  msgstr ""
158
 
159
+ #: limit-login-attempts.php:1029
160
  msgid "Restore Lockouts"
161
  msgstr ""
162
 
163
+ #: limit-login-attempts.php:1030
164
  msgid "%d IP is currently blocked from trying to log in"
165
  msgstr ""
166
 
167
+ #: limit-login-attempts.php:1036
168
  msgid "Options"
169
  msgstr ""
170
 
171
+ #: limit-login-attempts.php:1041
172
  msgid "Lockout"
173
  msgstr ""
174
 
175
+ #: limit-login-attempts.php:1043
176
  msgid "allowed retries"
177
  msgstr ""
178
 
179
+ #: limit-login-attempts.php:1044
180
  msgid "minutes lockout"
181
  msgstr ""
182
 
183
+ #: limit-login-attempts.php:1045
184
  msgid "lockouts increase lockout time to"
185
  msgstr ""
186
 
187
+ #: limit-login-attempts.php:1045
188
  msgid "hours"
189
  msgstr ""
190
 
191
+ #: limit-login-attempts.php:1046
192
  msgid "hours until retries are reset"
193
  msgstr ""
194
 
195
+ #: limit-login-attempts.php:1050
196
  msgid "Site connection"
197
  msgstr ""
198
 
199
+ #: limit-login-attempts.php:1056
200
  msgid "Direct connection"
201
  msgstr ""
202
 
203
+ #: limit-login-attempts.php:1061
204
  msgid "From behind a reversy proxy"
205
  msgstr ""
206
 
207
+ #: limit-login-attempts.php:1067
208
  msgid "Handle cookie login"
209
  msgstr ""
210
 
211
+ #: limit-login-attempts.php:1069
212
  msgid "Yes"
213
  msgstr ""
214
 
215
+ #: limit-login-attempts.php:1069
216
  msgid "No"
217
  msgstr ""
218
 
219
+ #: limit-login-attempts.php:1073
220
  msgid "Notify on lockout"
221
  msgstr ""
222
 
223
+ #: limit-login-attempts.php:1075
224
  msgid "Log IP"
225
  msgstr ""
226
 
227
+ #: limit-login-attempts.php:1076
228
  msgid "Email to admin after"
229
  msgstr ""
230
 
231
+ #: limit-login-attempts.php:1076
232
  msgid "lockouts"
233
  msgstr ""
234
 
235
+ #: limit-login-attempts.php:1081
236
  msgid "Change Options"
237
  msgstr ""
238
 
239
+ #: limit-login-attempts.php:1089
240
  msgid "Lockout log"
241
  msgstr ""
242
 
243
+ #: limit-login-attempts.php:1094
244
  msgid "Clear Log"
245
  msgstr ""
246
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: johanee
3
  Tags: login, security, authentication
4
  Requires at least: 2.8
5
- Tested up to: 3.2.1
6
- Stable tag: 1.6.2
7
 
8
  Limit rate of login attempts, including by way of cookies, for each IP. Fully customizable.
9
 
@@ -22,6 +22,7 @@ Features
22
  * Informs user about remaining retries or lockout time on login page
23
  * Optional logging, optional email notification
24
  * Handles server behind reverse proxy
 
25
 
26
  Translations: Bulgarian, Brazilian Portuguese, Catalan, Chinese (Traditional), Czech, Dutch, Finnish, French, German, Hungarian, Norwegian, Persian, Romanian, Russian, Spanish, Swedish, Turkish
27
 
@@ -51,10 +52,26 @@ The option default to NOT being behind a proxy -- which should be by far the com
51
 
52
  You probably are not or you would know. We show a pretty good guess on the option page. Set the option using this unless you are sure you know better.
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  = I locked myself out testing this thing, what do I do? =
55
 
56
  Either wait, or:
57
 
 
 
58
  If you have ftp / ssh access to the site rename the file "wp-content/plugins/limit-login-attempts/limit-login-attempts.php" to deactivate the plugin.
59
 
60
  If you have access to the database (for example through phpMyAdmin) you can clear the limit_login_lockouts option in the wordpress options table. In a default setup this would work: "UPDATE wp_options SET option_value = '' WHERE option_name = 'limit_login_lockouts'"
@@ -67,6 +84,12 @@ If you have access to the database (for example through phpMyAdmin) you can clea
67
 
68
  == Changelog ==
69
 
 
 
 
 
 
 
70
  = 1.6.2 =
71
  * Fix bug where log would not get updated after it had been cleared
72
  * Do plugin setup in 'init' action
2
  Contributors: johanee
3
  Tags: login, security, authentication
4
  Requires at least: 2.8
5
+ Tested up to: 3.3.2
6
+ Stable tag: 1.7.0
7
 
8
  Limit rate of login attempts, including by way of cookies, for each IP. Fully customizable.
9
 
22
  * Informs user about remaining retries or lockout time on login page
23
  * Optional logging, optional email notification
24
  * Handles server behind reverse proxy
25
+ * It is possible to whitelist IPs using a filter. But you probably shouldn't. :-)
26
 
27
  Translations: Bulgarian, Brazilian Portuguese, Catalan, Chinese (Traditional), Czech, Dutch, Finnish, French, German, Hungarian, Norwegian, Persian, Romanian, Russian, Spanish, Swedish, Turkish
28
 
52
 
53
  You probably are not or you would know. We show a pretty good guess on the option page. Set the option using this unless you are sure you know better.
54
 
55
+ = Can I whitelist my IP so I don't get locked out? =
56
+
57
+ First please consider if you really need this. Generally speaking it is not a good idea to have exceptions to your security policies.
58
+
59
+ That said, there is now a filter which allows you to do it: "limit_login_whitelist_ip".
60
+
61
+ Example:
62
+ function my_ip_whitelist($allow, $ip) {
63
+ return ($ip == 'my-ip') ? true : $allow;
64
+ }
65
+ add_filter('limit_login_whitelist_ip', 'my_ip_whitelist', 10, 2);
66
+
67
+ Note that we still do notification and logging as usual. This is meant to allow you to be aware of any suspicious activity from whitelisted IPs.
68
+
69
  = I locked myself out testing this thing, what do I do? =
70
 
71
  Either wait, or:
72
 
73
+ If you know how to edit / add to PHP files you can use the IP whitelist functionality described above. You should then use the "Restore Lockouts" button on the plugin settings page and remove the whitelist function again.
74
+
75
  If you have ftp / ssh access to the site rename the file "wp-content/plugins/limit-login-attempts/limit-login-attempts.php" to deactivate the plugin.
76
 
77
  If you have access to the database (for example through phpMyAdmin) you can clear the limit_login_lockouts option in the wordpress options table. In a default setup this would work: "UPDATE wp_options SET option_value = '' WHERE option_name = 'limit_login_lockouts'"
84
 
85
  == Changelog ==
86
 
87
+ = 1.7.0 =
88
+ * Added filter that allows whitelisting IP. Please use with care!!
89
+ * Update to Spanish translation, thanks to Marcelo Pedra
90
+ * Updated Swedish translation
91
+ * Tested against WordPress 3.3.2
92
+
93
  = 1.6.2 =
94
  * Fix bug where log would not get updated after it had been cleared
95
  * Do plugin setup in 'init' action