6.0 KiB
IGNY8 WordPress Bridge - Fixes Applied
✅ Issues Fixed
1. Security Check Failed (Nonce Verification) ✅
Problem: Form submission failed with "Security check failed. Please refresh the page and try again."
Root Cause: Nested form elements - The "Revoke API Key" button had a <form> tag nested inside the main connection form, which is invalid HTML and broke nonce submission.
Fix: Moved the "Revoke API Key" form outside the main connection form in admin/settings.php.
Result: ✅ Connection form now submits properly with valid nonce.
2. API Key Not Displaying After Reload ✅
Problem: API key field showed empty after successfully connecting and reloading the page.
Root Cause: The form was storing the placeholder asterisks (********) as the actual API key value when resubmitting.
Fix: Updated handle_connection() in admin/class-admin.php to detect placeholder values and preserve the stored API key.
Result: ✅ API key now properly displays as ******** when stored in the database.
3. Test Connection 405 Error 🔧 IMPROVED + NEEDS SaaS TEAM
Problem: Test Connection button returns HTTP 405 (Method Not Allowed) error.
Root Cause: The API endpoint being tested (/planner/keywords/?page_size=1) either:
- Doesn't exist yet
- Doesn't support GET method
- API key doesn't have permission to access it
Fixes Applied:
- ✅ Added comprehensive debug logging to
class-igny8-api.php - ✅ Test connection now tries 3 different endpoints as fallback
- ✅ Improved error messages to show HTTP status codes
- ✅ Added browser console logging for detailed debugging
What's Still Needed (SaaS Team):
- ⚠️ Implement
/system/ping/endpoint (should return{"success": true, "data": {"status": "ok"}}) - ⚠️ Verify the API key has permission to access at least one endpoint
- ⚠️ Check if endpoints require POST instead of GET
- ⚠️ Review server logs to see what's blocking the requests
📋 Files Modified
PHP Files
- ✅
admin/settings.php- Fixed nested forms, added debug indicator - ✅
admin/class-admin.php- Fixed API key handling, improved test connection - ✅
includes/class-igny8-api.php- Added debug logging, improved error responses
JavaScript Files
- ✅
admin/assets/js/admin.js- Enhanced error display with HTTP status codes
Documentation
- ✅
DEBUG-SETUP.md- Complete debugging guide - ✅
FIXES-APPLIED.md- This file
🧪 Testing Instructions
Step 1: Clear Browser Cache
- Open DevTools (F12)
- Right-click the Refresh button → "Empty Cache and Hard Reload"
Step 2: Test Connection Form
- Go to WordPress Admin → Settings → IGNY8 API
- Fill in your credentials:
- Email:
dev@igny8.com - API Key:
[your-api-key] - Password:
[your-password]
- Email:
- Click "Connect to IGNY8"
- ✅ Should show: "Successfully connected to IGNY8 API and stored API key."
- Reload the page
- ✅ Verify API key field shows:
********
Step 3: Enable Debug Mode (IMPORTANT!)
Add to wp-config.php (before /* That's all, stop editing! */):
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('IGNY8_DEBUG', true);
Step 4: Test Connection
- Scroll to "Connection Status" section
- Click "Test Connection" button
- Check the result message
- Open
wp-content/debug.logand look for:IGNY8 DEBUG GET: https://api.igny8.com/api/v1/system/ping/ IGNY8 DEBUG RESPONSE: Status=405 | Body={...}
Step 5: Check Browser Console
- Open DevTools (F12) → Console tab
- Click "Test Connection" again
- Look for
IGNY8 Connection Test Failed:error with full details
🔍 Expected Test Results
If /system/ping/ endpoint exists and works:
✅ Success: "Connection successful (tested: System ping endpoint)"
If endpoint returns 405:
⚠️ Error: "Connection failed: HTTP 405 error (HTTP 405)"
- This means the endpoint doesn't support GET method or doesn't exist
If endpoint returns 401:
⚠️ Error: "Connection failed: Unauthorized (HTTP 401)"
- This means the API key is invalid or doesn't have permission
If endpoint returns 404:
⚠️ Error: "Connection failed: HTTP 404 error (HTTP 404)"
- This means the endpoint doesn't exist yet
📧 Share Debug Info with SaaS Team
After testing with debug mode enabled, share:
- Full error message from Test Connection button
- Debug log entries from
wp-content/debug.log(search for "IGNY8 DEBUG") - Browser console errors from DevTools
- Your API key (first 8 characters only, for verification)
Example Debug Log to Share:
[21-Nov-2025 12:34:56 UTC] IGNY8 DEBUG GET: https://api.igny8.com/api/v1/system/ping/ | Headers: {"Authorization":"Bearer ***","Content-Type":"application\/json"}
[21-Nov-2025 12:34:56 UTC] IGNY8 DEBUG RESPONSE: Status=405 | Body={"detail":"Method \"GET\" not allowed."}
🚀 Next Actions
For You (WordPress Admin):
- ✅ Test the connection form with your credentials
- ✅ Enable debug mode in wp-config.php
- ✅ Click Test Connection and capture the error
- ✅ Share debug logs with the SaaS team
For SaaS Team:
- ⚠️ Review the debug logs you provide
- ⚠️ Implement or verify these endpoints accept GET:
/system/ping//planner/keywords/?page_size=1/system/sites/
- ⚠️ Verify API key permissions
- ⚠️ Check server access logs for the WordPress host IP
- ⚠️ Confirm no WAF/firewall is blocking requests
✅ Summary
| Issue | Status | Action Required |
|---|---|---|
| Security check nonce error | ✅ FIXED | None - working |
| API key not displaying | ✅ FIXED | None - working |
| Test connection 405 error | 🔧 IMPROVED | SaaS team needs to implement/fix endpoints |
The plugin is now properly configured and logging detailed debug information. The 405 error is a backend API issue that requires the SaaS team to implement or fix the endpoints.