User Authentication & Membership System with MonsterTools

MonsterTools includes a complete user authentication system that allows you to create member-only areas, protect your tools, and manage user accounts seamlessly. The plugin automatically creates all necessary pages and provides flexible shortcodes for displaying login, registration, and password reset forms.


Auto-Created Authentication Pages

Upon activation, MonsterTools automatically generates the following essential pages:

These pages are ready to use immediately and contain the appropriate shortcodes. You can find them in WordPress Admin > Pages and customize them as needed.


Authentication Shortcodes Reference

1. Login Form - [monstertools_login]

Displays a user login form with email/username and password fields.

Attributes:

Examples:

[monstertools_login]
[monstertools_login redirect_to="/my-account/"]

2. Registration Form - [monstertools_register]

Displays a user registration form with email and password fields.

Attributes:

Examples:

[monstertools_register]
[monstertools_register redirect_to="/pricing/"]

3. Forgot Password - [monstertools_forgot]

Displays a form to request a password reset link via email.

Attributes:

Examples:

[monstertools_forgot]
[monstertools_forgot redirect_to="/custom-login/"]

4. Reset Password - [monstertools_reset]

Displays a form to set a new password (requires reset key and login parameters).

No attributes - Automatically handles reset keys from email links.

Example:

[monstertools_reset]

Automatic User Redirection

The system includes smart redirection logic:


Customizing Authentication Templates

You can completely customize the appearance of all authentication forms by overriding the plugin's template files in your theme or child theme.

Template Override Structure

Create this directory structure in your theme:

your-theme/
└── monster-tools/
    └── auth/
        ├── login.php
        ├── register.php
        ├── forgot.php
        └── reset.php

Available Template Files to Override

Step-by-Step Template Override Guide

1. Locate the Original Template Files
First, find the template you want to customize in the plugin directory:
wp-content/plugins/monstertools/templates/auth/

2. Create Theme Directory Structure
In your active theme, create the nested directory:

/wp-content/themes/your-theme/monster-tools/auth/

3. Copy and Customize
Copy the template file from the plugin to your theme directory and modify it:

Example: Customizing login.php

<?php
/**
 * Custom Login Template for MonsterTools
 * 
 * Override path: your-theme/monster-tools/auth/login.php
 */
?>
<div class="custom-login-wrapper">
    <h2>Welcome Back!</h2>
    
    <?php monstertools_show_messages(); ?>
    
    <form method="post" action="<?php echo esc_url($action_url); ?>" class="custom-login-form">
        <input type="hidden" name="action" value="<?php echo esc_attr($action); ?>">
        <input type="hidden" name="redirect_to" value="<?php echo esc_url($redirect_to); ?>">
        <?php wp_nonce_field($nonce_name, 'nonce'); ?>
        
        <div class="form-group">
            <label for="user_login">Email or Username</label>
            <input type="text" name="user_login" id="user_login" 
                   value="<?php echo esc_attr(monstertools_old('user_login', $old_key)); ?>" 
                   required class="form-control">
        </div>
        
        <div class="form-group">
            <label for="user_password">Password</label>
            <input type="password" name="user_password" id="user_password" required class="form-control">
        </div>
        
        <button type="submit" class="btn btn-primary">Sign In</button>
        
        <div class="auth-links">
            <a href="<?php echo esc_url($register_url); ?>">Create Account</a>
            <a href="<?php echo esc_url($forgot_url); ?>">Forgot Password?</a>
        </div>
    </form>
</div>

Available Template Variables

Each template provides specific variables you can use:

Login Template Variables:

Registration Template Variables:

Utility Functions:


Advanced Customization Examples

1. Custom Styling with CSS Classes

<div class="my-custom-auth-form">
    <!-- Your custom form markup -->
</div>

2. Adding Custom Fields

// In your custom register.php
<div class="form-group">
    <label for="phone_number">Phone Number (Optional)</label>
    <input type="tel" name="phone_number" id="phone_number" 
           value="<?php echo esc_attr(monstertools_old('phone_number', $old_key)); ?>" 
           class="form-control">
</div>

3. Custom Redirect Logic

// Force specific redirect for certain user roles
$redirect_to = apply_filters('monstertools_custom_redirect', $redirect_to, wp_get_current_user());

Best Practices for Template Overrides

  1. Always keep backups of your custom templates

  2. Test thoroughly after plugin updates

  3. Use child themes to preserve customizations during parent theme updates

  4. Follow the original template structure for easier maintenance

  5. Document your customizations for future reference

Troubleshooting Template Overrides

By using these template overrides, you can completely customize the authentication experience to match your site's design while maintaining all the powerful functionality of MonsterTools' membership system.