# Plugin Management Documentation

**Last Updated:** January 10, 2026  
**Version:** 1.7.0  
**Status:** Production

This section covers plugin distribution, management, and integration from the IGNY8 app perspective.

## Contents

1. [WORDPRESS-INTEGRATION.md](WORDPRESS-INTEGRATION.md) - Complete guide for WordPress integration management
2. [PLUGIN-UPDATE-WORKFLOW.md](PLUGIN-UPDATE-WORKFLOW.md) - How plugin updates work and post-update checklist

## Overview

The IGNY8 plugin distribution system provides a comprehensive infrastructure for managing, distributing, and updating plugins across multiple platforms (WordPress, Shopify, custom sites). The system includes automated versioning, security features, update mechanisms, and monitoring.

## Quick Reference

### API Endpoints (Production)

| Endpoint | Purpose | Method |
|----------|---------|--------|
| `https://api.igny8.com/api/plugins/igny8-wp-bridge/download/` | Download latest plugin ZIP | GET |
| `https://api.igny8.com/api/plugins/igny8-wp-bridge/check-update/` | Check for updates (called by WP plugin) | POST |
| `https://api.igny8.com/api/plugins/igny8-wp-bridge/info/` | Get plugin metadata | GET |
| `https://api.igny8.com/api/plugins/igny8-wp-bridge/register/` | Register new installation | POST |
| `https://api.igny8.com/api/plugins/igny8-wp-bridge/health-check/` | Plugin health check | POST |

### Key Directories

| Path | Purpose |
|------|---------|
| `/data/app/igny8/plugins/wordpress/source/igny8-wp-bridge/` | WordPress plugin source code |
| `/data/app/igny8/plugins/wordpress/dist/` | Distribution ZIP files |
| `/data/app/igny8/plugins/shopify/` | Shopify integration (planned) |
| `/data/app/igny8/plugins/custom-site/` | Custom site integration (planned) |
| `/data/app/igny8/backend/igny8_core/plugins/` | Django plugin management app |

### Database Models

- `Plugin` - Plugin registry (name, slug, platform, status)
- `PluginVersion` - Version tracking with file info, checksums, changelog
- `PluginInstallation` - Track installations per site with version info
- `PluginDownload` - Download analytics and tracking

### Current Plugin Status

| Platform | Plugin Name | Current Version | Status |
|----------|-------------|-----------------|--------|
| WordPress | IGNY8 WP Bridge | 1.5.1 | Production |
| Shopify | IGNY8 Shopify | - | Infrastructure Ready |
| Custom | IGNY8 Bridge | - | Infrastructure Ready |

### WordPress Plugin Admin Pages (v1.5.1)

| Page | Purpose |
|------|---------|
| Dashboard | Connection status, Site ID, masked API key, content stats |
| Settings | Post types, default post status, taxonomies, sync toggle |
| Logs | Webhook activity with timestamps, event types, status |

## System Features

### Distribution System
- Automated ZIP package generation
- Version-based file management
- MD5 and SHA256 checksums
- Signed download URLs
- Rate limiting and security

### Update Mechanism
- WordPress auto-update via `pre_set_site_transient_update_plugins` hook
- Version comparison and update notifications
- Changelog display
- Compatibility checks

### Monitoring & Analytics
- Installation tracking per site
- Download counts and analytics
- Health check endpoints
- Version distribution tracking
- Error logging and monitoring

### Security Features
- Signed URLs with expiration
- Checksum verification (MD5/SHA256)
- Rate limiting per IP/site
- API authentication for sensitive endpoints
- Production environment protection

## Integration Flow

```
Developer → Update Source Code → Create PluginVersion in Admin
     ↓
Automatic: Build ZIP, Calculate Checksums, Store in /dist/
     ↓
WordPress Site → Check for Updates → Download via API
     ↓
Install/Update → Register Installation → Health Check
```

## Version Progression (Last 20 Commits)

**WordPress Plugin Versions:**
- v1.5.1 - Admin UI consolidation (6→3 pages), header fixes
- v1.5.0 - Authentication simplification (Site.wp_api_key as single source)
- v1.3.3 - Template design improvements, image layout fixes
- v1.3.2 - Template fixes in app and plugin
- v1.3.1 - WordPress plugin updates
- v1.3.0 - Initial distribution system release

**Infrastructure Updates:**
- Plugin distribution system implemented (v1.7.0)
- Authentication simplified to Site.wp_api_key (single source of truth)
- SiteIntegration model retained for sync tracking (not auth)
- Database models for multi-platform support
- API endpoints for lifecycle management
- Automated packaging and versioning
- Security and monitoring features

## Documentation Structure

### App-Side Documentation (This Folder)
- Plugin distribution infrastructure
- API endpoint documentation
- Database models and admin interface
- Integration workflows
- Security and monitoring

### Plugin-Side Documentation
See `/plugins/wordpress/source/igny8-wp-bridge/docs/` for:
- Plugin PHP code and functions
- WordPress hooks and filters
- Template system
- Content publishing flow
- Plugin-specific configuration

---

**Note**: For internal plugin details (PHP functions, hooks, code structure), see the documentation inside the plugin directory at `/plugins/wordpress/source/igny8-wp-bridge/docs/`.
