Member Lock Plugin Documentation

Click Here to download the latest version of the plugin:

http://nanacast.com/memberlock/nanacast.com-memberlock-1.2.zip

Overview

MemberLock allows you to restrict WP content to be viewable by registered site members.  It is designed to work "out-of-the-box" with no modifications to your theme.

While Nanacast.com is a completely independent, full-featured membership system, Member Lock allows you also take advantage of all that wordpress has to offer.  It fully integrates with Nanacast.com allowing you to use the wide variety of payment methods and pricing structures available on Nanacast.com while at the same time using wordpress to distribute your content to your members.

 Content can be made public or for members only.  It also allows you to post "teaser" excerpts on your home page which are made available to the public, but when you click on the "read more" link it displays your sales message and prompts you to login.

Quick Start/Installation

1. Download and unzip.  Upload the memberlock/ folder to your /wp-content/plugins/ folder on your wordpress blog. 

2. Activate the plugin through the 'Plugins' menu in WordPress

3. Click on the Member Lock Settings link at the top and fill out the settings

4. Create your membership in Nanacast.com.  (You may have to go back and tweak your member lock settings in wordpress after you create your membership.)

5. You MUST add 'Password' as a Custom Field for your membership.

6. Checkmark "Activate Advanced Outgoing API" for your membership, and then enter your memberlock API URL:

 http://YOUR-BLOG.com/wp-content/plugins/memberlock/memberlock_api.php?security_code=YOUR-MADE-UP-SECURITY-CODE

7. Place <!--more-memberlock--> in the HTML of your posts.  Content below the tag will be hidden to public visitors.

Using the <!--more--> tag in public posts to show "teasers"

 Wordpress allows visitors to view content two different ways:  

1:  On the "summary" style pages (home, archive, category), where it lists all the posts down the page

2:  When you click on a single post so that now you are viewing just one post.

When creating a post in wordpress, there is a checkbox to the right called "Keep this post private".  If you checkmark this, it will not show the post on any "summary" pages at all unless you are logged in. 

However, if you leave it unchecked, then the post will be public.  Leaving the post public allows you to use the "<!--more-->" tag built-in to wordpress in order to restrict part of the post.  Simply click to view HTML when creating a post, and enter <!--more--> anywhere in the post.  Now on the overview page it will show the first part of your post to the public, but will hide everything following the <!--more--> tag.  It will add a link that says "Read the rest of this entry>>".  When a visitor clicks on this link, it will take them to the "single post" page where it will display the entire post.  Again, this functionality is built into wordpress by default.

Using the <!--more-memberlock--> tag to show "teasers" to the public but keep the full post private

MemberLock expands upon this built-in feature by allowing you to show "teasers" to the public on "summary" pages but restricting the rest of the post to members who are logged in. 

To do this, use the tag <!--more-memberlock--> within your post just like you would use <!--more-->.

Now when a public visitor clicks the link to "Read the rest of this entry>>", it will take them to a special login page where they must login to view the rest of the post.  Your HTML that you added to the "Sales Page Link HTML" field is what will go right above the login boxes.  This allows you to customize what you want to show on the login page.  You could simply have some text encouraging existing members to login and non-members to click a link to another sales page on your site, or you could even embed your Nanacast.com order form HTML code right into this page so that your visitors could purchase the membership right there.  

Customizing the "Read the rest of this entry>>" link

By default, wordpress will replace the "<!--more-->" tag with the text "Read the rest of this entry>>"

However, you can customize the link text using the following method:

<!--more Click Here to Read More of This Post... -->

Adding the above tag will make the link say "Click Here to Read More of This Post..." instead of the default text.

This also applies to the "<!--more-memberlock-->" tag.

Simply use this format: "<!--more-memberlock Click Here to Read More of This Post (members only)... -->"

 Enabling the MemberLock Widget

 Within your Wordpress Admin panel, click on Design >> Widgets.  Then click Add next to the Member Lock plugin.  This will add a small box on your side menu that will contain a login form if the visitor is not logged in.  If they are logged in, it will contain their login status along with a link to  the "Membership Billing Info URL" that you've entered in the plugin settings, and a logout link.

 MemberLock Plugin Settings

 1. "Sales Page Link HTML":  This is the HTML that will appear right above the login form on the page that visitors will see when they click the link to "Read the rest of this entry...".

 2. Membership Billing Info URL:  This is the URL to your customized membership login page.  You can find this URL by logging into your Nanacast.com account and going to Manage >> Links >> Membership Logins.  When your members are logged into wordpress, they will see this link on their side menu with the text "Edit Billing Information".  They can then click this link, which will take them to your customized membership login hosted on Nanacast.com where they can login and manage their billing info.

 3. Security Code:  This security code should be a number or password that you make up.  When used in conjunction with your Remote API URL in Nanacast.com, your wordpress site will be secured so that intruders can't hit your Member Lock API and create unauthorized accounts.

 Nanacast.com membership configuration:

 Member Lock is designed to work with a Nanacast.com membership.  Login to your Nanacast.com account follow the steps through the wizard to create your membership.  

Setting Up the Required Custom Fields

 The required custom fields are: firstname, lastname, email, password.  The fields "firstname, lastname and email" are automatically added for you during the membership wizard.  However, password is not automatically added during the wizard, so you will need to click to add "Password" in your list of permanent custom fields.  When you add the password field you will see an option to have the system automatically generate passwords so your clients don't have to type one in.

 Username is optional but is recommended as a custom field.  This is because the Nanacast.com system makes sure that username is unique, thereby ensuring that your usernames will also be unique in Wordpress.  

 However, if you don't want to ask your members to enter username the system will just use their email address as their username.  This introduces the possibility of having two accounts in wordpress with the same email address.  Not very likely, but possible.  (someone would have to order your membership twice with the same email)

 The password your member creates will work on your wordpress blog and also to get into your custom membership login page hosted on Nanacast.com.  (The one exception to this is if they already have an existing account on Nanacast.com.  In this case they must use their existing password to get into your custom membership login page hosted on Nanacast.com, but their new password will work on your wordpress blog.)

Setting Up the Email Receipt

Once you have set up all your custom fields, you should go back to the "Edit Pricing" page for your membership to modify the email receipt that will be sent out for your membership.  Now that you have added your custom fields, you will see the custom variable tags you can use in the email receipt.

The tags {username} and {password} refer to the email and password that your clients should use to login to your membership hosted on Nanacast.com.

The tags {external_username} and {external_password} refer to the custom fields "username" and "password".  These are the fields used to login to your wordpress blog.

If your client does not have an existing account on Nanacast.com when they join your membership, then their {external_password} field will also be used as the password for their new account on Nanacast.com. In these cases the {password} and {external_password} will be the same.

However, if your client already has an account on Nanacast.com (like in cases where they have previously joined one of your other memberships or another membership from a different publisher on Nanacast.com), then their existing Nanacast.com password will NOT be overwritten by the {external_password} field. In these cases the {password} and {external_password} might be different.

Because of this it is advised that you include all the tags in the email receipt and explain which username/password will log them into your membership area hosted on Nanacast.com and which username/password will log them into your remotely-hosted membership site.

 For example, you might craft your email receipt to look like this:

Billing Website: {login_url}
Billing Username: {username}
Billing Password: {password}

Membership Website: YOUR_WORDPRESS_BLOG_URL
Membership Username: {external_username} (or {email} if you've decided not to use Usernames)
Membership Password: {external_password}

Activating the Remote API

 On the "Custom Fields/Notifications" page, you will need to checkmark "Activate Advanced Outgoing API", and then enter the following URL in one of the "External URL" boxes:

 http://example.com/wp_dir/wp-content/plugins/memberlock/memberlock_api.php?security_code=12345

 Replace "example.com/wp_dir/" with the domain name and directory for your wordpress blog.

 Replace "12345" with the security code you made up and entered into the Member Lock Plugin Settings in your wordpress admin panel.  

 The security code is optional, but it is recommended to ensure that no one can create unauthorized members using your Member Lock API script.  Just make sure that these two security code values are the same in both places.

Additional Tips

1.  In wordpress under Options > General, it is recommended that you leave "Anyone can register" unchecked.  This way members can only be created through the API or through the wordpress admin panel.

2.  Make sure you log out of the admin before you test.  If you are logged in as admin, you will be able to click through to view the entire post.  (To know if you are logged in, we suggest using the Member Lock widget which shows your status on the sidebar.)