Update WordPressIntegrationForm.tsx

This commit is contained in:
alorig
2025-11-22 12:57:12 +05:00
parent e99bec5067
commit aa3574287d

View File

@@ -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}`);