appa dn plugin udpates for integrationa dn final touches

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-13 09:23:54 +00:00
parent e053655962
commit d2b733640c
13 changed files with 236 additions and 337 deletions

View File

@@ -85,6 +85,10 @@ The Integrations module manages:
## Data Models
### Authentication Note
**⚠️ Important:** For WordPress integrations, `Site.wp_api_key` is the **SINGLE source of truth** for API authentication, NOT SiteIntegration fields. The SiteIntegration model is used for sync tracking and multi-platform support (future: Shopify).
### SiteIntegration
| Field | Type | Purpose |
@@ -92,14 +96,15 @@ The Integrations module manages:
| account | FK | Owner account |
| site | FK | IGNY8 site |
| platform | CharField | wordpress/shopify |
| site_url | URLField | External site URL |
| api_key | CharField | WordPress Application Password |
| username | CharField | WordPress username |
| external_site_url | URLField | External site URL |
| is_active | Boolean | Enable/disable |
| sync_enabled | Boolean | Enable auto-sync |
| last_sync_at | DateTime | Last sync time |
| sync_status | CharField | idle/syncing/error |
| metadata | JSON | Platform-specific data |
| sync_status | CharField | pending/syncing/completed/error |
| sync_error | TextField | Sync error message |
| connection_status | CharField | connected/error |
| config_json | JSON | Platform-specific configuration |
| credentials_json | JSON | (Reserved for future platforms, NOT used for WordPress) |
| created_at | DateTime | Creation date |
### SyncEvent

View File

@@ -48,10 +48,18 @@ The IGNY8 plugin distribution system provides a comprehensive infrastructure for
| Platform | Plugin Name | Current Version | Status |
|----------|-------------|-----------------|--------|
| WordPress | IGNY8 WP Bridge | 1.3.3 | Production |
| 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
@@ -96,6 +104,8 @@ 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
@@ -103,6 +113,8 @@ Install/Update → Register Installation → Health Check
**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

View File

@@ -33,6 +33,8 @@ Django Admin → Add Plugin Version → Enter 3 fields → Save → Change statu
| Version | Date | Type | Key Changes |
|---------|------|------|-------------|
| 1.5.1 | Jan 10, 2026 | Minor | Admin UI consolidation: 6→3 pages (Dashboard, Settings, Logs), header alignment fixes |
| 1.5.0 | Jan 10, 2026 | Minor | Authentication simplification: Site.wp_api_key as single source of truth |
| 1.3.3 | Jan 10, 2026 | Patch | Template design: Square image grid fixes, landscape image positioning, direct border-radius/shadow on images without captions |
| 1.3.2 | Jan 9, 2026 | Patch | Template fixes in app and plugin, image layout improvements |
| 1.3.1 | Jan 9, 2026 | Patch | WordPress plugin versioning updates |

View File

@@ -122,12 +122,20 @@ This document covers the **app-side** management of WordPress integration:
│ │ ├── igny8-bridge.php # Main plugin file
│ │ ├── includes/ # PHP classes
│ │ ├── admin/ # Admin interface
│ │ │ ├── class-admin.php # Menu registration
│ │ │ ├── layout-header.php # Layout wrapper + sidebar
│ │ │ ├── layout-footer.php # Footer
│ │ │ ├── settings.php # Settings handler
│ │ │ └── pages/ # Admin pages (3 pages)
│ │ │ ├── connection.php # Dashboard (connection + stats)
│ │ │ ├── settings.php # Post types, taxonomies, sync
│ │ │ └── logs.php # Webhook activity logs
│ │ ├── sync/ # Sync functionality
│ │ ├── templates/ # Frontend templates
│ │ └── docs/ # Plugin-internal docs
│ └── dist/ # Distribution files
│ ├── igny8-wp-bridge-v1.1.1.zip # Version ZIP
│ ├── igny8-wp-bridge-v1.1.1.sha256
│ ├── igny8-wp-bridge-v1.x.x.zip # Version ZIP
│ ├── igny8-wp-bridge-v1.x.x.sha256
│ └── igny8-wp-bridge-latest.zip # Symlink to latest
└── backend/
@@ -141,6 +149,21 @@ This document covers the **app-side** management of WordPress integration:
└── urls.py # URL routing
```
### Plugin Admin Pages
The WordPress plugin provides 3 admin pages:
| Page | File | Purpose |
|------|------|---------|
| Dashboard | `connection.php` | Connection status, Site ID, API key, content stats |
| Settings | `settings.php` | Post types, default post status, taxonomies, sync toggle |
| Logs | `logs.php` | Webhook activity with timestamps, event types, status |
**Layout:**
- Dashboard: 2-column grid (Connection Status + Content Stats)
- Settings: 3-column top row (Post Types + Default Post Status + IGNY8 Sync) + dynamic taxonomy cards
- Logs: Full-width table with search
### How ZIP Files Are Created
#### Automatic Build (Recommended)
@@ -523,19 +546,38 @@ The frontend shows:
### Integration Data Model
**Authentication (Source of Truth):**
```python
# SiteIntegration model (in auth/models.py)
# Site model (in auth/models.py) - SINGLE source of truth for API auth
class Site(models.Model):
wp_api_key = models.CharField(max_length=255) # API key for WP authentication
# Used by: PublisherService, test connection, plugin verification
```
**Sync Tracking (SiteIntegration):**
```python
# SiteIntegration model (in auth/models.py) - Tracks sync status, NOT auth
class SiteIntegration(models.Model):
site = models.ForeignKey(Site, ...) # IGNY8 site
platform = models.CharField(...) # "wordpress"
platform = models.CharField(...) # "wordpress", "shopify"
external_site_url = models.URLField() # WordPress URL
api_key = models.CharField(...) # Encrypted key
sync_enabled = models.BooleanField()
last_sync = models.DateTimeField()
sync_status = models.CharField(...) # "pending", "syncing", "completed"
last_sync_at = models.DateTimeField()
sync_error = models.TextField(null=True)
connection_status = models.CharField(...) # "connected", "error"
```
**Key Architecture Points:**
- `Site.wp_api_key` is the **SINGLE source of truth** for API authentication
- `SiteIntegration` provides sync tracking but NOT authentication
- Publishing uses `Site.wp_api_key` via `X-IGNY8-API-KEY` header
- SiteIntegration kept for future multi-platform support (Shopify, custom)
---
## 9. Troubleshooting
@@ -638,7 +680,20 @@ unzip -p /data/app/igny8/plugins/wordpress/dist/igny8-wp-bridge-v1.1.1.zip \
- `/register/` - Installation registration
- `/health-check/` - Plugin health monitoring
### WordPress Plugin Updates (v1.3.0 → v1.3.3)
### WordPress Plugin Updates (v1.3.0 → v1.5.1)
**v1.5.1 - Admin UI Consolidation:**
- Reduced admin pages from 6 to 3: Dashboard, Settings, Logs
- Renamed Connection page to Dashboard with content stats
- Removed redundant pages: Data, Sync, old Dashboard
- Settings redesigned with 3-column layout (Post Types + Default Post Status + IGNY8 Sync)
- Fixed header alignment across all pages with proper width styling
- Cleaned up orphaned code and functions
**v1.5.0 - Authentication Simplification:**
- Simplified authentication to use Site.wp_api_key as single source of truth
- Removed redundant access_token handling
- Improved test connection flow using authenticated /verify-key endpoint
**v1.3.3 - Template Design Improvements:**
- Fixed square images displaying in 2 rows (now side-by-side)
@@ -665,11 +720,12 @@ unzip -p /data/app/igny8/plugins/wordpress/dist/igny8-wp-bridge-v1.1.1.zip \
### Version Progression Timeline
```
v1.7.0 (Jan 10, 2026) - App infrastructure + plugin v1.3.3
v1.7.0 (Jan 10, 2026) - App infrastructure + plugin v1.5.1
├── Plugin admin UI consolidation (6→3 pages)
├── Authentication simplification
├── Plugin distribution system complete
├── Template design overhaul
── Image layout fixes
└── Pre-launch cleanup (Phases 1, 5, 6)
── Pre-launch cleanup complete
v1.6.2 (Jan 8, 2026) - Design refinements
└── Marketing site updates

View File

@@ -523,28 +523,36 @@ class ContentImage(models.Model):
### SiteIntegration
**⚠️ Note:** For WordPress, `Site.wp_api_key` is the **SINGLE source of truth** for API authentication. SiteIntegration is used for sync tracking and future multi-platform support.
```python
class SiteIntegration(models.Model):
id = UUIDField(primary_key=True)
name = CharField(max_length=255)
site = ForeignKey(Site, related_name='integrations')
platform = CharField(max_length=50) # wordpress
platform = CharField(max_length=50) # wordpress, shopify (future)
# Credentials (encrypted)
url = URLField()
username = CharField(max_length=255)
api_key = CharField(max_length=255) # Application password
# Configuration
external_site_url = URLField()
config_json = JSONField(default=dict) # Platform-specific settings
credentials_json = JSONField(default=dict) # Reserved for future platforms (NOT for WordPress)
# Cached structure
# Sync Tracking
sync_enabled = BooleanField(default=True)
sync_status = CharField(max_length=50) # pending/syncing/completed/error
last_sync_at = DateTimeField(null=True)
sync_error = TextField(null=True)
# Connection
connection_status = CharField(max_length=50) # connected/error
is_active = BooleanField(default=True)
# Cached WordPress structure (from initial sync)
categories = JSONField(default=list)
tags = JSONField(default=list)
authors = JSONField(default=list)
post_types = JSONField(default=list)
# Status
is_active = BooleanField(default=True)
last_sync_at = DateTimeField(null=True)
structure_updated_at = DateTimeField(null=True)
created_at = DateTimeField(auto_now_add=True)