Version Description
- Check that
$_SERVER['REMOTE_ADDR']
is set.
Download this release
Release Info
Developer | husobj |
Plugin | Password Protected |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.3 to 2.2.4
- CHANGELOG.md +7 -1
- README.md +3 -0
- admin/admin.php +6 -1
- password-protected.php +3 -3
- readme.txt +5 -2
CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4 |
|
5 |
## [Unreleased]
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
## [2.2.3] - 2019-01-10
|
8 |
|
9 |
### Fixed
|
@@ -212,7 +217,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
212 |
### Added
|
213 |
- First Release. If you spot any bugs or issues please [log them here](https://github.com/benhuson/password-protected/issues).
|
214 |
|
215 |
-
[Unreleased]: https://github.com/benhuson/password-protected/compare/2.2.
|
|
|
216 |
[2.2.3]: https://github.com/benhuson/password-protected/compare/2.2.2...2.2.3
|
217 |
[2.2.2]: https://github.com/benhuson/password-protected/compare/2.2.1...2.2.2
|
218 |
[2.2.1]: https://github.com/benhuson/password-protected/compare/2.2...2.2.1
|
4 |
|
5 |
## [Unreleased]
|
6 |
|
7 |
+
## [2.2.4] - 2019-02-22
|
8 |
+
|
9 |
+
### Fixed
|
10 |
+
Check that `$_SERVER['REMOTE_ADDR']` is set.
|
11 |
+
|
12 |
## [2.2.3] - 2019-01-10
|
13 |
|
14 |
### Fixed
|
217 |
### Added
|
218 |
- First Release. If you spot any bugs or issues please [log them here](https://github.com/benhuson/password-protected/issues).
|
219 |
|
220 |
+
[Unreleased]: https://github.com/benhuson/password-protected/compare/2.2.4...HEAD
|
221 |
+
[2.2.4]: https://github.com/benhuson/password-protected/compare/2.2.3...2.2.4
|
222 |
[2.2.3]: https://github.com/benhuson/password-protected/compare/2.2.2...2.2.3
|
223 |
[2.2.2]: https://github.com/benhuson/password-protected/compare/2.2.1...2.2.2
|
224 |
[2.2.1]: https://github.com/benhuson/password-protected/compare/2.2...2.2.1
|
README.md
CHANGED
@@ -71,6 +71,9 @@ More instructions can be found at [wp-translations.org](http://wp-translations.o
|
|
71 |
Upgrade Notice
|
72 |
--------------
|
73 |
|
|
|
|
|
|
|
74 |
### 2.2.3
|
75 |
Restrict REST-API-access only if password protection is active. Added viewport meta tag to login page.
|
76 |
|
71 |
Upgrade Notice
|
72 |
--------------
|
73 |
|
74 |
+
### 2.2.4
|
75 |
+
Check that `$_SERVER['REMOTE_ADDR']` is set.
|
76 |
+
|
77 |
### 2.2.3
|
78 |
Restrict REST-API-access only if password protection is active. Added viewport meta tag to login page.
|
79 |
|
admin/admin.php
CHANGED
@@ -283,7 +283,12 @@ class Password_Protected_Admin {
|
|
283 |
public function password_protected_allowed_ip_addresses_field() {
|
284 |
|
285 |
echo '<textarea name="password_protected_allowed_ip_addresses" id="password_protected_allowed_ip_addresses" rows="3" class="large-text" />' . get_option( 'password_protected_allowed_ip_addresses' ) . '</textarea>';
|
286 |
-
|
|
|
|
|
|
|
|
|
|
|
287 |
|
288 |
}
|
289 |
|
283 |
public function password_protected_allowed_ip_addresses_field() {
|
284 |
|
285 |
echo '<textarea name="password_protected_allowed_ip_addresses" id="password_protected_allowed_ip_addresses" rows="3" class="large-text" />' . get_option( 'password_protected_allowed_ip_addresses' ) . '</textarea>';
|
286 |
+
|
287 |
+
echo '<p class="description">' . esc_html__( 'Enter one IP address per line.', 'password-protected' );
|
288 |
+
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
|
289 |
+
echo ' ' . esc_html( sprintf( __( 'Your IP is address %s.', 'password-protected' ), $_SERVER['REMOTE_ADDR'] ) );
|
290 |
+
}
|
291 |
+
echo '</p>';
|
292 |
|
293 |
}
|
294 |
|
password-protected.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Password Protected
|
5 |
Plugin URI: https://wordpress.org/plugins/password-protected/
|
6 |
Description: A very simple way to quickly password protect your WordPress site with a single password. Please note: This plugin does not restrict access to uploaded files and images and does not work with some caching setups.
|
7 |
-
Version: 2.2.
|
8 |
Author: Ben Huson
|
9 |
Text Domain: password-protected
|
10 |
Author URI: http://github.com/benhuson/password-protected/
|
@@ -42,7 +42,7 @@ $Password_Protected = new Password_Protected();
|
|
42 |
|
43 |
class Password_Protected {
|
44 |
|
45 |
-
var $version = '2.2.
|
46 |
var $admin = null;
|
47 |
var $errors = null;
|
48 |
|
@@ -226,7 +226,7 @@ class Password_Protected {
|
|
226 |
|
227 |
$ip_addresses = $this->get_allowed_ip_addresses();
|
228 |
|
229 |
-
if ( in_array( $_SERVER['REMOTE_ADDR'], $ip_addresses ) ) {
|
230 |
$bool = false;
|
231 |
}
|
232 |
|
4 |
Plugin Name: Password Protected
|
5 |
Plugin URI: https://wordpress.org/plugins/password-protected/
|
6 |
Description: A very simple way to quickly password protect your WordPress site with a single password. Please note: This plugin does not restrict access to uploaded files and images and does not work with some caching setups.
|
7 |
+
Version: 2.2.4
|
8 |
Author: Ben Huson
|
9 |
Text Domain: password-protected
|
10 |
Author URI: http://github.com/benhuson/password-protected/
|
42 |
|
43 |
class Password_Protected {
|
44 |
|
45 |
+
var $version = '2.2.4';
|
46 |
var $admin = null;
|
47 |
var $errors = null;
|
48 |
|
226 |
|
227 |
$ip_addresses = $this->get_allowed_ip_addresses();
|
228 |
|
229 |
+
if ( isset( $_SERVER['REMOTE_ADDR'] ) && in_array( $_SERVER['REMOTE_ADDR'], $ip_addresses ) ) {
|
230 |
$bool = false;
|
231 |
}
|
232 |
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: husobj
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DXRJDNCMK9U3N
|
4 |
Tags: password, protect, password protect, login
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to:
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 2.2.
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
A very simple way to quickly password protect your WordPress site with a single password.
|
@@ -82,6 +82,9 @@ More instructions can be found at [wp-translations.org](http://wp-translations.o
|
|
82 |
|
83 |
== Changelog ==
|
84 |
|
|
|
|
|
|
|
85 |
= 2.2.3 =
|
86 |
- Restrict REST-API-access only if password protection is active.
|
87 |
- Added viewport meta tag to login page.
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DXRJDNCMK9U3N
|
4 |
Tags: password, protect, password protect, login
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 5.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.2.4
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
A very simple way to quickly password protect your WordPress site with a single password.
|
82 |
|
83 |
== Changelog ==
|
84 |
|
85 |
+
= 2.2.4 =
|
86 |
+
- Check that `$_SERVER['REMOTE_ADDR']` is set.
|
87 |
+
|
88 |
= 2.2.3 =
|
89 |
- Restrict REST-API-access only if password protection is active.
|
90 |
- Added viewport meta tag to login page.
|