A WordPress plugin that protects file downloads behind a password or lead capture form, helping you generate leads while controlling access to your valuable content. Perfect for creating lead magnets with PDFs, documents, videos, archives, and more.

NEW in v1.0.6: Enterprise-grade IP whitelisting system with robust proxy/firewall compatibility!

Features

🔐 File Protection

  • Gate any file type behind a password or lead capture form
  • Configurable file extensions (PDF, DOC, DOCX, ZIP, MP4, and more)
  • Flexible protection rules - protect by filename, partial path, or full URL
  • Universal file interception regardless of directory structure
  • Works with WordPress in subdirectories and multisite installations
  • 📝 Lead Generation

  • Beautiful, responsive lead capture form
  • Collects name, email, and optional phone number
  • Automatic email delivery with access passwords
  • Lead management system with complete contact information
  • Email spam prevention with 30-minute cooldown between requests
  • 🎨 Modern Interface

  • Side-by-side form layout on desktop, stacked on mobile
  • Clean, professional design that matches your WordPress theme
  • Helpful placeholders and user-friendly interface
  • Customizable email templates
  • 🌐 IP Whitelisting & Access Control (NEW in v1.0.6)

  • Enterprise IP Whitelisting - Bypass lead capture for trusted IP addresses
  • Multiple IP Formats - Support for single IPs, CIDR notation, and IP ranges
  • Proxy/Firewall Compatible - Smart IP detection behind CDNs, load balancers, and firewalls
  • Real Client IP Detection - Supports X-Forwarded-For, CF-Connecting-IP, and all major proxy headers
  • Perfect for Organizations - Seamless access for internal networks while maintaining lead generation
  • 🛡️ Security & Performance

  • Secure password generation using WordPress salts
  • Cookie-based authentication for seamless access
  • No database bloat - passwords generated on-demand
  • Proper file serving with security headers
  • Comprehensive Logging - All IP detection and access attempts logged
  • Installation

    1. Upload the Plugin - Upload the lead-magnet-download-wall folder to /wp-content/plugins/ - Or install via WordPress admin: Plugins → Add New → Upload Plugin

    2. Activate the Plugin - Go to Plugins in your WordPress admin - Find "Lead Magnet Download Wall" and click "Activate"

    3. Configure Settings - Navigate to Lead Magnet in your WordPress admin menu - Configure your protected files and email settings

    Configuration

    Protected Files

    Add URLs or filenames of files you want to protect:

    <h1>Examples of protection rules:</h1>
    document.pdf                    # Protects any file named "document.pdf"
    reports/                        # Protects any file in "reports" directories
    wp-content/uploads/secret.pdf   # Protects specific file
    my-ebook.docx                   # Protects Word documents
    video-course.mp4                # Protects video files

    Email Settings

    Customize the email sent to users with their access password:

  • Subject Line: Customize the email subject
  • Message Template: Use variables like {name}, {password}, {site_name}
  • IP Whitelisting Configuration (NEW in v1.0.6)

    Configure trusted IP addresses that can bypass lead capture entirely:

    <h1>Examples of IP whitelist formats:</h1>\n192.168.1.100                    # Single IP address\n192.168.1.0/24                   # CIDR notation (entire subnet)\n10.0.0.1-10.0.0.50              # IP range (from-to format)\n203.0.113.195                    # External office IP\n172.16.0.0/16                    # Large internal network

    Perfect for:

  • Office networks and internal users
  • Partner/client IP addresses
  • VPN exit points
  • Development and staging environments
  • Form Customization

    The plugin automatically creates a responsive form with:
  • Password entry for returning users
  • Lead capture for new users
  • Mobile-optimized layout
  • Usage

    For Site Administrators

    1. Add Protected Files - Go to Lead Magnet → Settings - Configure file extensions (PDF, DOC, ZIP, MP4, etc.) - Add file patterns to the "Protected File URLs/Patterns" textarea - Save settings

    2. Manage Leads - View all leads at Lead Magnet → Leads - NEW: Edit any lead - Click on any lead to edit all information - Edit fields: Name, email, phone, IP address, creation date - See complete contact information including generated passwords - Export or manage lead data as needed

    3. Customer Support - Access any lead's information from the admin area - NEW: Update lead details - Correct typos or update contact information - View or regenerate passwords for users who call for support - Track lead generation and PDF access patterns

    4. Lead Data Management - NEW: Manual lead entry - Add leads directly through WordPress admin - Edit existing leads - Update any field with proper validation - Audit trail - All changes automatically logged for compliance

    5. IP Whitelisting Management (NEW in v1.0.6) - Go to Lead Magnet → Settings → IP Whitelist - Add trusted IP addresses (one per line) - Support for single IPs, CIDR notation, and IP ranges - Automatic proxy detection - Works behind firewalls, CDNs, and load balancers - Real-time logging - Monitor IP detection and whitelist matches in logs

    For Website Visitors

    1. Accessing Protected Files - Click on any protected file link - Choose to enter an existing password or request access - Fill out the lead form to receive an access password via email - Spam Protection: If you've already requested access, wait 30 minutes before requesting again

    2. Using Access Passwords - Passwords are in format: 123a1b2c (ID + hash, no spaces or dashes) - Passwords work for all protected files on the site - Passwords remain valid for future downloads

    Technical Details

    System Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • Apache web server with mod_rewrite enabled
  • Write permissions for .htaccess file
  • How It Works

    1. File Interception: Uses .htaccess rules to intercept protected file requests\n2. Protection Check: Compares requested file against protection rules\n3. Authentication: Checks for valid cookie or redirects to form\n4. Lead Processing: Captures lead data and generates unique passwords\n5. Spam Prevention: Enforces 30-minute cooldown between email requests\n6. Email Delivery: Sends access password to user's email\n7. Secure Access: Sets authentication cookie for future file access

    File Structure

    lead-magnet-download-wall/
    ├── lead-magnet-download-wall.php      # Main plugin file
    ├── protected-gate-handler.php         # File request handler
    ├── protected-gate-form.php            # Access form
    ├── serve-file.php                     # Secure file serving script
    ├── includes/
    │   ├── class-protected-gate-admin.php # Admin interface
    │   ├── class-protected-gate-handler.php # Handler class
    │   ├── class-protected-gate-logger.php # Logging system
    │   └── class-protected-gate-utils.php # Centralized utilities (NEW)
    ├── assets/
    │   └── css/
    │       └── protected-gate-styles.css  # Styling
    └── README.md                          # This file

    Customization

    Styling

    Customize the form appearance by editing:
  • assets/css/protected-gate-styles.css for form styling
  • Use CSS classes like .protected-gate-container, .protected-gate-form
  • Email Templates

    Customize email content in the admin settings using these variables:
  • {name} - User's name
  • {password} - Generated access password
  • {site_name} - Your site name
  • {site_url} - Your site URL
  • Hooks and Filters

    The plugin provides various WordPress hooks for developers:
  • Custom post type: protected_lead
  • Settings options: protected_gate_* options
  • Cookie name: protected_gate
  • Troubleshooting

    Files Not Being Intercepted

  • Check that .htaccess file is writable
  • Verify mod_rewrite is enabled on your server
  • Ensure WordPress permalinks are enabled
  • Emails Not Sending

  • Check WordPress email configuration
  • Verify SMTP settings if using custom email
  • Check spam folders for test emails
  • Form Not Displaying

  • Clear any caching plugins
  • Check for JavaScript errors in browser console
  • Verify plugin files are properly uploaded
  • Password Issues

  • Passwords are case-sensitive
  • Ensure no extra spaces when copying/pasting
  • Contact site admin if password doesn't work
  • Support

    For support, feature requests, or bug reports:

  • Check the WordPress admin area for lead management
  • Review server error logs for technical issues
  • Ensure all plugin files are properly uploaded
  • Changelog

    Version 1.0.6

  • NEW: IP Whitelisting System - Enterprise-grade access control allowing trusted IP addresses to bypass lead capture entirely
  • MAJOR: Robust IP Detection - Smart detection of real client IPs behind firewalls, CDNs, proxies, and load balancers
  • ENHANCED: Proxy Compatibility - Full support for X-Forwarded-For, CF-Connecting-IP, and all major proxy headers
  • IMPROVED: Network Support - Perfect compatibility with Cloudflare, AWS Load Balancers, corporate firewalls, and reverse proxies
  • ADDED: Advanced IP Formats - Support for single IPs (192.168.1.100), CIDR notation (192.168.1.0/24), and IP ranges (10.0.0.1-10.0.0.50)
  • SECURITY: Comprehensive Logging - All IP detection attempts and whitelist matches logged with detailed context for monitoring
  • ADMIN: Professional Interface - Easy-to-use IP whitelist management with clear examples, instructions, and validation
  • ENTERPRISE: Access Control - Perfect for organizations needing seamless internal network access while maintaining lead generation
  • DEVELOPER: Centralized IP Logic - All IP detection centralized in Protected_Gate_Utils::get_client_ip() for consistency
  • COMPATIBILITY: Development Friendly - Full support for private IP ranges in local development and internal network environments
  • Version 1.0.5

  • NEW: Fully Editable Lead Fields - All lead information now editable in WordPress admin backend
  • ENHANCED: Lead Management - Edit names, emails, phone numbers, IP addresses, and creation dates directly from admin
  • IMPROVED: Admin Interface - Professional form inputs with proper validation and helpful descriptions
  • ADDED: Data Validation - Email format validation and comprehensive input sanitization for data integrity
  • SECURITY: Nonce Protection - Secure form submissions with CSRF protection and permission checks
  • FEATURE: Audit Logging - All lead updates automatically logged for compliance and debugging
  • UX: Better Forms - Proper HTML5 input types (email, tel, datetime-local) for improved user experience
  • ADMIN: Complete Control - Edit any lead field including manual lead creation through WordPress backend
  • Version 1.0.4

  • MAJOR: Code Architecture Refactoring - Eliminated all duplicate code across plugin files
  • NEW: Protected_Gate_Utils Class - Centralized all shared utility functions for better maintainability
  • IMPROVED: File Serving - All file serving now uses consistent, secure methods with anti-caching headers
  • ENHANCED: Token Security - Unified secure token generation and validation across all components
  • BETTER: Code Organization - DRY principles applied, single source of truth for all shared logic
  • OPTIMIZED: Performance - Reduced code duplication improves loading times and memory usage
  • DEVELOPER: Maintainability - Clean architecture makes future updates and debugging much easier
  • Version 1.0.3

  • Enhanced firewall and CDN compatibility with PHP-based file serving
  • Added comprehensive logging system with admin interface
  • Implemented file locking system for enhanced security
  • Added WordPress hook fallback for PDF interception
  • Improved server compatibility across different hosting environments
  • Version 1.0.2

  • Email spam prevention with 30-minute cooldown between requests
  • Dynamic .htaccess rule updates when file extensions change
  • Complete plugin renaming from "PDF Download Gate" to "Lead Magnet Download Wall"
  • Multi-file-type support (PDF, DOC, ZIP, MP4, etc.)
  • Enhanced admin interface with file extension management
  • Improved protection pattern matching
  • Version 1.0.1

  • Responsive side-by-side form layout
  • Simplified password format (no dashes)
  • Enhanced admin interface with complete lead information
  • Dynamic password generation (no database storage)
  • Updated cookie system with cleaner naming
  • Flexible file protection rules
  • Improved mobile experience
  • Version 1.0.0

  • Initial release
  • Basic PDF protection functionality
  • Lead capture form
  • Email password delivery
  • Admin interface

License

This plugin is licensed under the GPL-2.0+ license.

---

Lead Magnet Download Wall - Protect your Files, Generate your Leads

Let’s talk about your upcoming project today!