2.1 KiB
WordPress Integration Fixes
Issues Fixed
1. Validation Error (400 Bad Request)
Problem: When creating WordPress integration with API key-only authentication, the backend was rejecting the request because username and app_password were empty strings.
Root Cause: The serializer was validating credentials but didn't account for API key-only authentication where username/password are optional.
Fix: Added custom validation in SiteIntegrationSerializer to allow API key-only authentication for WordPress platform:
- If
api_keyis provided incredentials_json, username and app_password are optional - If
api_keyis not provided, username and app_password are required (traditional auth)
File: backend/igny8_core/modules/integration/views.py
2. Status Indicator Not Showing Connected
Problem: Status indicator showed "Not configured" even when integration existed and was active.
Root Cause: Status check only looked for site?.wp_api_key but didn't check for API key in integration's credentials_json.
Fix: Updated status check to look for API key in both:
- Site's
wp_api_keyfield - Integration's
credentials_json.api_keyfield
File: frontend/src/pages/Sites/Settings.tsx
3. Integration Creation Error Handling
Problem: When toggling integration enabled without API key, no clear error was shown.
Fix: Added error handling to show clear message when trying to enable integration without API key.
File: frontend/src/components/sites/WordPressIntegrationForm.tsx
Content Sync Status
Content sync will work as long as:
- ✅ Integration exists in database
- ✅ Integration
is_active = True - ✅ Integration
sync_enabled = True
The sync service checks these conditions before performing sync operations.
Testing Checklist
- Create WordPress integration with API key only (no username/password)
- Status indicator shows "Configured" when integration exists and is active
- Status indicator shows "Connected" after successful connection test
- Content sync works when integration is active and sync_enabled
- Error messages are clear when API key is missing