Skip to content

Commit

Permalink
Merge branch 'release/2.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
benhuson committed Feb 22, 2019
2 parents 49549c6 + 0a961cb commit 29c4b2f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [2.2.4] - 2019-02-22

### Fixed
Check that `$_SERVER['REMOTE_ADDR']` is set.

## [2.2.3] - 2019-01-10

### Fixed
Expand Down Expand Up @@ -212,7 +217,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- First Release. If you spot any bugs or issues please [log them here](https://github.com/benhuson/password-protected/issues).

[Unreleased]: https://github.com/benhuson/password-protected/compare/2.2.3...HEAD
[Unreleased]: https://github.com/benhuson/password-protected/compare/2.2.4...HEAD
[2.2.4]: https://github.com/benhuson/password-protected/compare/2.2.3...2.2.4
[2.2.3]: https://github.com/benhuson/password-protected/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/benhuson/password-protected/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/benhuson/password-protected/compare/2.2...2.2.1
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ More instructions can be found at [wp-translations.org](http://wp-translations.o
Upgrade Notice
--------------

### 2.2.4
Check that `$_SERVER['REMOTE_ADDR']` is set.

### 2.2.3
Restrict REST-API-access only if password protection is active. Added viewport meta tag to login page.

Expand Down
7 changes: 6 additions & 1 deletion admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ public function password_protected_password_field() {
public function password_protected_allowed_ip_addresses_field() {

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>';
echo '<p class="description">' . esc_html__( 'Enter one IP address per line.', 'password-protected' ) . ' ' . esc_html( sprintf( __( 'Your IP is address %s.', 'password-protected' ), $_SERVER['REMOTE_ADDR'] ) ) . '</p>';

echo '<p class="description">' . esc_html__( 'Enter one IP address per line.', 'password-protected' );
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
echo ' ' . esc_html( sprintf( __( 'Your IP is address %s.', 'password-protected' ), $_SERVER['REMOTE_ADDR'] ) );
}
echo '</p>';

}

Expand Down
6 changes: 3 additions & 3 deletions password-protected.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Password Protected
Plugin URI: https://wordpress.org/plugins/password-protected/
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.
Version: 2.2.3
Version: 2.2.4
Author: Ben Huson
Text Domain: password-protected
Author URI: http://github.com/benhuson/password-protected/
Expand Down Expand Up @@ -42,7 +42,7 @@

class Password_Protected {

var $version = '2.2.3';
var $version = '2.2.4';
var $admin = null;
var $errors = null;

Expand Down Expand Up @@ -226,7 +226,7 @@ public function allow_ip_addresses( $bool ) {

$ip_addresses = $this->get_allowed_ip_addresses();

if ( in_array( $_SERVER['REMOTE_ADDR'], $ip_addresses ) ) {
if ( isset( $_SERVER['REMOTE_ADDR'] ) && in_array( $_SERVER['REMOTE_ADDR'], $ip_addresses ) ) {
$bool = false;
}

Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: husobj
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DXRJDNCMK9U3N
Tags: password, protect, password protect, login
Requires at least: 3.9
Tested up to: 4.9.6
Tested up to: 5.1
Requires PHP: 5.6
Stable tag: 2.2.3
Stable tag: 2.2.4
License: GPLv2 or later

A very simple way to quickly password protect your WordPress site with a single password.
Expand Down Expand Up @@ -82,6 +82,9 @@ More instructions can be found at [wp-translations.org](http://wp-translations.o

== Changelog ==

= 2.2.4 =
- Check that `$_SERVER['REMOTE_ADDR']` is set.

= 2.2.3 =
- Restrict REST-API-access only if password protection is active.
- Added viewport meta tag to login page.
Expand Down

0 comments on commit 29c4b2f

Please sign in to comment.