fix: SUG-6 API key modal, SUG-4 project activity filter, WooCommerce health auth

- SUG-6: Replace auto-closing inline banner with persistent modal on Connect
  page — key stays visible until user clicks "Done"
- SUG-4: Filter health_metric_recorded/health_check from project detail activity
- WooCommerce: Accept consumer_key/consumer_secret credentials (preferred) with
  username/app_password fallback; fix health check to use WC endpoint and creds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
airano
2026-02-24 07:16:05 +03:30
parent 983d93c2a7
commit 1736779d69
5 changed files with 86 additions and 28 deletions

View File

@@ -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: