Restricted Site Access - Version 1.0.1

Version Description

Download this release

Release Info

Developer jakemgold
Plugin Icon 128x128 Restricted Site Access
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

Files changed (2) hide show
  1. readme.txt +9 -1
  2. restricted_site_access.php +5 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.cmurrayconsulting.com/software/wordpress-restricted-site
4
  Tags: restricted, limited, permissions, security
5
  Requires at least: 2.8
6
  Tested up to: 2.8.4
7
- Stable tag: 1.0
8
 
9
  Limit access to your site to visitors who are logged in or accessing the site from a set of specific IP addresses.
10
  Send restricted visitors to the log in page, redirect them, or display a message. Powerful control over
@@ -27,6 +27,10 @@ It includes an easy to use configuration panel inside the WordPress settings men
27
  5. Control the redirect location.
28
  6. Choose to redirect visitors to the same path that they entered the current site on
29
  7. Choose the HTTP redirect message for SEO friendliness
 
 
 
 
30
 
31
 
32
  == Installation ==
@@ -42,6 +46,10 @@ folder to the `/wp-content/plugins/` directory
42
  1. Sceenshot of configuration page.
43
 
44
 
 
 
 
 
45
  == Coming soon ==
46
 
47
  Planned enhancements:
4
  Tags: restricted, limited, permissions, security
5
  Requires at least: 2.8
6
  Tested up to: 2.8.4
7
+ Stable tag: 1.0.1
8
 
9
  Limit access to your site to visitors who are logged in or accessing the site from a set of specific IP addresses.
10
  Send restricted visitors to the log in page, redirect them, or display a message. Powerful control over
27
  5. Control the redirect location.
28
  6. Choose to redirect visitors to the same path that they entered the current site on
29
  7. Choose the HTTP redirect message for SEO friendliness
30
+
31
+ *1.01 is an important update* that improves the fundamental logic pertaining to which areas of the site are restricted.
32
+ The old approach had several subtle, but problematic side effects, which could include blocking scheduled (cron)
33
+ events, not passing the "entry" permalink correctly, and similar subtle issues.
34
 
35
 
36
  == Installation ==
46
  1. Sceenshot of configuration page.
47
 
48
 
49
+ == Changelog ==
50
+
51
+ v1.01 - Important fundamental change related to handling of what should be restricted
52
+
53
  == Coming soon ==
54
 
55
  Planned enhancements:
restricted_site_access.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Restricted Site Access
4
  Plugin URI: http://www.cmurrayconsulting.com/software/wordpress-restricted-site-access/
5
  Description: <strong>Limit access your site</strong> to visitors who are logged in or accessing the site from a set of specific IP addresses. Send restricted visitors to the log in page, redirect them, or display a message. <strong>Powerful control over redirection</strong>, with option to send to same path and send <strong>SEO friendly redirect headers</strong>. Great solution for Extranets, publicly hosted Intranets, or parallel development sites.
6
- Version: 1.0
7
  Author: Jacob M Goldman (C. Murray Consulting)
8
  Author URI: http://www.cmurrayconsulting.com
9
 
@@ -58,7 +58,9 @@ if(is_admin()) add_filter("plugin_action_links_".$plugin, 'rsa_plugin_actlinks'
58
 
59
  function restricted_site_access() {
60
  //logged in users can stay, can stay if plug-in not active
61
- if (is_user_logged_in() || get_option('rsa_is_active') != 1 || strstr($_SERVER['REQUEST_URI'],"wp-login.php")) return false;
 
 
62
  //check if the IP is allowed
63
  if (strstr(get_option('rsa_allowed_ips'),$_SERVER['REMOTE_ADDR'])) return false;
64
 
@@ -87,7 +89,7 @@ function restricted_site_access() {
87
  exit("Access to this site is restricted.");
88
  }
89
  }
90
- if(!is_admin()) add_action('init','restricted_site_access');
91
 
92
  //************************//
93
  //** ADMIN CONTROL PANEL *//
3
  Plugin Name: Restricted Site Access
4
  Plugin URI: http://www.cmurrayconsulting.com/software/wordpress-restricted-site-access/
5
  Description: <strong>Limit access your site</strong> to visitors who are logged in or accessing the site from a set of specific IP addresses. Send restricted visitors to the log in page, redirect them, or display a message. <strong>Powerful control over redirection</strong>, with option to send to same path and send <strong>SEO friendly redirect headers</strong>. Great solution for Extranets, publicly hosted Intranets, or parallel development sites.
6
+ Version: 1.0.1
7
  Author: Jacob M Goldman (C. Murray Consulting)
8
  Author URI: http://www.cmurrayconsulting.com
9
 
58
 
59
  function restricted_site_access() {
60
  //logged in users can stay, can stay if plug-in not active
61
+ if (is_user_logged_in() || get_option('rsa_is_active') != 1) return false;
62
+ //if we're not on a front end page, stay put
63
+ if (!is_singular() && !is_archive() && !is_feed() && !is_home()) return false;
64
  //check if the IP is allowed
65
  if (strstr(get_option('rsa_allowed_ips'),$_SERVER['REMOTE_ADDR'])) return false;
66
 
89
  exit("Access to this site is restricted.");
90
  }
91
  }
92
+ if(!is_admin()) add_action('wp','restricted_site_access');
93
 
94
  //************************//
95
  //** ADMIN CONTROL PANEL *//