feat(admin): always-on dashboard widget + default retro days = 0

- Dashboard widget is now registered unconditionally. Header + content
  adapt: shows '⚠️ ошибки доставки' only when failed > 0, otherwise
  plain title with queue state (pending / sent-24h / failed).
  Pilot feedback: the conditional widget felt like the plugin was
  missing — users expect a persistent status readout.
- Retro default window changed from 7 days to 0 (no limit). Most
  pilot uses were 'dump everything since install', so 0 is the more
  useful default. User can still narrow to N days in the form.
- Spec §10 + §14 updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-04-18 00:12:45 +05:00
parent 2de8f0be57
commit dbdfc9afa9
6 changed files with 103 additions and 43 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ final class Settings_Page
{
$this->guard('cf7stg_retro');
$count = max(1, min(RetroImporter::MAX_COUNT, (int)($_POST['retro_count'] ?? 10)));
$days = max(0, (int)($_POST['retro_days'] ?? 7));
$days = max(0, (int)($_POST['retro_days'] ?? 0));
$repeat = !empty($_POST['retro_repeat']);
$result = RetroImporter::import($count, $days, $repeat);
$this->redirect_back(['retro_added' => (int)$result['added'], 'retro_skipped' => (int)$result['skipped']]);