# MSNDev BioLogin - Installation Guide

**Version:** 2.2.0  
**Requires WordPress:** 5.8+  
**Requires PHP:** 7.4+  
**Tested up to:** WordPress 6.4

---

## Table of Contents

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Initial Setup](#initial-setup)
4. [License Activation](#license-activation)
5. [Configuration](#configuration)
6. [WooCommerce Setup](#woocommerce-setup-pro)
7. [Troubleshooting](#troubleshooting)
8. [Uninstallation](#uninstallation)

---

## Requirements

### Server Requirements
- **WordPress:** 5.8 or higher
- **PHP:** 7.4 or higher
- **MySQL:** 5.6+ or MariaDB 10.0+
- **HTTPS:** Required for WebAuthn (biometric authentication)

### Browser Requirements
Biometric authentication requires browsers that support WebAuthn:
- Chrome 67+
- Firefox 60+
- Safari 13+
- Edge 79+

### Device Requirements
- Device with biometric capability (Touch ID, Face ID, Windows Hello, fingerprint sensor)
- OR a hardware security key (YubiKey, etc.)

---

## Installation

### Method 1: WordPress Admin (Recommended)

1. Download `biologin.zip` from your purchase email or [msndevstudio.com](https://www.msndevstudio.com)
2. Go to **WordPress Admin → Plugins → Add New**
3. Click **Upload Plugin**
4. Choose `biologin.zip` and click **Install Now**
5. Click **Activate Plugin**

### Method 2: FTP/SFTP Upload

1. Extract `biologin.zip` on your computer
2. Connect to your server via FTP/SFTP
3. Upload the `biologin` folder to `/wp-content/plugins/`
4. Go to **WordPress Admin → Plugins**
5. Find "BioLogin" and click **Activate**

### Method 3: WP-CLI

```bash
# Upload and activate
wp plugin install /path/to/biologin.zip --activate

# Or from URL (if available)
wp plugin install https://example.com/biologin.zip --activate
```

---

## Initial Setup

After activation, the plugin automatically:

1. ✅ Creates database tables for devices and logs
2. ✅ Adds biometric login button to WordPress login page
3. ✅ Sets up REST API endpoints

### First Steps

1. Go to **WordPress Admin → BioLogin**
2. Navigate to **My Devices**
3. Click **Register New Device**
4. Follow browser prompts to register your biometric credential

---

## License Activation

### For Pro/Agency/Lifetime Licenses

1. Go to **BioLogin → Settings**
2. Scroll to **License** section
3. Enter your license key (format: `MSD-XXXX-XXXX-XXXX-XXXX`)
4. Click **Activate License**

### License Key Location

Your license key is in:
- Purchase confirmation email
- Your account at [msndevstudio.com/my-account](https://www.msndevstudio.com/my-account)

### License Status

| Status | Meaning |
|--------|---------|
| ✅ Active | All Pro features enabled |
| ⚠️ Expiring | Renew within 30 days |
| ❌ Expired | Pro features disabled, free features work |
| ❌ Invalid | Check key or contact support |

---

## Configuration

### General Settings

Navigate to **BioLogin → Settings**

| Setting | Description | Default |
|---------|-------------|---------|
| **Enable Biometric Login** | Show biometric button on login | ✅ On |
| **Max Devices** | Devices per user | 5 |
| **Force Enrollment** | Require biometric for admins | Off |
| **Debug Mode** | Enable detailed logging | Off |

### Security Settings (Pro)

| Setting | Description | Default |
|---------|-------------|---------|
| **Risk Engine** | Adaptive authentication | ✅ On |
| **Geo-Fencing** | Country-based access | Off |
| **Block VPN** | Block VPN/proxy access | Off |
| **Strict Mode** | Biometric only (no password fallback) | Off |

---

## WooCommerce Setup (Pro)

Requires an active Pro license.

### Enable WooCommerce Integration

1. Go to **BioLogin → Settings**
2. Enable **WooCommerce Integration**
3. Enable **Checkout Biometric** (optional)
4. Save changes

### Where Biometric Login Appears

- ✅ My Account login page
- ✅ Checkout page (logged-out users)
- ✅ Quick checkout for returning customers

### Enrollment Prompts

After a customer logs in with password, they'll be prompted to set up biometric authentication for faster future logins.

---

## Troubleshooting

### Common Issues

#### "WebAuthn not supported" Error

**Cause:** Browser doesn't support biometric auth or site is not HTTPS.

**Solutions:**
1. Ensure your site uses HTTPS (required for WebAuthn)
2. Update browser to latest version
3. Check device has biometric capability

#### Biometric Button Not Showing

**Cause:** Plugin conflict or theme override.

**Solutions:**
1. Check **BioLogin → Settings** → Ensure "Enable Biometric Login" is on
2. Try with a default theme (Twenty Twenty-Four)
3. Disable other security plugins temporarily
4. Check browser console for JavaScript errors

#### "License Invalid" Error

**Solutions:**
1. Double-check license key (case-sensitive)
2. Ensure site URL matches registered site
3. Check if license expired
4. Contact support@msndevstudio.com

#### Database Tables Missing

**Solutions:**
1. Deactivate and reactivate the plugin
2. Or run this in your theme's `functions.php`:
```php
BioLogin_WP::get_instance()->activate();
```

### Debug Mode

Enable debug mode to see detailed logs:

1. Go to **BioLogin → Settings**
2. Enable **Debug Mode**
3. Go to **BioLogin → Security Logs**
4. View detailed authentication events

### Getting Support

1. **Free Users:** [WordPress.org Support Forums](https://wordpress.org/support/plugin/biologin/)
2. **Pro Users:** Email support@msndevstudio.com with:
   - WordPress version
   - PHP version
   - Error message/screenshot
   - Steps to reproduce

---

## Uninstallation

### Keep Data (Temporary Disable)

1. Go to **Plugins → Installed Plugins**
2. Click **Deactivate** on BioLogin

### Complete Removal

1. Go to **Plugins → Installed Plugins**
2. Click **Deactivate** on BioLogin
3. Click **Delete**
4. Confirm deletion

This removes:
- All plugin files
- Database tables (wp_biologin_devices, wp_biologin_logs)
- Plugin settings

> ⚠️ **Warning:** Users will lose their registered devices and need to re-register after reinstallation.

---

## Changelog

### Version 2.2.0
- Added WooCommerce checkout integration
- Improved risk engine accuracy
- Added geo-fencing by country
- Fixed: Device registration on Safari

### Version 2.1.0
- Added multi-device support
- Added security audit logs
- Improved admin dashboard

### Version 2.0.0
- Complete rewrite with React admin
- Added Pro features
- Added license system

---

## Resources

- **Documentation:** [docs.msndevstudio.com/biologin](https://docs.msndevstudio.com/biologin)
- **FAQ:** [msndevstudio.com/biologin-faq](https://www.msndevstudio.com/biologin-faq)
- **Support:** support@msndevstudio.com
- **Updates:** Delivered automatically via WordPress

---

*Thank you for choosing BioLogin!*
