Three pilot-surfaced issues in one pass:
1. PhoneParser regex used '\s' in the candidate character class, so a
digit on a following flattened line bled into the phone. '+7977
6277470\n1' (phone + trailing checkbox value) parsed as 12 digits,
producing '+797762774701'. Replaced '\s' with a literal space so
newlines/tabs stop the candidate.
2. Custom-themed forms don't use 'your-name' / 'your-email' keys
(washanyanya.ru has text-211 / text-212 / name_user). Added
FieldDetector::find_name + find_email as fallbacks. Classifier
and MessageFormatter now call them if no standard key matches,
so 'Александр' in text-211 is recognised as a cyrillic name and
scored / displayed accordingly.
3. FlamingoHelper copied '_from_email' into 'your-email' without
validating it. Flamingo derives that meta from whatever field it
considers "first"; on phone-first forms it ends up holding the
phone number. Now we only copy _from_email if it contains '@',
and dropped the _from_name shortcut entirely — FieldDetector
handles the name via the actual field values.
Tests: +1 FieldDetectorTest (13 cases); +2 PhoneParserTest cases for
newline/tab bleeds; +1 ClassifierTest case; +1 MessageFormatterTest
case for custom field keys. Full suite 53/53 green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 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>
Pilot on washanyanya.ru exposed that Telegram Bot API rejects tel:
URLs in inline_keyboard with HTTP 400 "Wrong port number specified
in the URL". Queue was stuck on 5 items retrying the same failure
4 times each.
- MessageFormatter: always returns reply_markup = null. The phone
number is already rendered in the '📱 ...' line, and mobile
Telegram clients linkify it automatically.
- TelegramClient::is_permanent: treat all 4xx except 429 as permanent
client-side errors, so future payload-shape bugs surface in the
dashboard widget immediately instead of burning five retry cycles.
- MessageFormatterTest updated: the old test asserting tel: in
reply_markup is replaced with one asserting reply_markup is null
and the phone still appears in the text body.
- Spec §9 + §19 updated, §19's open question closed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Flamingo's '_fields' meta stores only the list of field NAMES with
null values; the actual values live in separate per-field meta keys
prefixed with '_field_'. The old extract_fields() returned the
null-valued '_fields' array on the first branch and never fell
through to the '_field_*' collector, so every retro Telegram message
showed '(не указан)' / '(пусто)' for every slot.
Also collect '_from_name' / '_from_email' (set by Akismet) as
convenience mappings to 'your-name' / 'your-email' so the formatter's
standard slots are populated for most submissions even when the form
uses custom field names like text-211 / name_user.
Pilot on washanyanya.ru caught this (retro delivered empty skeletons).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dispatcher::register_hooks() runs on plugins_loaded, which is AFTER
register_activation_hook fires. The custom recurrence 'cf7stg_every_minute'
was therefore unknown to wp_schedule_event during activation, and the
'cf7stg_dispatch' event silently failed to schedule — queue items never
got dispatched.
Pilot caught this on washanyanya.ru (23 items queued, 0 sent, 0 failed —
no cron hook firing at all).
Adding the filter directly inside Activator::schedule_events() makes the
custom schedule available in the same request as the wp_schedule_event
call, regardless of bootstrap order.
After updating the plugin, deactivate + reactivate is required to
re-trigger Activator::activate() so events get (re)scheduled.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The regex '/([a-z0-9])([A-Z])/' does not split on underscores, so
Interface_Spam_Source, Settings_Page, Dashboard_Widget stayed as
'interface_spam_source', 'settings_page', 'dashboard_widget' after
strtolower — no file matched. Added str_replace('_', '-', ...).
Then Interface_Spam_Source's slug became 'interface-spam-source',
and the candidate 'includes/sources/interface-' . \$slug doubled
the prefix into 'interface-interface-spam-source.php'. Replaced
that candidate family with a slug-as-filename fallback that maps
interface-* slugs directly to their files.
Sanity check on plugin bootstrap: 17/17 classes/interfaces resolve.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous plan/spec made honeypot a -5 weighted signal only. That is
insufficient to force 'spam' when the submission also has a RU phone
(+3), cyrillic name (+1), and meaningful text (+1) — a clean +5 cancels
-5, yielding 'unclear'. The honeypot test (test_honeypot_forces_spam_
even_with_phone) caught this.
Honeypot semantics: a filled hidden field is a bot by definition.
No combination of positive signals can make it a legitimate client.
Keeping the -5 weight on 'reasons' list for transparency, but adding
a hard override that sets label='spam' at the end of classify().
Caught by TDD on Task 7.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- xn--80aafmakjldfe1b5h.xn--p1ai decodes to "алквзелчкоеиа.рф", not
"вашаняня.рф". Correct Punycode for "вашаняня.рф" is
xn--80aae0ca7d8bb.xn--p1ai. Updated plan Task 2 test and spec §9.
- DomainFormatter strip-path regex '#[/?#].*$#' had the '#' delimiter
colliding with the literal '#' inside the character class. Switched
to tilde delimiters: '~[/?#].*$~'.
Both caught by TDD RED/GREEN loop on Task 3.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 bite-sized TDD tasks covering composer/phpunit setup, pure-logic
classes (DomainFormatter, PhoneParser, Classifier, MessageFormatter)
with full test code, integration classes (Queue, Dispatcher, TelegramClient,
CF7Source, RetroImporter), admin UI, lifecycle hooks, and a manual
pilot on washanyanya.ru.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>