Version Description
- Option to inform user about remaining attempts on login page
- Ability to reset options
- Status panel on the settings page
Download this release
Release Info
Developer | Jan-Paul Kleemans |
Plugin | Brute Force Login Protection |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.2
- brute-force-login-protection.php +78 -12
- languages/brute-force-login-protection-nl_NL.mo +0 -0
- languages/brute-force-login-protection-nl_NL.po +86 -20
- readme.txt +9 -3
- settings-page.php +54 -1
brute-force-login-protection.php
CHANGED
@@ -5,10 +5,12 @@ require_once ABSPATH . '/wp-admin/includes/file.php';
|
|
5 |
|
6 |
/**
|
7 |
* Plugin Name: Brute Force Login Protection
|
|
|
8 |
* Description: Protects your website against brute force login attacks using .htaccess
|
9 |
* Text Domain: brute-force-login-protection
|
10 |
* Author: Jan-Paul Kleemans
|
11 |
-
*
|
|
|
12 |
* License: GPL2
|
13 |
*
|
14 |
* Copyright 2014 Jan-Paul Kleemans
|
@@ -32,11 +34,7 @@ class BruteForceLoginProtection {
|
|
32 |
|
33 |
public function __construct() {
|
34 |
//Default options
|
35 |
-
$this->
|
36 |
-
'allowed_attempts' => 20, //Allowed login attempts before deny,
|
37 |
-
'reset_time' => 60, //Minutes before resetting login attempts count
|
38 |
-
'htaccess_dir' => get_home_path() //.htaccess file location
|
39 |
-
);
|
40 |
|
41 |
//Activation and deactivation hooks
|
42 |
register_activation_hook(__FILE__, array($this, 'activate'));
|
@@ -65,7 +63,7 @@ class BruteForceLoginProtection {
|
|
65 |
$this->__fillOptions();
|
66 |
|
67 |
//Call checkRequirements to check for .htaccess errors
|
68 |
-
add_action('admin_notices', array($this, '
|
69 |
}
|
70 |
|
71 |
/**
|
@@ -123,16 +121,18 @@ class BruteForceLoginProtection {
|
|
123 |
}
|
124 |
|
125 |
/**
|
126 |
-
* Checks
|
127 |
*
|
128 |
* @return void
|
129 |
*/
|
130 |
-
public function
|
131 |
-
|
|
|
|
|
132 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not found', 'brute-force-login-protection'));
|
133 |
-
} elseif (
|
134 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not readable', 'brute-force-login-protection'));
|
135 |
-
} elseif (
|
136 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not writeable', 'brute-force-login-protection'));
|
137 |
}
|
138 |
}
|
@@ -159,6 +159,10 @@ class BruteForceLoginProtection {
|
|
159 |
$this->__showError(sprintf(__('An error occurred while unblocking IP %s', 'brute-force-login-protection'), $IP));
|
160 |
}
|
161 |
}
|
|
|
|
|
|
|
|
|
162 |
}
|
163 |
|
164 |
include 'settings-page.php';
|
@@ -194,6 +198,13 @@ class BruteForceLoginProtection {
|
|
194 |
|
195 |
update_option('bflp_login_attempts', $attempts);
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
if ($denyIP) {
|
198 |
$this->__denyIP($IP);
|
199 |
}
|
@@ -253,6 +264,33 @@ class BruteForceLoginProtection {
|
|
253 |
* Private functions
|
254 |
*/
|
255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
/**
|
257 |
* Registers options (settings).
|
258 |
*
|
@@ -261,6 +299,7 @@ class BruteForceLoginProtection {
|
|
261 |
private function __registerOptions() {
|
262 |
register_setting('brute-force-login-protection', 'bflp_allowed_attempts', array($this, 'validateAllowedAttempts'));
|
263 |
register_setting('brute-force-login-protection', 'bflp_reset_time', array($this, 'validateResetTime'));
|
|
|
264 |
register_setting('brute-force-login-protection', 'bflp_htaccess_dir');
|
265 |
}
|
266 |
|
@@ -272,9 +311,36 @@ class BruteForceLoginProtection {
|
|
272 |
private function __fillOptions() {
|
273 |
$this->__options['allowed_attempts'] = get_option('bflp_allowed_attempts', $this->__options['allowed_attempts']);
|
274 |
$this->__options['reset_time'] = get_option('bflp_reset_time', $this->__options['reset_time']);
|
|
|
275 |
$this->__options['htaccess_dir'] = get_option('bflp_htaccess_dir', $this->__options['htaccess_dir']);
|
276 |
}
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
/**
|
279 |
* Returs array of denied IP addresses from .htaccess.
|
280 |
*
|
5 |
|
6 |
/**
|
7 |
* Plugin Name: Brute Force Login Protection
|
8 |
+
* Plugin URI: http://wordpress.org/plugins/brute-force-login-protection/
|
9 |
* Description: Protects your website against brute force login attacks using .htaccess
|
10 |
* Text Domain: brute-force-login-protection
|
11 |
* Author: Jan-Paul Kleemans
|
12 |
+
* Author URI: http://profiles.wordpress.org/jan-paul-kleemans/
|
13 |
+
* Version: 1.2
|
14 |
* License: GPL2
|
15 |
*
|
16 |
* Copyright 2014 Jan-Paul Kleemans
|
34 |
|
35 |
public function __construct() {
|
36 |
//Default options
|
37 |
+
$this->__setDefaultOptions();
|
|
|
|
|
|
|
|
|
38 |
|
39 |
//Activation and deactivation hooks
|
40 |
register_activation_hook(__FILE__, array($this, 'activate'));
|
63 |
$this->__fillOptions();
|
64 |
|
65 |
//Call checkRequirements to check for .htaccess errors
|
66 |
+
add_action('admin_notices', array($this, 'showRequirementsErrors'));
|
67 |
}
|
68 |
|
69 |
/**
|
121 |
}
|
122 |
|
123 |
/**
|
124 |
+
* Checks requirements and shows errors
|
125 |
*
|
126 |
* @return void
|
127 |
*/
|
128 |
+
public function showRequirementsErrors() {
|
129 |
+
$status = $this->__checkRequirements();
|
130 |
+
|
131 |
+
if (!$status['found']) {
|
132 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not found', 'brute-force-login-protection'));
|
133 |
+
} elseif (!$status['readable']) {
|
134 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not readable', 'brute-force-login-protection'));
|
135 |
+
} elseif (!$status['writeable']) {
|
136 |
$this->__showError(__('Brute Force Login Protection error: .htaccess file not writeable', 'brute-force-login-protection'));
|
137 |
}
|
138 |
}
|
159 |
$this->__showError(sprintf(__('An error occurred while unblocking IP %s', 'brute-force-login-protection'), $IP));
|
160 |
}
|
161 |
}
|
162 |
+
} elseif (isset($_POST['reset'])) {
|
163 |
+
$this->__deleteOptions();
|
164 |
+
$this->__setDefaultOptions();
|
165 |
+
$this->__showMessage(sprintf(__('The Options have been successfully reset', 'brute-force-login-protection'), $IP));
|
166 |
}
|
167 |
|
168 |
include 'settings-page.php';
|
198 |
|
199 |
update_option('bflp_login_attempts', $attempts);
|
200 |
|
201 |
+
if ($this->__options['inform_user']) {
|
202 |
+
global $error;
|
203 |
+
$remainingAttempts = $this->__options['allowed_attempts'] - $attempts[$IP]['attempts'];
|
204 |
+
$error .= '<br />';
|
205 |
+
$error .= sprintf(_n("%d attempt remaining.", "%d attempts remaining.", $remainingAttempts, 'brute-force-login-protection'), $remainingAttempts);
|
206 |
+
}
|
207 |
+
|
208 |
if ($denyIP) {
|
209 |
$this->__denyIP($IP);
|
210 |
}
|
264 |
* Private functions
|
265 |
*/
|
266 |
|
267 |
+
/**
|
268 |
+
* Checks if .htaccess file is found, readable and writeable.
|
269 |
+
*
|
270 |
+
* @return array
|
271 |
+
*/
|
272 |
+
public function __checkRequirements() {
|
273 |
+
$status = array(
|
274 |
+
'found' => false,
|
275 |
+
'readable' => false,
|
276 |
+
'writeable' => false
|
277 |
+
);
|
278 |
+
|
279 |
+
$htaccessPath = $this->__options['htaccess_dir'] . '/.htaccess';
|
280 |
+
|
281 |
+
if (file_exists($htaccessPath)) { //File found
|
282 |
+
$status['found'] = true;
|
283 |
+
}
|
284 |
+
if (is_readable($htaccessPath)) { //File readable
|
285 |
+
$status['readable'] = true;
|
286 |
+
}
|
287 |
+
if (is_writeable($htaccessPath)) { //File writeable
|
288 |
+
$status['writeable'] = true;
|
289 |
+
}
|
290 |
+
|
291 |
+
return $status;
|
292 |
+
}
|
293 |
+
|
294 |
/**
|
295 |
* Registers options (settings).
|
296 |
*
|
299 |
private function __registerOptions() {
|
300 |
register_setting('brute-force-login-protection', 'bflp_allowed_attempts', array($this, 'validateAllowedAttempts'));
|
301 |
register_setting('brute-force-login-protection', 'bflp_reset_time', array($this, 'validateResetTime'));
|
302 |
+
register_setting('brute-force-login-protection', 'bflp_inform_user');
|
303 |
register_setting('brute-force-login-protection', 'bflp_htaccess_dir');
|
304 |
}
|
305 |
|
311 |
private function __fillOptions() {
|
312 |
$this->__options['allowed_attempts'] = get_option('bflp_allowed_attempts', $this->__options['allowed_attempts']);
|
313 |
$this->__options['reset_time'] = get_option('bflp_reset_time', $this->__options['reset_time']);
|
314 |
+
$this->__options['inform_user'] = get_option('bflp_inform_user', $this->__options['inform_user']);
|
315 |
$this->__options['htaccess_dir'] = get_option('bflp_htaccess_dir', $this->__options['htaccess_dir']);
|
316 |
}
|
317 |
|
318 |
+
/**
|
319 |
+
* Fills options with default value.
|
320 |
+
*
|
321 |
+
* @return void
|
322 |
+
*/
|
323 |
+
private function __setDefaultOptions() {
|
324 |
+
$this->__options = array(
|
325 |
+
'allowed_attempts' => 20, //Allowed login attempts before deny,
|
326 |
+
'reset_time' => 60, //Minutes before resetting login attempts count
|
327 |
+
'inform_user' => true, //Inform user about remaining login attempts on login page
|
328 |
+
'htaccess_dir' => get_home_path() //.htaccess file location
|
329 |
+
);
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Deletes options from database
|
334 |
+
*
|
335 |
+
* @return void
|
336 |
+
*/
|
337 |
+
private function __deleteOptions() {
|
338 |
+
delete_option('bflp_allowed_attempts');
|
339 |
+
delete_option('bflp_reset_time');
|
340 |
+
delete_option('bflp_inform_user');
|
341 |
+
delete_option('bflp_htaccess_dir');
|
342 |
+
}
|
343 |
+
|
344 |
/**
|
345 |
* Returs array of denied IP addresses from .htaccess.
|
346 |
*
|
languages/brute-force-login-protection-nl_NL.mo
CHANGED
Binary file
|
languages/brute-force-login-protection-nl_NL.po
CHANGED
@@ -4,18 +4,18 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Brute Force Login Protection 1.0\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/brute-force-login-protection\n"
|
7 |
-
"POT-Creation-Date: 2014-06-
|
|
|
|
|
|
|
|
|
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: 2014-06-25 14:07+0100\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
"X-Generator: Poedit 1.6.5\n"
|
15 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"Language: nl\n"
|
17 |
|
18 |
-
#: brute-force-login-protection.php:
|
19 |
msgid "Brute Force Login Protection Settings"
|
20 |
msgstr "Brute Force Login Protection Instellingen"
|
21 |
|
@@ -47,61 +47,119 @@ msgstr "IP %s gedeblokkeerd"
|
|
47 |
msgid "An error occurred while unblocking IP %s"
|
48 |
msgstr "Er is een fout opgetreden bij het deblokkeren van IP %s"
|
49 |
|
50 |
-
#: brute-force-login-protection.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
msgid "Allowed login attempts must be a number (between 1 and 100)"
|
52 |
msgstr "Toegestane inlogpogingen moet een getal zijn (tussen 1 en 100)"
|
53 |
|
54 |
-
#: brute-force-login-protection.php:
|
55 |
msgid "Minutes before resetting must be a number (higher than 1)"
|
56 |
msgstr ""
|
57 |
"Minuten voordat loginpogingen teller wordt gereset moet een getal zijn "
|
58 |
"(groter dan 1)"
|
59 |
|
60 |
-
#: settings-page.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
msgid "Options"
|
62 |
msgstr "Opties"
|
63 |
|
64 |
-
#: settings-page.php:
|
65 |
msgid "Allowed login attempts before blocking IP"
|
66 |
msgstr "Toegestane inlogpogingen voordat IP wordt geblokkeerd"
|
67 |
|
68 |
-
#: settings-page.php:
|
69 |
msgid "Minutes before resetting login attempts count"
|
70 |
msgstr "Minuten voordat loginpogingen teller wordt gereset"
|
71 |
|
72 |
-
#: settings-page.php:
|
|
|
|
|
|
|
|
|
73 |
msgid ".htaccess file location"
|
74 |
msgstr ".htaccess bestandslocatie"
|
75 |
|
76 |
-
#: settings-page.php:
|
77 |
msgid "Save"
|
78 |
msgstr "Opslaan"
|
79 |
|
80 |
-
#: settings-page.php:
|
|
|
|
|
|
|
|
|
81 |
msgid "Manually block IP"
|
82 |
msgstr "Handmatig IP blokkeren"
|
83 |
|
84 |
-
#: settings-page.php:
|
85 |
msgid "IP address"
|
86 |
msgstr "IP adres"
|
87 |
|
88 |
-
#: settings-page.php:
|
89 |
msgid "Block"
|
90 |
msgstr "Blokkeren"
|
91 |
|
92 |
-
#: settings-page.php:
|
93 |
msgid "Blocked IPs"
|
94 |
msgstr "Geblokkeerde IPs"
|
95 |
|
96 |
-
#: settings-page.php:
|
97 |
msgid "Address"
|
98 |
msgstr "Adres"
|
99 |
|
100 |
-
#: settings-page.php:
|
101 |
msgid "Actions"
|
102 |
msgstr "Acties"
|
103 |
|
104 |
-
#: settings-page.php:
|
105 |
msgid "Unblock"
|
106 |
msgstr "Deblokkeren"
|
107 |
|
@@ -109,6 +167,10 @@ msgstr "Deblokkeren"
|
|
109 |
msgid "Brute Force Login Protection"
|
110 |
msgstr "Brute Force Login Protection"
|
111 |
|
|
|
|
|
|
|
|
|
112 |
#. Description of the plugin/theme
|
113 |
msgid "Protects your website against brute force login attacks using .htaccess"
|
114 |
msgstr ""
|
@@ -118,3 +180,7 @@ msgstr ""
|
|
118 |
#. Author of the plugin/theme
|
119 |
msgid "Jan-Paul Kleemans"
|
120 |
msgstr "Jan-Paul Kleemans"
|
|
|
|
|
|
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Brute Force Login Protection 1.0\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/brute-force-login-protection\n"
|
7 |
+
"POT-Creation-Date: 2014-06-26 13:53:07+00:00\n"
|
8 |
+
"PO-Revision-Date: 2014-06-26 15:58+0100\n"
|
9 |
+
"Last-Translator: \n"
|
10 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11 |
+
"Language: nl\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
|
|
|
15 |
"X-Generator: Poedit 1.6.5\n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
|
17 |
|
18 |
+
#: brute-force-login-protection.php:84 settings-page.php:28
|
19 |
msgid "Brute Force Login Protection Settings"
|
20 |
msgstr "Brute Force Login Protection Instellingen"
|
21 |
|
47 |
msgid "An error occurred while unblocking IP %s"
|
48 |
msgstr "Er is een fout opgetreden bij het deblokkeren van IP %s"
|
49 |
|
50 |
+
#: brute-force-login-protection.php:165
|
51 |
+
msgid "The Options have been successfully reset"
|
52 |
+
msgstr "De opties zijn succesvol gereset"
|
53 |
+
|
54 |
+
#: brute-force-login-protection.php:205
|
55 |
+
msgid "%d attempt remaining."
|
56 |
+
msgid_plural "%d attempts remaining."
|
57 |
+
msgstr[0] "%d resterende loginpoging."
|
58 |
+
msgstr[1] "%d resterende loginpogingen."
|
59 |
+
|
60 |
+
#: brute-force-login-protection.php:243
|
61 |
msgid "Allowed login attempts must be a number (between 1 and 100)"
|
62 |
msgstr "Toegestane inlogpogingen moet een getal zijn (tussen 1 en 100)"
|
63 |
|
64 |
+
#: brute-force-login-protection.php:258
|
65 |
msgid "Minutes before resetting must be a number (higher than 1)"
|
66 |
msgstr ""
|
67 |
"Minuten voordat loginpogingen teller wordt gereset moet een getal zijn "
|
68 |
"(groter dan 1)"
|
69 |
|
70 |
+
#: settings-page.php:21
|
71 |
+
msgid "Are you sure you want to reset all options?"
|
72 |
+
msgstr "Weet u zeker dat u alle opties wilt resetten?"
|
73 |
+
|
74 |
+
#: settings-page.php:34
|
75 |
+
msgid "Status"
|
76 |
+
msgstr "Status"
|
77 |
+
|
78 |
+
#: settings-page.php:36
|
79 |
+
msgid "You are not protected!"
|
80 |
+
msgstr "U bent niet beschermd"
|
81 |
+
|
82 |
+
#: settings-page.php:38
|
83 |
+
msgid "You are protected!"
|
84 |
+
msgstr "U bent beschermd"
|
85 |
+
|
86 |
+
#: settings-page.php:43
|
87 |
+
msgid ".htaccess file found"
|
88 |
+
msgstr ".htaccess bestand gevonden"
|
89 |
+
|
90 |
+
#: settings-page.php:45
|
91 |
+
msgid ".htaccess file not found"
|
92 |
+
msgstr ".htaccess bestand niet gevonden"
|
93 |
+
|
94 |
+
#: settings-page.php:49
|
95 |
+
msgid ".htaccess file readable"
|
96 |
+
msgstr ".htaccess bestand leesbaar"
|
97 |
+
|
98 |
+
#: settings-page.php:51
|
99 |
+
msgid ".htaccess file not readable"
|
100 |
+
msgstr ".htaccess niet leesbaar"
|
101 |
+
|
102 |
+
#: settings-page.php:55
|
103 |
+
msgid ".htaccess file writeable"
|
104 |
+
msgstr ".htaccess bestand beschrijfbaar"
|
105 |
+
|
106 |
+
#: settings-page.php:57
|
107 |
+
msgid ".htaccess file not writeable"
|
108 |
+
msgstr ".htaccess bestand niet beschrijfbaar"
|
109 |
+
|
110 |
+
#: settings-page.php:63
|
111 |
msgid "Options"
|
112 |
msgstr "Opties"
|
113 |
|
114 |
+
#: settings-page.php:67
|
115 |
msgid "Allowed login attempts before blocking IP"
|
116 |
msgstr "Toegestane inlogpogingen voordat IP wordt geblokkeerd"
|
117 |
|
118 |
+
#: settings-page.php:70
|
119 |
msgid "Minutes before resetting login attempts count"
|
120 |
msgstr "Minuten voordat loginpogingen teller wordt gereset"
|
121 |
|
122 |
+
#: settings-page.php:73
|
123 |
+
msgid "Inform user about remaining login attempts on login page"
|
124 |
+
msgstr "Informeer de gebruiker over resterende loginpogingen op de loginpagina"
|
125 |
+
|
126 |
+
#: settings-page.php:76
|
127 |
msgid ".htaccess file location"
|
128 |
msgstr ".htaccess bestandslocatie"
|
129 |
|
130 |
+
#: settings-page.php:80
|
131 |
msgid "Save"
|
132 |
msgstr "Opslaan"
|
133 |
|
134 |
+
#: settings-page.php:81
|
135 |
+
msgid "Reset"
|
136 |
+
msgstr "Reset"
|
137 |
+
|
138 |
+
#: settings-page.php:87
|
139 |
msgid "Manually block IP"
|
140 |
msgstr "Handmatig IP blokkeren"
|
141 |
|
142 |
+
#: settings-page.php:90
|
143 |
msgid "IP address"
|
144 |
msgstr "IP adres"
|
145 |
|
146 |
+
#: settings-page.php:94
|
147 |
msgid "Block"
|
148 |
msgstr "Blokkeren"
|
149 |
|
150 |
+
#: settings-page.php:100
|
151 |
msgid "Blocked IPs"
|
152 |
msgstr "Geblokkeerde IPs"
|
153 |
|
154 |
+
#: settings-page.php:105
|
155 |
msgid "Address"
|
156 |
msgstr "Adres"
|
157 |
|
158 |
+
#: settings-page.php:106
|
159 |
msgid "Actions"
|
160 |
msgstr "Acties"
|
161 |
|
162 |
+
#: settings-page.php:120
|
163 |
msgid "Unblock"
|
164 |
msgstr "Deblokkeren"
|
165 |
|
167 |
msgid "Brute Force Login Protection"
|
168 |
msgstr "Brute Force Login Protection"
|
169 |
|
170 |
+
#. Plugin URI of the plugin/theme
|
171 |
+
msgid "http://wordpress.org/plugins/brute-force-login-protection/"
|
172 |
+
msgstr "http://wordpress.org/plugins/brute-force-login-protection/"
|
173 |
+
|
174 |
#. Description of the plugin/theme
|
175 |
msgid "Protects your website against brute force login attacks using .htaccess"
|
176 |
msgstr ""
|
180 |
#. Author of the plugin/theme
|
181 |
msgid "Jan-Paul Kleemans"
|
182 |
msgstr "Jan-Paul Kleemans"
|
183 |
+
|
184 |
+
#. Author URI of the plugin/theme
|
185 |
+
msgid "http://profiles.wordpress.org/jan-paul-kleemans/"
|
186 |
+
msgstr "http://profiles.wordpress.org/jan-paul-kleemans/"
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Jan-Paul Kleemans
|
|
3 |
Tags: brute force, bruteforce, login, wp-login, protection, shield, security, htaccess, block, ip
|
4 |
Requires at least: 2.7.0
|
5 |
Tested up to: 3.9.1
|
6 |
-
Stable tag: 1.
|
7 |
License: GPL2
|
8 |
|
9 |
Protects your website against brute force login attacks using .htaccess
|
@@ -18,6 +18,7 @@ Features
|
|
18 |
* Limit the number of allowed login attempts
|
19 |
* Manually block IP addresses
|
20 |
* Manually unblock IP addresses
|
|
|
21 |
|
22 |
Your feedback is highly appreciated!
|
23 |
|
@@ -29,8 +30,8 @@ Your feedback is highly appreciated!
|
|
29 |
|
30 |
== Frequently Asked Questions ==
|
31 |
= My own IP is blocked, what do I do? =
|
32 |
-
If you have FTP access to your website edit the .htaccess file and remove the line:
|
33 |
-
If you don
|
34 |
|
35 |
= I get an error: .htaccess file not readable/writeable =
|
36 |
Brute Force Login Protection will only work if your .htaccess file is writeable by WordPress. If you get this error, make sure that your .htaccess file has read and write permissions.
|
@@ -39,6 +40,11 @@ Brute Force Login Protection will only work if your .htaccess file is writeable
|
|
39 |
1. Plugin settings page
|
40 |
|
41 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
42 |
= 1.1 =
|
43 |
* Added Dutch translation
|
44 |
|
3 |
Tags: brute force, bruteforce, login, wp-login, protection, shield, security, htaccess, block, ip
|
4 |
Requires at least: 2.7.0
|
5 |
Tested up to: 3.9.1
|
6 |
+
Stable tag: 1.2
|
7 |
License: GPL2
|
8 |
|
9 |
Protects your website against brute force login attacks using .htaccess
|
18 |
* Limit the number of allowed login attempts
|
19 |
* Manually block IP addresses
|
20 |
* Manually unblock IP addresses
|
21 |
+
* Option to inform user about remaining attempts on login page
|
22 |
|
23 |
Your feedback is highly appreciated!
|
24 |
|
30 |
|
31 |
== Frequently Asked Questions ==
|
32 |
= My own IP is blocked, what do I do? =
|
33 |
+
If you have FTP access to your website edit the .htaccess file and remove the line: 'deny from x.x.x.x', where x.x.x.x is your own IP address.
|
34 |
+
If you don't have FTP access, the only way to unblock your IP is to log in your WordPress admin panel from another IP address and unblock it via the plugin settings page.
|
35 |
|
36 |
= I get an error: .htaccess file not readable/writeable =
|
37 |
Brute Force Login Protection will only work if your .htaccess file is writeable by WordPress. If you get this error, make sure that your .htaccess file has read and write permissions.
|
40 |
1. Plugin settings page
|
41 |
|
42 |
== Changelog ==
|
43 |
+
= 1.2 =
|
44 |
+
* Option to inform user about remaining attempts on login page
|
45 |
+
* Ability to reset options
|
46 |
+
* Status panel on the settings page
|
47 |
+
|
48 |
= 1.1 =
|
49 |
* Added Dutch translation
|
50 |
|
settings-page.php
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
<style type="text/css">
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
.brute-force-login-protection .postbox-footer{
|
3 |
padding:10px;
|
4 |
clear:both;
|
@@ -10,10 +16,49 @@
|
|
10 |
}
|
11 |
</style>
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
<div class="wrap brute-force-login-protection">
|
14 |
<h2><?php _e('Brute Force Login Protection Settings', 'brute-force-login-protection'); ?></h2>
|
15 |
|
16 |
<div class="metabox-holder">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<div class="postbox">
|
18 |
<h3><?php _e('Options', 'brute-force-login-protection'); ?></h3>
|
19 |
<form method="post" action="options.php">
|
@@ -25,11 +70,15 @@
|
|
25 |
<p><strong><?php _e('Minutes before resetting login attempts count', 'brute-force-login-protection'); ?></strong></p>
|
26 |
<p><input type="number" min="1" name="bflp_reset_time" value="<?php echo $this->__options['reset_time']; ?>" /></p>
|
27 |
|
|
|
|
|
|
|
28 |
<p><strong><?php _e('.htaccess file location', 'brute-force-login-protection'); ?></strong></p>
|
29 |
<p><input type="text" size="50" name="bflp_htaccess_dir" value="<?php echo $this->__options['htaccess_dir']; ?>" /></p>
|
30 |
</div>
|
31 |
<div class="postbox-footer">
|
32 |
-
<?php submit_button(__('Save', 'brute-force-login-protection'), 'primary', 'submit', false);
|
|
|
33 |
</div>
|
34 |
</form>
|
35 |
</div>
|
@@ -78,4 +127,8 @@
|
|
78 |
?>
|
79 |
</tbody>
|
80 |
</table>
|
|
|
|
|
|
|
|
|
81 |
</div>
|
1 |
<style type="text/css">
|
2 |
+
.brute-force-login-protection .status-yes{
|
3 |
+
color:#27ae60;
|
4 |
+
}
|
5 |
+
.brute-force-login-protection .status-no{
|
6 |
+
color:#cd3d2e;
|
7 |
+
}
|
8 |
.brute-force-login-protection .postbox-footer{
|
9 |
padding:10px;
|
10 |
clear:both;
|
16 |
}
|
17 |
</style>
|
18 |
|
19 |
+
<script type="text/javascript">
|
20 |
+
function ResetOptions() {
|
21 |
+
if (confirm("<?php _e('Are you sure you want to reset all options?', 'brute-force-login-protection'); ?>")) {
|
22 |
+
document.forms["reset_form"].submit();
|
23 |
+
}
|
24 |
+
}
|
25 |
+
</script>
|
26 |
+
|
27 |
<div class="wrap brute-force-login-protection">
|
28 |
<h2><?php _e('Brute Force Login Protection Settings', 'brute-force-login-protection'); ?></h2>
|
29 |
|
30 |
<div class="metabox-holder">
|
31 |
+
<div class="postbox">
|
32 |
+
<?php $status = $this->__checkRequirements(); ?>
|
33 |
+
<h3>
|
34 |
+
<?php _e('Status', 'brute-force-login-protection'); ?>
|
35 |
+
<?php if (in_array(false, $status)): ?>
|
36 |
+
<span class="dashicons dashicons-no status-no"></span><small class="status-no"><?php _e('You are not protected!', 'brute-force-login-protection'); ?></small>
|
37 |
+
<?php else: ?>
|
38 |
+
<span class="dashicons dashicons-yes status-yes"></span><small class="status-yes"><?php _e('You are protected!', 'brute-force-login-protection'); ?></small>
|
39 |
+
<?php endif; ?>
|
40 |
+
</h3>
|
41 |
+
<div class="inside">
|
42 |
+
<?php if ($status['found']): ?>
|
43 |
+
<span class="dashicons dashicons-yes status-yes"></span> <strong><?php _e('.htaccess file found', 'brute-force-login-protection'); ?></strong>
|
44 |
+
<?php else: ?>
|
45 |
+
<span class="dashicons dashicons-no status-no"></span> <strong><?php _e('.htaccess file not found', 'brute-force-login-protection'); ?></strong>
|
46 |
+
<?php endif; ?>
|
47 |
+
<br />
|
48 |
+
<?php if ($status['readable']): ?>
|
49 |
+
<span class="dashicons dashicons-yes status-yes"></span> <strong><?php _e('.htaccess file readable', 'brute-force-login-protection'); ?></strong>
|
50 |
+
<?php else: ?>
|
51 |
+
<span class="dashicons dashicons-no status-no"></span> <strong><?php _e('.htaccess file not readable', 'brute-force-login-protection'); ?></strong>
|
52 |
+
<?php endif; ?>
|
53 |
+
<br />
|
54 |
+
<?php if ($status['writeable']): ?>
|
55 |
+
<span class="dashicons dashicons-yes status-yes"></span> <strong><?php _e('.htaccess file writeable', 'brute-force-login-protection'); ?></strong>
|
56 |
+
<?php else: ?>
|
57 |
+
<span class="dashicons dashicons-no status-no"></span> <strong><?php _e('.htaccess file not writeable', 'brute-force-login-protection'); ?></strong>
|
58 |
+
<?php endif; ?>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
<div class="postbox">
|
63 |
<h3><?php _e('Options', 'brute-force-login-protection'); ?></h3>
|
64 |
<form method="post" action="options.php">
|
70 |
<p><strong><?php _e('Minutes before resetting login attempts count', 'brute-force-login-protection'); ?></strong></p>
|
71 |
<p><input type="number" min="1" name="bflp_reset_time" value="<?php echo $this->__options['reset_time']; ?>" /></p>
|
72 |
|
73 |
+
<p><strong><?php _e('Inform user about remaining login attempts on login page', 'brute-force-login-protection'); ?></strong></p>
|
74 |
+
<p><input type="checkbox" name="bflp_inform_user" value="true" <?php echo ($this->__options['inform_user']) ? 'checked' : ''; ?> /></p>
|
75 |
+
|
76 |
<p><strong><?php _e('.htaccess file location', 'brute-force-login-protection'); ?></strong></p>
|
77 |
<p><input type="text" size="50" name="bflp_htaccess_dir" value="<?php echo $this->__options['htaccess_dir']; ?>" /></p>
|
78 |
</div>
|
79 |
<div class="postbox-footer">
|
80 |
+
<?php submit_button(__('Save', 'brute-force-login-protection'), 'primary', 'submit', false); ?>
|
81 |
+
<a href="javascript:ResetOptions()" class="button"><?php _e('Reset', 'brute-force-login-protection'); ?></a>
|
82 |
</div>
|
83 |
</form>
|
84 |
</div>
|
127 |
?>
|
128 |
</tbody>
|
129 |
</table>
|
130 |
+
|
131 |
+
<form id="reset_form" method="post" action="">
|
132 |
+
<input type="hidden" name="reset" value="true" />
|
133 |
+
</form>
|
134 |
</div>
|