Simple Member Protection Plugin Documentation

Version: 1.0
Author: WP Plugin Pilot

1. Overview

The Simple Member Protection plugin lets you protect WordPress content from unauthorized access. It enables administrators to define membership levels and restrict content visibility based on those levels or login status.

2. Installation

  1. Download and unzip the plugin.
  2. Upload the simple-member-protection folder to /wp-content/plugins/.
  3. Activate via the Plugins menu in WordPress.
  4. Go to Simple Member Protection in the admin sidebar to configure.

3. Admin Menu Structure

After activation, the plugin adds a top-level admin menu called SMP with these subpages:

  • Settings – Global plugin options.
  • Add New Member – Manually add users and assign membership levels.
  • All Members – View/edit all registered members and their levels.
  • Add Membership Level – Create new access tiers (Gold, Silver, etc).
  • All Membership Levels – View and manage all defined levels.
  • Import/Export – Upload or download members using CSV format.

4. Shortcodes

The plugin provides the following shortcode to protect content:

This content is for members only.

Restrict by membership level:

This content is for members only.

  • If the level attribute is not provided, the shortcode checks login status.
  • If a user doesn’t meet the level requirement, a login prompt with a message is shown.

5. Page/Post Protection via Meta Box

When editing any post/page, you’ll see a meta box labeled Membership Protection:

  • Toggle protection ON/OFF for that content.
  • Select the required membership level to view the post.
  • If no level is selected, only login is required.

6. Members Management

From the All Members menu:

  • List all registered users with their assigned membership levels.
  • Edit or remove membership levels from individual users.
  • Assign new levels or update existing ones.

7. Membership Levels

Use the admin menu to:

  • Create new levels (e.g., bronze, silver, gold).
  • Edit names or descriptions of levels.
  • Associate users with these levels manually or via import.

8. Import/Export Members

CSV import/export is available for member data:

  • Upload a CSV with user email and membership level to bulk-assign roles.
  • Export a list of users and their levels to CSV format for backup or migration.

CSV format:

email,membership_level
user1@example.com,gold
user2@example.com,silver

9. Dashboard Restrictions

Users with the smp_member role are blocked from accessing the WordPress admin dashboard. They are redirected to the home page unless performing AJAX actions.

10. Settings and Filters

  • Setting: smp_enable_protection — can disable content protection globally.
  • User meta key: membership_level — stores the level for each user.
  • Custom role: smp_member — assigned to members on registration/import.

11. Developer Notes

  • Plugin follows WordPress OOP standards with modular class files.
  • Shortcodes defined in class-smp-shortcodes.php.
  • Admin pages built using class-smp-admin.php and individual logic classes.
  • Hooks available to override messages or integrate login/register systems.

12. Troubleshooting

  • Content not protected: Ensure

    This content is for members only.

    is closed properly.
  • Membership level not applying: Check user profile or import file.
  • Members accessing dashboard: Confirm their role is smp_member.

13. License

This plugin is licensed under the GNU General Public License v2 or later.