Version Description
- Add readme.txt and screenshots
- Add in-line documentation for php functions
=
Download this release
Release Info
Developer | dgewirtz |
Plugin | My Private Site |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- jonradio-private-site.php +58 -0
- readme.txt +53 -0
- screenshot-1.jpg +0 -0
jonradio-private-site.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: jonradio Private Site
|
4 |
+
Plugin URI: http://zatzlabs.com/plugins/
|
5 |
+
Description: Removes visibility of site, by forcing login before any content can be viewed.
|
6 |
+
Version: 1.0
|
7 |
+
Author: David Gewirtz
|
8 |
+
Author URI: http://zatzlabs.com/plugins/
|
9 |
+
License: GPLv2
|
10 |
+
*/
|
11 |
+
|
12 |
+
/* Copyright 2012 jonradio (email : info@zatz.com)
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
add_action( 'login_init', 'jr_ps_login' );
|
30 |
+
add_action( 'wp_head', 'jr_ps_force_login' );
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Login Detection
|
34 |
+
*
|
35 |
+
* Set a global variable, $jr_ps_is_login, whenever a login occurs
|
36 |
+
*
|
37 |
+
* @return NULL Nothing is returned
|
38 |
+
*/
|
39 |
+
function jr_ps_login() {
|
40 |
+
global $jr_ps_is_login;
|
41 |
+
$jr_ps_is_login = TRUE;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Present a login screen to anyone not logged in
|
46 |
+
*
|
47 |
+
* Check for Admin, already logged in, or just logged in
|
48 |
+
*
|
49 |
+
* @return NULL Nothing is returned
|
50 |
+
*/
|
51 |
+
function jr_ps_force_login() {
|
52 |
+
global $jr_ps_is_login;
|
53 |
+
if ( !is_user_logged_in() && !isset( $jr_ps_is_login ) && !is_admin() ) {
|
54 |
+
auth_redirect();
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
?>
|
readme.txt
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== jonradio Private Site ===
|
2 |
+
Contributors: dgewirtz
|
3 |
+
Donate link: http://zatzlabs.com/plugins/
|
4 |
+
Tags: login, visibility, private, security, plugin, pages, page, posts, post
|
5 |
+
Requires at least: 3.0
|
6 |
+
Tested up to: 3.4
|
7 |
+
Stable tag: 1.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
The WordPress site, including all Pages and Posts, will not be visible to visitors unless they have logged in with a valid Username and Password.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
After this plugin is activated, and until it is deactivated or its main plugin file removed, site visitors will be forced to login before they will be able to see any content on the WordPress site.
|
16 |
+
|
17 |
+
If a WordPress Network is defined, the plugin can be activated individually for select sites. Or Network Activated, in which case all sites in the Network will require user login before any content will become visible.
|
18 |
+
|
19 |
+
Login prompts are provided whenever a non-logged in user ("site visitor") attempts to access any URL controlled by WordPress on the web site. This plugin does not control non-WordPress web pages, such as .html and .php files created by hand or by other software products.
|
20 |
+
|
21 |
+
Yes, there are other plugins that hide all WordPress content for any site visitor who is not logged on. But when I was searching for a solution for one of the web sites I support, I decided to "write my own" because I knew how it worked and felt comfortable that there would be no way for anyone not logged in to view the site, including Search Engines.
|
22 |
+
|
23 |
+
== Installation ==
|
24 |
+
|
25 |
+
This section describes how to install the plugin and get it working.
|
26 |
+
|
27 |
+
1. Use "Add Plugin" within the WordPress Admin panel to download and install this plugin from the WordPress.org plugin repository (preferred method). Or download and unzip this plugin, then upload the `/jonradio-private-site/` directory to your WordPress web site's `/wp-content/plugins/` directory
|
28 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress. If you have a WordPress Network ("Multisite"), you can either Network Activate this plugin, or Activate it individually on the sites where you wish to use it. Activating on individual sites within a Network avoids some of the confusion created by WordPress' hiding of Network Activated plugins on the Plugin menu of individual sites.
|
29 |
+
|
30 |
+
== Frequently Asked Questions ==
|
31 |
+
|
32 |
+
= Where is the Settings page? =
|
33 |
+
|
34 |
+
There are no Settings. To make your site private, simply Activate the Plugin. To make your site public, either Deactivate the Plugin or, if you are unable to Deactivate the Plugin, delete the wp-content/plugins/jonradio-private-site directory.
|
35 |
+
|
36 |
+
= In a WordPress Network (Multisite) installation, how do make only some sites Private? =
|
37 |
+
|
38 |
+
Do not Network Activate this plugin. Instead, Activate it on each site individually, using the Admin panel for each site, not the Network Admin panel.
|
39 |
+
|
40 |
+
== Screenshots ==
|
41 |
+
|
42 |
+
1. Login Prompt site visitor will see when attempting to access web site
|
43 |
+
|
44 |
+
== Changelog ==
|
45 |
+
|
46 |
+
= 1.0 =
|
47 |
+
* Add readme.txt and screenshots
|
48 |
+
* Add in-line documentation for php functions
|
49 |
+
|
50 |
+
== Upgrade Notice ==
|
51 |
+
|
52 |
+
= 1.0 =
|
53 |
+
Production version, updated to meet WordPress Repository standards
|
screenshot-1.jpg
ADDED
Binary file
|