Force Login - Version 2.0

Version Description

  • Added redirect to send user to the url they tried to visit after logging in.
Download this release

Release Info

Developer kevinvess
Plugin Icon 128x128 Force Login
Version 2.0
Comparing to
See all releases

Code changes from version 1.3 to 2.0

Files changed (2) hide show
  1. readme.txt +7 -1
  2. wp-force-login.php +2 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kevin
4
  Tags: access, closed, force user login, hidden, login, password, privacy, private, protected, registered only, restricted
5
  Requires at least: 2.7
6
  Tested up to: 4.0
7
- Stable tag: 1.3
8
  License: GPLv2 or later
9
 
10
  Force Login is a simple lightweight plugin that requires visitors to log in to interact with the website.
@@ -26,6 +26,9 @@ Upload the Force Login plugin to your site, then Activate it.
26
 
27
  == Changelog ==
28
 
 
 
 
29
  = 1.3 =
30
  * Fixed password reset url from being blocked - props [estebillan](http://profiles.wordpress.org/estebillan).
31
 
@@ -38,5 +41,8 @@ Upload the Force Login plugin to your site, then Activate it.
38
 
39
  == Upgrade Notice ==
40
 
 
 
 
41
  = 1.3 =
42
  Fixes bug with password reset url from being blocked. Props estebillan.
4
  Tags: access, closed, force user login, hidden, login, password, privacy, private, protected, registered only, restricted
5
  Requires at least: 2.7
6
  Tested up to: 4.0
7
+ Stable tag: 2.0
8
  License: GPLv2 or later
9
 
10
  Force Login is a simple lightweight plugin that requires visitors to log in to interact with the website.
26
 
27
  == Changelog ==
28
 
29
+ = 2.0 =
30
+ * Added redirect to send user to the url they tried to visit after logging in.
31
+
32
  = 1.3 =
33
  * Fixed password reset url from being blocked - props [estebillan](http://profiles.wordpress.org/estebillan).
34
 
41
 
42
  == Upgrade Notice ==
43
 
44
+ = 2.0 =
45
+ New feature: added redirect to send user to the url they tried to visit after logging in.
46
+
47
  = 1.3 =
48
  Fixes bug with password reset url from being blocked. Props estebillan.
wp-force-login.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Force Login
4
  Plugin URI: http://vess.me/
5
  Description: Easily hide your WordPress site from public viewing by requiring visitors to log in first. Activate to turn on.
6
- Version: 1.3
7
  Author: Kevin Vess
8
  Author URI: http://vess.me/
9
  License: GPLv2 or later
@@ -33,7 +33,7 @@ function v_getUrl() {
33
  function v_forcelogin() {
34
  $url = v_getUrl();
35
  if( !is_user_logged_in() && preg_replace('/\?.*/', '', $url) != preg_replace('/\?.*/', '', wp_login_url()) ) {
36
- wp_safe_redirect( wp_login_url(), 302 ); exit();
37
  }
38
  }
39
  add_action('init', 'v_forcelogin');
3
  Plugin Name: Force Login
4
  Plugin URI: http://vess.me/
5
  Description: Easily hide your WordPress site from public viewing by requiring visitors to log in first. Activate to turn on.
6
+ Version: 2.0
7
  Author: Kevin Vess
8
  Author URI: http://vess.me/
9
  License: GPLv2 or later
33
  function v_forcelogin() {
34
  $url = v_getUrl();
35
  if( !is_user_logged_in() && preg_replace('/\?.*/', '', $url) != preg_replace('/\?.*/', '', wp_login_url()) ) {
36
+ wp_safe_redirect( wp_login_url( $url ), 302 ); exit();
37
  }
38
  }
39
  add_action('init', 'v_forcelogin');