diff --git a/frontend/src/components/sites/WordPressIntegrationForm.tsx b/frontend/src/components/sites/WordPressIntegrationForm.tsx index 7fb64734..c43e8fde 100644 --- a/frontend/src/components/sites/WordPressIntegrationForm.tsx +++ b/frontend/src/components/sites/WordPressIntegrationForm.tsx @@ -200,10 +200,25 @@ export default function WordPressIntegrationForm({ }), }); - if (result?.success) { - toast.success('Connection test successful'); + // Check for fully functional connection (includes bidirectional communication) + if (result?.fully_functional) { + toast.success('✅ Connection is fully functional! Plugin is connected and can communicate with IGNY8.'); + } else if (result?.success) { + // Basic connection works but not fully functional + const issues = result?.issues || []; + const healthChecks = result?.health_checks || {}; + + // Show specific warning based on what's missing + if (!healthChecks.plugin_connected) { + toast.warning('⚠️ WordPress is reachable but the plugin is not configured with an API key. Please add the API key in your WordPress plugin settings.'); + } else if (!healthChecks.bidirectional_communication) { + toast.warning('⚠️ Plugin is configured but cannot reach IGNY8 backend. Please check your WordPress site\'s outbound connections and firewall settings.'); + } else { + toast.warning(`⚠️ ${result?.message || 'Connection partially working. Some features may not function correctly.'}`); + } } else { - toast.error(`Connection test failed: ${result?.message || 'Unknown error'}`); + // Connection completely failed + toast.error(`❌ Connection test failed: ${result?.message || 'Unknown error'}`); } } catch (error: any) { toast.error(`Connection test failed: ${error.message}`);