From 4da345bdda873d571b02c2251788647335ba1029 Mon Sep 17 00:00:00 2001 From: Ben Huson Date: Sat, 26 May 2018 21:38:39 +0100 Subject: [PATCH 1/2] Fix setting of default expiration time. Signed-off-by: Ben Huson --- password-protected.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/password-protected.php b/password-protected.php index f0e5e60..4ca1614 100644 --- a/password-protected.php +++ b/password-protected.php @@ -605,7 +605,7 @@ public function set_auth_cookie( $remember = false, $secure = '') { $expiration_time = apply_filters( 'password_protected_auth_cookie_expiration', get_option( 'password_protected_remember_me_lifetime', 14 ) * DAY_IN_SECONDS, $remember ); $expiration = $expire = current_time( 'timestamp' ) + $expiration_time; } else { - $expiration_time + apply_filters( 'password_protected_auth_cookie_expiration', DAY_IN_SECONDS * 20, $remember ); + $expiration_time = apply_filters( 'password_protected_auth_cookie_expiration', DAY_IN_SECONDS * 20, $remember ); $expiration = current_time( 'timestamp' ) + $expiration_time; $expire = 0; } From b9812c7686bf8b379b2ed1930460be8f77a43c05 Mon Sep 17 00:00:00 2001 From: Ben Huson Date: Sun, 27 May 2018 14:40:56 +0100 Subject: [PATCH 2/2] Version 2.2.1 Signed-off-by: Ben Huson --- CHANGELOG.md | 8 +++++++- README.md | 3 +++ password-protected.php | 4 ++-- readme.txt | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a362d4b..c8db249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [2.2.1] - 2018-05-27 + +### Fixed +- Fixed PHP error when calculating cookie expiration date. + ## [2.2] - 2018-05-25 ### Added @@ -186,7 +191,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...HEAD +[Unreleased]: https://github.com/benhuson/password-protected/compare/2.2.1...HEAD +[2.2.1]: https://github.com/benhuson/password-protected/compare/2.2...2.2.1 [2.2]: https://github.com/benhuson/password-protected/compare/2.1...2.2 [2.1]: https://github.com/benhuson/password-protected/compare/2.0.3...2.1 [2.0.3]: https://github.com/benhuson/password-protected/compare/2.0.2...2.0.3 diff --git a/README.md b/README.md index c598a11..f95fdb3 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ More instructions can be found at [wp-translations.org](http://wp-translations.o Upgrade Notice -------------- +### 2.2.1 +Fixed PHP error when calculating cookie expiration date. + ### 2.2 Added admin bar icon to indicate wether password protection is enabled/disabled. Options to enable REST API access and show "Remember me" checkbox. diff --git a/password-protected.php b/password-protected.php index 4ca1614..8c86477 100644 --- a/password-protected.php +++ b/password-protected.php @@ -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 +Version: 2.2.1 Author: Ben Huson Text Domain: password-protected Author URI: http://github.com/benhuson/password-protected/ @@ -42,7 +42,7 @@ class Password_Protected { - var $version = '2.2'; + var $version = '2.2.1'; var $admin = null; var $errors = null; diff --git a/readme.txt b/readme.txt index 4d312ab..b2cc09e 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: password, protect, password protect, login Requires at least: 3.9 Tested up to: 4.9.6 Requires PHP: 5.6 -Stable tag: 2.2 +Stable tag: 2.2.1 License: GPLv2 or later 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 == Changelog == += 2.2.1 = +* Fixed PHP error when calculating cookie expiration date. + = 2.2 = * Added admin bar icon to indicate wether password protection is enabled/disabled. * Option to show "Remember me" checkbox. Props [Christian Güdel](https://github.com/cguedel).