Force Login - Version 1.2

Version Description

  • Streamlined code
Download this release

Release Info

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

Code changes from version 1.1 to 1.2

Files changed (2) hide show
  1. readme.txt +8 -3
  2. wp-force-login.php +4 -3
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Force Login ===
2
  Contributors: kevinvess
3
- Tags: force user login, login, private, privacy, protected, hidden
 
4
  Requires at least: 3.6
5
- Tested up to: 3.9.1
6
- Stable tag: 1.1
7
  License: GPLv2 or later
8
 
9
  Force Login is a simple lightweight plugin that requires visitors to log in to interact with the website.
@@ -22,6 +23,10 @@ Upload the Force Login plugin to your site, then Activate it.
22
 
23
  == Changelog ==
24
 
 
 
 
 
25
  = 1.1 =
26
 
27
  * Whitelisted the Registration page and the Lost Password page - props [jabdo](http://profiles.wordpress.org/jabdo).
1
  === Force Login ===
2
  Contributors: kevinvess
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kevin%40vess%2eme&lc=US&item_name=Kevin%20Vess%20-%20WordPress&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
+ Tags: access, closed, force user login, hidden, login, password, privacy, private, protected, registered only, restricted
5
  Requires at least: 3.6
6
+ Tested up to: 4.0
7
+ Stable tag: 1.2
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.
23
 
24
  == Changelog ==
25
 
26
+ = 1.2 =
27
+
28
+ * Streamlined code
29
+
30
  = 1.1 =
31
 
32
  * Whitelisted the Registration page and the Lost Password page - props [jabdo](http://profiles.wordpress.org/jabdo).
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.1
7
  Author: Kevin Vess
8
  Author URI: http://vess.me/
9
  License: GPLv2 or later
@@ -31,9 +31,10 @@ function v_getUrl() {
31
  return $url;
32
  }
33
  function v_forcelogin() {
34
- if( !is_user_logged_in() && ( v_getUrl() != wp_login_url() && v_getUrl() != wp_registration_url() && v_getUrl() != wp_lostpassword_url() ) ) {
 
35
  wp_redirect( wp_login_url(), 302 );
36
  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: 1.2
7
  Author: Kevin Vess
8
  Author URI: http://vess.me/
9
  License: GPLv2 or later
31
  return $url;
32
  }
33
  function v_forcelogin() {
34
+ $url = v_getUrl();
35
+ if( !is_user_logged_in() && ( $url != wp_login_url() && $url != wp_registration_url() && $url != wp_lostpassword_url() ) ) {
36
  wp_redirect( wp_login_url(), 302 );
37
  exit();
38
  }
39
  }
40
+ add_action('init', 'v_forcelogin');