diff --git a/core/dashboard/routes.py b/core/dashboard/routes.py index 7e1ccbc..f279325 100644 --- a/core/dashboard/routes.py +++ b/core/dashboard/routes.py @@ -918,12 +918,15 @@ async def get_project_detail(project_id: str) -> dict | None: # Get recent activity for this project audit_logger = get_audit_logger() - recent_entries = audit_logger.get_recent_entries(limit=20) + recent_entries = audit_logger.get_recent_entries(limit=60) project_activity = [ e for e in recent_entries - if e.get("metadata", {}).get("project_id") == project_id - or e.get("metadata", {}).get("site") == site_id + if ( + e.get("metadata", {}).get("project_id") == project_id + or e.get("metadata", {}).get("site") == site_id + ) + and e.get("event_type", "") not in ("health_metric_recorded", "health_check") ][:5] # Get cached health status diff --git a/core/health.py b/core/health.py index ebc206e..78d8c22 100644 --- a/core/health.py +++ b/core/health.py @@ -563,13 +563,26 @@ class HealthMonitor: try: import aiohttp - auth = aiohttp.BasicAuth( - config.username or "", - config.app_password or "", - ) + if plugin_type == "woocommerce": + # WooCommerce uses consumer_key/consumer_secret + ck = getattr(config, "consumer_key", None) or "" + cs = getattr(config, "consumer_secret", None) or "" + # consumer_key/consumer_secret may be in model_extra + if not ck and hasattr(config, "model_extra"): + ck = (config.model_extra or {}).get("consumer_key", "") + cs = (config.model_extra or {}).get("consumer_secret", "") + auth = aiohttp.BasicAuth(ck, cs) + auth_check_url = f"{config.url}/wp-json/wc/v3/system_status" + else: + auth = aiohttp.BasicAuth( + config.username or "", + config.app_password or "", + ) + auth_check_url = f"{config.url}/wp-json/wp/v2/users/me" + async with aiohttp.ClientSession(auth=auth) as session: async with session.get( - f"{config.url}/wp-json/wp/v2/users/me", + auth_check_url, timeout=aiohttp.ClientTimeout(total=10), ssl=False, ) as resp: diff --git a/core/templates/dashboard/connect.html b/core/templates/dashboard/connect.html index 96d8306..57bbf9b 100644 --- a/core/templates/dashboard/connect.html +++ b/core/templates/dashboard/connect.html @@ -28,14 +28,35 @@ {% endif %} - -