3.8 KiB
3.8 KiB
IGNY8 WordPress Bridge - Debug Setup Guide
Quick Fix Summary
Issue 1: API Key Not Showing After Reload ✅ FIXED
- Problem: API key field was empty after reloading the page
- Fix: Updated the form handler to detect placeholder asterisks and preserve the stored API key
- Result: API key now properly shows as
********when stored
Issue 2: Test Connection Failing with 405 ✅ IMPROVED
- Problem: Test connection returns HTTP 405 (Method Not Allowed)
- Fix: Added comprehensive debugging and multiple endpoint fallback
- Result: Now tests 3 different endpoints and shows detailed error messages
Enable Debug Mode
To see detailed API request/response logs, add these lines to your wp-config.php file (before /* That's all, stop editing! */):
// Enable WordPress debugging
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
// Enable IGNY8-specific debugging
define('IGNY8_DEBUG', true);
View Debug Logs
After enabling debug mode:
- Test the connection in WordPress admin (Settings → IGNY8 API → Test Connection)
- Check the debug log at:
wp-content/debug.log - Look for lines starting with
IGNY8 DEBUG GET:andIGNY8 DEBUG RESPONSE:
What the Logs Will Show
IGNY8 DEBUG GET: https://api.igny8.com/api/v1/system/ping/ | Headers: {...}
IGNY8 DEBUG RESPONSE: Status=405 | Body={"detail":"Method not allowed"}
Common 405 Error Causes
- Endpoint doesn't support GET method - The SaaS API endpoint may only accept POST
- API key lacks permissions - The API key doesn't have access to that endpoint
- Endpoint doesn't exist - The URL path is incorrect or not implemented yet
- Firewall/WAF blocking - Server-side security blocking the request
Test Connection Endpoints (Tried in Order)
The plugin now tests these endpoints automatically:
/system/ping/- Basic health check/planner/keywords/?page_size=1- Keywords list (limited to 1 result)/system/sites/- Sites list
If all three fail, the error message will show the last failure with HTTP status code.
Manual Testing with cURL
Test the API from your server's command line:
# Replace YOUR_API_KEY with your actual API key
curl -v -H "Authorization: Bearer YOUR_API_KEY" "https://api.igny8.com/api/v1/system/ping/"
Expected success response (HTTP 200):
{
"success": true,
"data": {
"status": "ok"
}
}
Next Steps for SaaS Team
Based on the debug logs, the SaaS team should:
- Check which HTTP methods are allowed for the tested endpoints
- Verify API key permissions - Ensure the key has access to at least one endpoint
- Implement
/system/ping/endpoint if it doesn't exist (should return 200 OK) - Check server logs for incoming requests from the WordPress host
- Review WAF/firewall rules that might be blocking requests
Plugin Changes Made
1. includes/class-igny8-api.php
- Added debug logging for all GET requests
- Added HTTP status code to all responses
- Improved error messages with status codes
2. admin/class-admin.php
- Updated
test_connection()to try multiple endpoints - Returns detailed error information including HTTP status
- Detects API key placeholder to prevent overwriting stored key
3. admin/assets/js/admin.js
- Shows HTTP status code in error messages
- Logs full error details to browser console
4. admin/settings.php
- Shows debug mode indicator when WP_DEBUG is enabled
- Fixed API key field to show asterisks when key is stored
Disable Debug Mode
After troubleshooting, remove or comment out these lines from wp-config.php:
// define('WP_DEBUG', true);
// define('WP_DEBUG_LOG', true);
// define('IGNY8_DEBUG', true);
Keep WP_DEBUG_DISPLAY as false to prevent errors showing on the live site.