Password Protected

Plugin version: 1.2
Requires WordPress version: 3.0
Tested up to WordPress version: 3.3.1
Download: Click here to download...

A very simple way to quickly password protect your WordPress site with a single password. Integrates seamlessly into your WordPress privacy settings.

Features include:

  • Password protect your WordPress site with a single password.
  • Integrates seamlessly into your WordPress privacy settings.
  • Works with Mark Jaquith’s Login Logo plugin.

Hooks & Filters

password_protected_login_head

This action lets you add content to the head of the login page. For example, you could add extra styles to include a background image by adding the following to your functions.php file. Note, use the CSS !important declaration to force your style to override a default WordPress style:

function my_password_protected_login_head() {
	echo '<style>
	body {
		background-image:url("' . get_stylesheet_directory_uri() . '/images/my-background-image.jpg") !important;
		background-repeat:no-repeat !important;
		background-position:top center !important;
	}
	</style>';
}
add_action( 'password_protected_login_head', 'my_password_protected_login_head' );

password_protected_wp_title

This filter lets you change the page title.

login_enqueue_scripts

This filter allows you to enqueue scripts for both the Password Protected login and main WordPress login pages.

password_protected_login_message

This filter allows you to display a login message.

password_protected_login_errors

This filter allows to to customise error messages.

password_protected_login_messages

This filter allows you to customise other messages

login_footer

This action allows you to add content to the HTML footer.

 

26 Responses to “Password Protected”

  1. Michael Lommel Says:

    Hi Ben —

    I’ve been using Password Protected for a client, but on IE8 it seems to keep bouncing them back every time they change url to the login page. Any idea what that might be? It’s an enterprise that has system wide browser settings, so checking to see that they have cookies enabled… otherwise, have you run across this?

    Thanks for the very helpful plugin —

  2. Ben Says:

    I haven’t run into this issue.
    Is it just IE8 in their enterprise setup that does this, or IE8 in general?

  3. John Says:

    Hi Ben
    I have installed your password protect on one of my blog sites and it works great, but I can not get an RSS feed from the site. How can I still get an RSS feed with the plugin active?

    John

  4. Daniel Says:

    Hey,
    works well for the main home page but if someone goes to one of the other pages, the password prompt doesn’t come up. Is this because ive already typed the password on the home page?
    Daniel

  5. Franklin Givens Says:

    I made a donation a few days ago but haven’t received any information to access the premium features. Am I missing something? How can I access the premium features?

  6. Ben Says:

    Daniel,

    Yes. When you try to access any page on the site it prompts you to enter a password. One you have entered a password a cookie is set so you don’t have to re-enter it on every page for the remainder of the session.

    If you want to protect specific pages use the main WordPress protected setting on individual posts.

  7. Ben Says:

    Franklin,

    This plugin has no premium features.

    Your donation is a donation to acknowledge your support for the un-paid time I spend developing the plugin and help to ensure the continued development of the plugin.

    I will happily arrange a refund if you feel you have been mis-lead

    Ben

  8. Ben Says:

    John,

    Putting the following code in your theme’s functions.php file might work. I’ve not tested it so let me know if it works:

    global $Password_Protected;
    if ( is_object( $Password_Protected ) ) {
    	remove_action( 'do_feed', array( $Password_Protected, 'disable_feed' ), 1 );
    	remove_action( 'do_feed_rdf', array( $Password_Protected, 'disable_feed' ), 1 );
    	remove_action( 'do_feed_rss', array( $Password_Protected, 'disable_feed' ), 1 );
    	remove_action( 'do_feed_rss2', array( $Password_Protected, 'disable_feed' ), 1 );
    	remove_action( 'do_feed_atom', array( $Password_Protected, 'disable_feed' ), 1 );
    }

    Ben

  9. Mattias Says:

    Hi!

    Can you in some way change the background color and the color of the login button? I am building a site and want the login page to match the site design.

    And thanks, this plugin is great!

  10. Ben Says:

    Matthias,
    The login page runs an action in the HTML that you can hook into to output addition styles (or anything else) in the header. Eg:

    function my_password_protected_login_head() {
    	// Do stuff here
    }
    add_action( 'password_protected_login_head', 'my_password_protected_login_head' );
  11. Marc Says:

    Hi,

    im stuggling with the password protect plugin. It works in that it asks for a password, but when someone selects ‘leave comment’ to one of my posts, it asks for a password again.

    you then reenter the password, and then the original page is displayed. So user selects ‘leave comment’ again, and it then asks for the password… and the cycle repeats.

    Have I missed some setting somewhere I need to tweak?

  12. Ben Says:

    Are you able to send me a link so I can see this happening. You can post it here or email me via my contact page.

  13. dave Says:

    What a slick little tool. Does it timeout if I touch nothing for a long enough period of time?
    I have been having a tough time with trying new plugins – they half the time crash my website and then folders need deleting. Your plugin is clean and reliable – thanks!

  14. Ben Says:

    At the moment it just stores it for the session but I need to move this over to using cookies to make it more reliable.

  15. Ben Says:

    @Marc I’ll look into that issue…

  16. Stephen Guy Says:

    Hi Ben
    Thanks very much for making available your Password Protect plug-in which perfectly fulfills my need for a simple password boundary to a members area situated on a separate site from the public site.

    But while it worked beautifully on a test site, for some baffling reason it is not on the actual site I’m developing. When I download the plug in and acitivate it (using a fresh WP install), it corrupts WP as you’ll see from looking at http://www.membersfpra.org.uk, to the extent I can’t even log in.

    I’ve asked the host company to check any server error and they just say its a coding/scripting issue. I also tried downloading it on another site and again it corrupted it.

    Any ideas about what is going on? I’d love to use this plug-in as there’s nothing else out that does the job so neatly. All comments appreciated.

    Cheers and thanks
    Stephen

  17. Ben Says:

    Stephen, I know there seems to few a few issues that may be session related as WordPress does not always seem to work well with sessions – although that is the first time I have seen that error.

    I’m currently rewriting it to use cookies instead which should be more reliable across different hosting setups.

  18. Stephen Guy Says:

    Dear Ben
    Thanks for the response, interesting about the sessions. I look forward to the rewritten version. But any idea when it will available?

    Cheers
    Stephen

  19. Ben Says:

    I hope to have some time available to rewrite it over the next week.

  20. Stephen Guy Says:

    Great stuff, thanx

  21. Cookie Monster Says:

    Love the Plugin!

    Only one request! Could you please make it remember the login with a cookie? :D

    Thanks!

    Derek

  22. Ben Says:

    I have an updated version in development now that uses cookies. At the moment the cookie is set to expire after an hour – needs a little more work…

    …but if you’d like to test it and provide me with any feedback that would be most appreciated.

    You can download the development version here…

  23. Ben Says:

    The development version at the link above is now fully using cookie if anyone wants to test it.

  24. Stephen Guy Says:

    Hi Ben

    Ta very much for the latest version, which so far is working perfectly. I’ll keep you posted as to any hiccups.

    Thanks again for a really neat programme.

  25. dedide Says:

    Hey Ben,
    thanx for the plugin. How could I modify it to return an informative error msg if users stuff up the password?

    Cheers

  26. Ben Says:

    @dedide

    I’ve added an issue and will try to get error messages into the next version.
    https://github.com/benhuson/password-protected/issues/5

Leave a Reply