fixing issues of integration with wordpress plugin
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
# Generated manually on 2026-01-12
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def add_wordpress_plugin(apps, schema_editor):
|
||||
"""
|
||||
Add the IGNY8 WordPress Bridge plugin to the database.
|
||||
"""
|
||||
Plugin = apps.get_model('plugins', 'Plugin')
|
||||
PluginVersion = apps.get_model('plugins', 'PluginVersion')
|
||||
|
||||
# Create or update the WordPress plugin
|
||||
plugin, created = Plugin.objects.get_or_create(
|
||||
slug='igny8-wp-bridge',
|
||||
defaults={
|
||||
'name': 'IGNY8 WordPress Bridge',
|
||||
'platform': 'wordpress',
|
||||
'description': 'Connect your WordPress site to IGNY8 for AI-powered content publishing, SEO optimization, and seamless automation. Features API key authentication, automated updates, advanced template rendering, and webhook sync.',
|
||||
'homepage_url': 'https://igny8.com/docs/wordpress-integration',
|
||||
'is_active': True,
|
||||
}
|
||||
)
|
||||
|
||||
if not created:
|
||||
# Update existing plugin with latest information
|
||||
plugin.name = 'IGNY8 WordPress Bridge'
|
||||
plugin.description = 'Connect your WordPress site to IGNY8 for AI-powered content publishing, SEO optimization, and seamless automation. Features API key authentication, automated updates, advanced template rendering, and webhook sync.'
|
||||
plugin.homepage_url = 'https://igny8.com/docs/wordpress-integration'
|
||||
plugin.is_active = True
|
||||
plugin.save()
|
||||
|
||||
# Add current version (1.3.4) if it doesn't exist
|
||||
version, created = PluginVersion.objects.get_or_create(
|
||||
plugin=plugin,
|
||||
version='1.3.4',
|
||||
defaults={
|
||||
'version_code': 10304, # 1.03.04
|
||||
'status': 'released',
|
||||
'changelog': '''## Version 1.3.4 (January 12, 2026)
|
||||
|
||||
### Major Changes
|
||||
- **API Key Authentication Only**: Removed username/password authentication
|
||||
- **Simplified Integration**: Single API key for all communication
|
||||
- **Bearer Token Auth**: Uses `Authorization: Bearer {api_key}` header
|
||||
- **Webhooks Deprecated**: Removed webhook signature validation
|
||||
|
||||
### Authentication
|
||||
- API key stored in WordPress options table: `igny8_api_key`
|
||||
- Accepts both `X-IGNY8-API-KEY` header and `Authorization: Bearer` header
|
||||
- Single source of truth: Site.wp_api_key in IGNY8 backend
|
||||
|
||||
### Technical Improvements
|
||||
- Streamlined connection test endpoint
|
||||
- Improved error handling and validation
|
||||
- Better health check reporting
|
||||
- Enhanced auto-update mechanism
|
||||
|
||||
### Backward Compatibility
|
||||
- Legacy username/password fields removed
|
||||
- No migration needed for existing installations
|
||||
- API key authentication works with all IGNY8 API versions 1.0+
|
||||
''',
|
||||
'min_api_version': '1.0',
|
||||
'min_platform_version': '5.6',
|
||||
'min_php_version': '7.4',
|
||||
'file_path': 'plugins/wordpress/dist/igny8-wp-bridge-1.3.4.zip',
|
||||
'file_size': 0, # Will be updated when file is generated
|
||||
'checksum': '', # Will be updated when file is generated
|
||||
'force_update': False,
|
||||
}
|
||||
)
|
||||
|
||||
if created:
|
||||
print(f"✅ Created WordPress plugin version 1.3.4")
|
||||
else:
|
||||
print(f"ℹ️ WordPress plugin version 1.3.4 already exists")
|
||||
|
||||
|
||||
def remove_wordpress_plugin(apps, schema_editor):
|
||||
"""
|
||||
Reverse migration - remove the WordPress plugin.
|
||||
This is optional and can be commented out if you want to keep the data.
|
||||
"""
|
||||
Plugin = apps.get_model('plugins', 'Plugin')
|
||||
Plugin.objects.filter(slug='igny8-wp-bridge').delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plugins', '0003_simplify_status_choices'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_wordpress_plugin, remove_wordpress_plugin),
|
||||
]
|
||||
Reference in New Issue
Block a user