=== MariaCare ===
Contributors: mariacare
Tags: security, malware, 2fa, performance, monitoring
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
Stable tag: 3.6.0
License: GPL-2.0-or-later

WordPress and server security with one-click fixes, a 5-minute server resource monitor with speed checks, a signed heartbeat to MariaCare Center, an MCP server so Claude can read the state and apply the fixes, two optional client CRM modules (High Soda: producers, distributors, small stores, products and their input materials; WBLC: a childcare center's families, children, attendance, billing and website leads), and an English / Spanish toggle on every page, all on the same dark design as maria.care.

== Description ==

MariaCare runs inside your existing WordPress admin — no third login to manage. It combines:

* WordPress & server security: pen-test style checks with one-click remediations — HTTPS/certificate health (Cloudflare-aware), file permissions, directory browsing, XML-RPC, DB prefix, custom login URL, enforced TOTP 2FA with backup codes, failed-login limiting and lockouts, security headers, username hiding, PHP-in-uploads blocking, PHP security patch level (distro backports recognised), unused and abandoned plugins, and a data-processing safety check for the hosting environment.
* Compromise detection: daily malware scans (core checksums, plugin integrity, backdoor and cryptominer signatures), a /proc process watch, and an integrity monitor for admins, site URLs, cron hooks and config files — with quarantine, resolve and re-baseline actions. Malicious IPs are blocked before PHP by an mu-plugin guard, and Cloudflare firewall exports can be analysed for block candidates.
* Server resource monitor: live CPU, memory, disk, I/O, network and top-process tiles with 24h/7d/30d history, sampled from /proc every 5 minutes — no external service or API key. Alert thresholds feed the security findings, a sustained-CPU anomaly check catches cryptojacking, and site self-checks cover TTFB, page/object caching, PHP + OPcache, database size/health/overhead, WP-Cron, the PHP error log, autoloaded-options weight, plugin count and image weight.
* MariaCare Center heartbeat: once paired, an Ed25519-signed heartbeat every 15 minutes carries findings, resource metrics, versions and the software inventory; the Center matches the inventory against the vulnerability feed, pushes findings back, raises an alert when heartbeats stop, and can request a scan, a check run or a sample through signed commands.
* MCP server: read tools (instance info, security and performance snapshots and reports, resource trend, ranked priority actions) plus action tools (on by default, switchable in Settings) so Claude can apply the one-click fixes, run checks and scans, triage findings, block IPs and snooze tasks itself. Every call is logged.
* High Soda CRM (per-site module, 3.1.0, extended in 3.2.0 and 3.3.0): the website's form-fill leads with a contact log and call / WhatsApp / text / email actions; producers (fábricas), distributors, supermarket chains with their branches, and small stores, each with commercial terms (payment days, method, invoicing, agreed unit price, procedure), several contacts and a notes timeline; deliveries with purchase-order / invoice numbers, product lines, due dates and a status that tracks what each client still owes; a cash book, monthly volumes and to-dos; products with three price tiers (wholesale, to small stores, retail) and a bill of input materials; input materials (the aluminum can, the syrup, the label…) with a unit cost in BOB or USD and a price history, so a change to the can price flows into every product's unit cost and margin. CSV export on every list. Switched on under Settings → Modules (on by default for highsoda.club).
* English / Spanish: every page, button, label and message of the plugin in both languages, with an EN / ES switch at the top of each page (per user) and a site default in Settings. Stored diagnostics (check details, scan findings, heartbeat payloads) and the MCP / WP-CLI output stay in English.

Everything is scoped to this one site. Version 3.0.0 removed the 2.x lead capture, CRM, Salesforce, Google Ads, GA4, Search Console, attribution, billing, Form-Fill Validation, email sequence and offline-conversion features: forms now post to Salesforce Web-to-Lead on their own.

== Installation ==

1. Download the plugin zip from https://maria.care/plugin/
2. In wp-admin, go to Plugins → Add New → Upload Plugin, and upload the zip.
3. Activate the plugin. Add `define('MARIACARE_ENC_KEY', '<64 hex chars>');` to wp-config.php so the Center signing secret can be stored encrypted (the plugin shows the line to add).
4. Open the new "MariaCare Security" menu in wp-admin.

== Getting started on a client site ==

1. **Security.** Run all checks, then work down the "Fix now" list — red rows have a fix button; the checks that need a human (2FA enrollment, login URL) say so. Enroll yourself in 2FA, then enforce it for all administrators.
2. **Performance.** The resource sampler starts on activation (add a real system cron hitting wp-cron.php every 5 minutes on quiet sites). Settings → Website Performance holds the alert thresholds, the maintenance window and extra URLs for the image-weight check.
3. **Pair with MariaCare Center** (Settings → MariaCare Center) with a one-time code; heartbeats and vulnerability matching start immediately.
4. **Let Claude help.** Settings → Claude / MCP Access → Generate API key, register it in Claude Code with the command shown. Claude can read everything and, with actions on, apply the one-click fixes.
5. **Upgrading from 2.x:** the version bump unschedules the removed crons and deletes the removed options; the old lead / Ads / GA4 / Search Console tables are left in place. Take a mysqldump, then `wp mariacare purge-legacy` lists them and `wp mariacare purge-legacy --yes` drops them.

== Changelog ==

= 3.6.0 =
* The whole in-admin app now uses the maria.care dark system: near-black surfaces, hairline cards, Inter for copy, Bebas Neue page titles, JetBrains Mono for every number, white-on-black primary buttons, one amber accent, tinted badges and banners, the Exchange-style tab bar, dark inputs and a dark native file picker. Every class name is unchanged; the Security, Performance, Settings and Users pages follow through the shared tokens. The sixteen High Soda CRM views were polished on top (page head, KPI strips, hairline tables, two-column detail pages), with no change to any field, action or URL.
* New **WBLC CRM** module (per-site switch `mcrm_wblc_enabled` under Settings → Modules; unset = on only for hosts containing "wblc"): a childcare center's management system meant to replace Procare at Willow Bend Learning Center. Families with their guardians (relationship, pickup and emergency-contact flags, employer), children (program derived from the date of birth and overridable, classroom, schedule, allergies, medical notes, pediatrician, photo consent, authorized pickups), classrooms with capacity and the Texas ratio defaults, staff with roles and CPR / first-aid / background-check dates, attendance (one row per child per day, check-in / check-out with who dropped off and picked up, no double check-in, check-out needs a check-in), staff clock-in / clock-out for the ratio board, tuition plans seeded from the published rates, monthly invoice generation from the plans and the enrolled children with a sibling discount, invoice lines, payments (card / ACH / check / cash / subsidy / scholarship), balances and 30 / 60 / 90-day aging, a year-end tuition statement per family, daily reports (meals, naps, diapers / bathroom, activities, mood, notes to the parent), immunizations with next-due dates, incidents with parent notification, the waitlist by requested start and program capacity, and a notes timeline. Website leads: every tour request and contact-form fill on wblc.maria.care is stored the moment it arrives (fields, child DOBs, date care is needed, message, the ad attribution: channel, UTM, gclid / fbclid / ttclid / li_fat_id / msclkid, landing page, referrer) through the `mariacare_wb_lead_capture` filter, with the same contact log, new-lead alert email, call / text / email actions and statuses new → contacted → tour scheduled → toured → enrolled / lost as the High Soda module; "Convert" turns a lead into a family with its guardians and children (status waitlist, requested start = date care is needed) or links it to an existing family. CSV export for families, children, leads, invoices, payments and attendance. Seventeen new tables (`mcrm_wb_*`), created idempotently, never dropped by uninstall.
* WP-CLI: `wp mariacare wb-import <file.json> [--dry-run]` (upsert of every list by natural keys) and `wp mariacare wb-seed --demo` / `--purge` (an obviously fictional demo dataset for screenshots and training, removed exactly by `--purge`; never run `--demo` on the live school).
* MCP: `wblc_overview`, `wblc_search`, `wblc_attendance`, `wblc_ratios`, `wblc_balances`, `wblc_leads`, `wblc_waitlist` (read-only) and `wblc_log_lead_touch` (needs `confirm: true`); the whole domain is absent from tools/list when the module is off.
* Spanish: 525 new strings. Tests: `tests/wblc-test.php` (118 checks, real SQL); `tests/highsoda-test.php` and the new test honour `MCRM_TEST_DSN` / `MCRM_TEST_USER` / `MCRM_TEST_PASS` for a non-socket database. Runbook: `docs/wblc-crm.md` in the repo.

= 3.5.0 =
* Renamed to "MariaCare" (plugin header, admin menu, MCP server title). The directory, prefix, capability, routes and .htaccess markers are unchanged.
* Created / received dates can be corrected after the fact: every edit form in the High Soda CRM (account, lead "Received on", delivery, product, material) has a date-time field; empty keeps the stored value. Typed in the site's timezone, stored in UTC; the JSON importer and the CLI accept `created_at` on every record too.
* "Send this lead to someone" on a lead: the same formatted email as the new-lead alert, to ticked users of the site and / or typed addresses, in Spanish or English (chosen per send), with an optional note on top; replies go to the sender, and the send is logged on the lead.
* Settings → Modules → New-lead alerts: "Language of the alert email" (the website's language — Spanish on highsoda.club — or a fixed Spanish / English), applied to the automatic alert and to "Re-send the alert" whatever language the person is using in the CRM.

= 3.4.1 =
* Login guard: failed-login lockouts and the blocklist escalation are keyed on the visitor's address behind Cloudflare (CF-Connecting-IP, trusted only when REMOTE_ADDR is a Cloudflare range), so five failures from one visitor no longer lock out everyone behind the same edge, and an edge can no longer be blocklisted.

= 3.4.0 =
* New-lead alerts: a formatted HTML email (lead card with what they asked, contact, where they came from; Open in the CRM / Call / WhatsApp / Email buttons; the lead's address as reply-to) goes to a distribution list set under Settings → Modules → New-lead alerts: tick users of the site and add any other addresses, with a "Send a test alert" button. The website's plain-text notification is only sent when the plugin did not handle the alert (list switched off or empty). Every alert is noted on the lead; "Re-send the alert email" on the lead page.
* Leads › Import from emails: paste the "Nuevo lead — highsoda.club" notification emails from the inbox (several at once, Gmail date lines understood in English and Spanish) or upload .eml / .mbox / .txt; the parser reads every field, maps the business type and volume back to their keys, keeps the attribution block, finds each message's date (Date: header or the line above the message), and shows a preview with editable dates and duplicate detection before anything is saved. Imported leads keep their original received date.

= 3.3.0 =
* High Soda CRM › Leads: every form fill on highsoda.club (distributor inquiry and contact form) is stored in the CRM the moment it arrives, with everything the person typed (name, business, phone, email, city, type of business, estimated volume, subject, message) and the ad attribution (channel, UTM, gclid / fbclid / ttclid / li_fat_id / msclkid, landing page, referrer). The theme's form handler calls the `mariacare_hs_lead_capture` filter after posting to Salesforce and the notification email now links to the CRM record. Leads tab: newest first, counts (new, not answered yet, today, last 7 days, converted), filters, CSV export, and reach-out buttons on every row and on the lead page: Call, WhatsApp (wa.me with a greeting), Text message, Mail client — each logs the touch, then hands the number or address to the phone / mail client. Send an email from the app (wp_mail, your address as reply-to, logged). "Log a contact made outside the app": channel, direction, when, what was said. Status new → contacted → qualified → converted / lost (a first outbound touch flips new to contacted on its own); convert a lead into a store / distributor / chain account (contact and notes carried over) or link it to an existing account (matches suggested by email, phone, business name). Overview shows the open leads and the count to answer. Two new tables (`mcrm_hs_leads`, `mcrm_hs_lead_activity`), never dropped by uninstall.
* `wp mariacare hs-leads-import <file.csv>` brings older leads in from a Salesforce Leads export (headers in English or Spanish; matched by Salesforce id, else email / phone + day, so a re-run updates). The JSON importer accepts a `leads` list too.
* Spanish file: 126 new strings. Tests cover capture through the filter, the contact log rules, email sending, convert / link, the counts, CSV export and the CSV / JSON imports.

= 3.2.0 =
* High Soda CRM, second pass (fits the La Paz workbook): new account type "supermarket chain" with branches (salas) as stores that belong to it; commercial terms on every account (supplier code at the client, payment terms in days, payment method, with / without invoice, how they order, agreed price per unit, order & collection procedure); several contacts per account plus a Directory of loose contacts (truckers, own team, suppliers); Deliveries (date, purchase order, invoice, reception and accounts-payable numbers, product lines in units, amount, due date from the payer's terms, status delivered → payment scheduled → paid, "owed per client" on the overview); Volumes (packs / units / kg per month and per shipment); Cash book (dated deposits and withdrawals with a running balance); To-dos (one-off and weekly, optionally tied to a client). Products gain a weight per unit; the price tiers read wholesale / to small stores / retail; input materials gain a supplier phone. Six new tables (`mcrm_hs_contacts`, `mcrm_hs_orders`, `mcrm_hs_order_lines`, `mcrm_hs_volumes`, `mcrm_hs_ledger`, `mcrm_hs_tasks`) and new columns added idempotently on upgrade; business data, never dropped. Accounts with deliveries on record cannot be deleted. CSV export for deliveries, contacts, cash book and volumes.
* `wp mariacare hs-import <file.json> [--dry-run]`: bulk upsert of accounts, contacts, notes, products, materials, bill of materials, deliveries, volumes, cash-book entries and to-dos from a JSON document, matched by natural keys so a re-run updates instead of duplicating. `scripts/highsoda-lapaz-xlsx.py` in the repo turns the La Paz workbook into that document.
* Spanish file extended (227 new strings); tests: `tests/highsoda-test.php` covers the 3.1.0 → 3.2.0 column upgrade, chains, contacts, deliveries, receivables, volumes, cash book, to-dos and the import.

= 3.1.0 =
* High Soda CRM module: new "High Soda CRM" page (`admin.php?page=mariacare-crm-highsoda`) with Overview, Producers, Distributors, Small stores, Products and Input materials tabs. Six new WP-prefixed tables (`mcrm_hs_accounts`, `mcrm_hs_notes`, `mcrm_hs_products`, `mcrm_hs_materials`, `mcrm_hs_material_prices`, `mcrm_hs_product_materials`), created by the activator / version-bump migration and never dropped by uninstall (business data). Accounts: type, name, legal name, NIT, contact, phone, WhatsApp, email, address, city, department (the nine Bolivian departamentos), store channel, "served by" (store → distributor or producer, distributor → producer), status (prospect / active / inactive), notes timeline. Products: producer, SKU, category, format, units per case, three per-unit prices, currency (BOB / USD). Input materials: category, unit, unit cost + currency, supplier; every cost change writes a dated price-history row. Bill of materials: quantity of each material per product unit; the product's unit cost is the sum converted into the product's currency at the USD→BOB rate from Settings (default 6.96), with margin per price tier. CSV export (UTF-8 BOM) for accounts, products and materials. Per-site switch `mcrm_highsoda_enabled` (Settings → Modules; unset = on only for hosts containing "highsoda"). Tests: `tests/highsoda-test.php` (real SQL against a scratch MariaDB).
* English / Spanish toggle: text domain `mariacare-crm` on every user-facing string (pages, menu, buttons, flash messages, validation, fix labels and results, Cloudflare to-dos, login-screen messages, pairing messages). Language resolved per request by `MariaCare_CRM_I18n`: the user's own choice (EN / ES pills at the top of every plugin page, or Settings → Language), else the site default (`mcrm_lang_default`: auto / en / es), else Spanish when the WordPress locale is es_*. Translations ship as `languages/mariacare-crm-es_ES.l10n.php` (WordPress 6.5 PHP format) registered through the plugin's own translations object, so no core language pack is needed. MCP tool output and WP-CLI are pinned to English; persisted check details, scan findings and heartbeat payloads were never translated. Tests: `tests/i18n-test.php` fails when any source string lacks a Spanish entry or its placeholders differ.
* Admin: sidebar labels translated; `MariaCare_CRM_Checks::label()` and `MariaCare_CRM_Remediation::fixes()` return translated labels (the constants keep the English keys the code compares against); the performance verdict exposes `label_text()` for display.
* Uninstall also removes `mcrm_lang_default`, `mcrm_highsoda_enabled`, `mcrm_hs_usd_bob` and the per-user `mcrm_lang` meta.

= 3.0.1 =
* `wp mariacare purge-legacy --yes` drops the legacy tables with foreign-key checks off for the session: the 2.x schema links contacts, opportunities and others to accounts, and the first run on a live site stopped at that constraint after dropping crm_leads.

= 3.0.0 =
* Renamed to MariaCare Security & Performance. The plugin is now only the security module, the performance module, the Center heartbeat and the MCP server. Removed, code and all: lead capture (REST intake, shortcode, `mcrm_capture_lead()`), the lead workbench, the Leads and Ads & Analytics pages, Salesforce Web-to-Lead forwarding, the Salesforce Leads mirror and CSV import, Google OAuth and the Google Ads / GA4 / Search Console syncs and tools, timestamp attribution, campaign verdicts and recommendations, lead scoring, pay-per-customer billing, Form-Fill Validation (Claude), email sequences and the Postmark sender, offline conversions, the CSV export / bulk delete / lookup endpoints, the hourly Center data sync (`mcrm_center_sync`), `wp mariacare export|import`, and the 24 lead/ads/search/insight MCP tools. Lead forms on the sites post straight to Salesforce Web-to-Lead.
* Kept unchanged on purpose: the plugin directory `mariacare-crm`, the `mcrm_` prefix, the `crm_` table prefix, the `manage_mariacare` capability, the MCP route `/wp-json/mariacare/v1/mcp` (serverInfo.name stays `mariacare-crm`), and the Center pairing / 15-minute heartbeat.
* Admin: top-level menu "MariaCare Security" with Security, Performance and Settings pages (plus the hidden Users page). Settings keeps performance thresholds and the maintenance window, adds a switchboard for the four security toggles and a notification email for scan findings, and keeps the MCP key, actions toggle and Center pairing. The old `mariacare-crm-security` bookmark lands on Security.
* MCP: 18 tools — get_instance_info (plugin, site, security and performance summary), get_security_report, security_status, performance_status, get_priority_actions (security + speed only), get_performance_report, get_performance_trend, and the 11 action tools (list_fixes, apply_fix, apply_baseline_hardening, run_checks, run_scan_step, resolve_finding, quarantine_finding, rebaseline_integrity, block_ip, unblock_ip, snooze_task).
* Heartbeat payload no longer carries an `integrations` block; everything else in schema v1 is unchanged.
* Data: fresh installs create only `crm_settings` and `crm_mcp_log`. The 3.0.0 upgrade unschedules `mcrm_google_sync`, `mcrm_gsc_sync`, `mcrm_sf_sync`, `mcrm_offline_conv_sync`, `mcrm_sequence_tick`, `mcrm_center_sync` and `mcrm_billing_daily`, and deletes the removed options and transients; it never drops a table. New `wp mariacare purge-legacy [--yes]` lists and, with `--yes`, drops every 2.x table (crm_leads, crm_accounts, crm_contacts, crm_opportunities, crm_events, crm_tasks, crm_notes, crm_activity, crm_alerts, crm_verticals, crm_campaign_map, crm_recommendations, crm_audit_log, crm_form_rejections, sf_imports, financial_entries, crm_financial_entries, crm_offline_conversions, crm_uploads, every crm_gads_*, crm_ga4_* and crm_gsc_* table, crm_sequences, crm_sequence_steps, crm_enrollments, crm_email_log, and the WP-tier mcrm_perf_audits), the legacy crm_settings rows (google, salesforce, leads, validation, billing, email, …), options and transients. Uninstall drops only the plugin's own tables; business history is never destroyed by deleting the plugin.
* Tests: tests/boot-test.php (boots the plugin with stubbed WordPress functions, asserts the 3.0.0 surface), tests/mcp-test.php trimmed to the remaining tools; attribution, follow-up and offline-conversion tests removed with their code.

= 2.19.1 =
* Dead-code purge, no behaviour change: removed the never-called lead-search lookup widget (initLookup JS, its CSS and the GET branch of app/lookup-api.php), get_vertical_label(), mcrm_ads_settings_save(), mcrm_num(), Performance_Module::environment(), Login_Guard::is_locked_out() and login_url_with_slug(), IP_Blocklist::is_blocked(), the standalone-era app/favicon and app/csv folders.

= 2.19.0 =
* Offline conversion upload to Google Ads (the closed-loop rule, CLAUDE.md §2): every lead that reaches Lifecycle Stage = Customer and carries a Google click id (gclid, gbraid or wbraid captured on the form) is queued in crm_offline_conversions and uploaded hourly with uploadClickConversions, with the customer's ACV (or the MariaCare fee on it, or no value) as the conversion value. Settings → Google connection: pick the "Customer" conversion action (listed from the daily Ads metadata sync, which now records action ids), choose the value mode and currency, switch the upload on; a status card shows the queue (pending / uploaded / rejected / skipped) and the last run, with "Validate pending" (Google checks without recording) and "Upload now". One upload per lead; only customers converted after the switch was turned on and within 60 days; Google's per-conversion rejections are kept on the row. ads_health now reports the real state (live / disabled / not_configured / ads_not_connected) instead of not_implemented; new MCP write tool offline_conversions_sync (confirm, validate_only). Generic Ads REST POST helper mcrm_gads_post(). Tests: tests/offline-conv-test.php + mcp-test coverage of a partial-failure upload.

= 2.18.1 =
* Lead Source values excluded from follow-up (Settings → Lead capture; default "Demo Site, Markets Hub"): the demo forms on maria.care share the CRM with real inquiries, so leads from those sources are now left out of get_stale_leads (named in its notes), the "who needs attention" list, automatic sequence enrollment and the Leads page funnel and insights. Billing was never affected (they never reach Customer). The Leads list still shows them; manual sequence enrollment still works.

= 2.18.0 =
* Form-Fill Validation, powered by Claude (Settings → Form-Fill Validation): every web form submission is judged before it becomes a lead — spam, bots, SEO/vendor pitches, mismatched intent, test submissions and incompleteness are rejected (dropped before CRM entry, or kept as Unqualified in flag mode) or flagged for a human look; valid leads are enriched with a duplicate check (email/phone), a service-area check and, for B2B accounts, a NAICS classification of the company. Verdict, score, reasons and enrichment are stored on the lead and shown on the lead page (with a re-run button); rejected submissions are counted per form and per reason without storing PII (crm_form_rejections). Fail-open: an API outage or refusal yields "unverified", never a lost lead. Rejected submissions are never forwarded to Salesforce, enrolled in sequences or notified. The API key is encrypted at rest (MARIACARE_ENC_KEY).
* Pay-per-customer billing view (Settings → Billing): account ACV, who pays ad spend (5% / 10% fee), retention window, customer types with their own ACV (selected by custom.customer_type), and the written customer definition. A customer is billable once Lifecycle Stage = Customer, the window has passed without churn, and it has not been invoiced; new invoiced_at / invoice_ref marks guarantee billed-once.
* MCP control plane (CLAUDE.md §3a), 11 new tools: leads_list, leads_get, leads_validate (confirm), billing_summary, mark_invoiced (confirm), ads_health (connection + offline-conversion sync status, reported honestly as not yet implemented, + campaign spend vs CRM-verified customers), security_status, performance_status, search_console_query, site_forms (form inventory, submissions, verdict mix, rejection rate by reason) and crm_resync (confirm). Write tools need the actions toggle and confirm:true. 42 tools in total.
* Test harness repaired (it had not loaded the action tools since 2.15.0) and extended with validation, billing and pipeline coverage.

= 2.17.0 =
* Salesforce Leads mirror (CLAUDE.md §5.1): Settings → Salesforce connection takes a Connected App (client-credentials flow; secret encrypted at rest) and the hourly `mcrm_sf_sync` cron pulls Leads modified since the last run (365 days on first run) into crm_leads — Id, name, company, email, phone, Lead Source, Status, Lifecycle Stage (API name configurable), created/modified dates, plus a JSON field map for UTM/GCLID/ACV custom fields and Lead Source include/exclude filters. Stage changes go through the shared stamping path (converted_at, customer_since/left_at, attribution, audit), so billing counts match the CSV import. Test connection and Sync now buttons. The CSV import stays as a fallback.

= 2.16.3 =
* New security check "PHP security patch level": compares the running PHP against the advisory table in scan-definitions.php (today PHP2Shell — CVE-2026-109618 / CVE-2026-109619, unauthenticated RCE, 21 Oct 2026). Debian/Ubuntu builds that backport the fix are recognised by package revision (Ubuntu USN-8948-1) instead of being flagged on the old version string; end-of-life branches fail; unknown builds warn with the fixed versions to verify.
* One-click "Turn off session.upload_progress" (the official partial mitigation; WordPress never uses the feature) via .user.ini under PHP-FPM/CGI or php_flag under mod_php, with revert; part of baseline hardening. The update is still the fix.

= 2.16.2 =
* Security headers check: a header repeated by a proxy (array value) no longer raises a PHP warning during checks.
* HTTPS check is Cloudflare-aware: behind the proxy it reports the auto-rotated edge certificate and warns only under 5 days, instead of a false "renewal may be broken" every quarter.

= 2.16.1 =
* Fix: three security checks (XML-RPC, updates, unused plugins) were dropped from 2.15.0 and reported "Check crashed"; restored.
* Fix: a captured lead with no last name failed to insert under strict SQL mode; NOT NULL columns are always written.
* Intake hardening: the REST endpoint now requires the per-day form token the shortcode embeds and a mandatory time-to-submit; the per-IP limit uses a Cloudflare-aware client IP that only trusts CF-Connecting-IP from Cloudflare's own ranges (`mcrm_client_ip()`, also for themes).
* Baseline hardening (deploys, apply_baseline_hardening) no longer edits wp-config.php; "Disable file editor" and "Hide PHP errors" stay one-click fixes.
* Salesforce forward falls back to "Unknown" / the default Company when the lead has NULLs; plain-text sequence bodies get linkified, HTML bodies are left as written; test sends no longer log against lead 0.
* Leads page: quick filter for leads captured by the site's forms.

= 2.16.0 =
* Native lead capture. Leads no longer have to come back from Salesforce by CSV: forms post to `POST /wp-json/mariacare/v1/lead` (same-site only, honeypot, time-to-submit and per-IP rate limit), drop in the `[mariacare_lead_form]` shortcode, or call `mcrm_capture_lead()` from a theme. gclid/gbraid/wbraid, UTMs, landing page, referrer, form page, consent (with text and time) and extra form fields (`custom` JSON) are stored on the lead at capture; repeat submissions update the existing lead and land on its timeline instead of creating duplicates.
* Capture first, forward optionally: Settings → Lead capture can forward every lead to Salesforce Web-to-Lead with the org ID, Lead Source, a default Company, a debug email and a JSON map of custom field IDs to lead paths. Everything is also written into the Lead Description so standard fields alone work. Owner notification email per new lead.
* Lead workbench (click any lead): details and extra fields, status / lifecycle / pipeline changes with the same conversion stamping as the import (a captured click or UTM campaign becomes the attribution snapshot with 100% confidence; otherwise click-timestamp correlation), value, next action, notes, tasks, a timeline of every event, enrollments, and "send to Salesforce".
* Email sequences (Leads → Sequences): steps with hour delays, triggers on lead captured / status reached / manual, source filter, consent gate, stop-on-customer, per-sequence sender; merge tags `{{first_name}}` `{{company}}` `{{custom.key}}` `{{unsubscribe_url}}`; sends via wp_mail or the Postmark API (token encrypted at rest); every mail carries an unsubscribe link and List-Unsubscribe headers; `/?mcrm_unsub=TOKEN` unsubscribes in one click; a 15-minute cron drains due steps in batches; retries twice then stops; each send logged (crm_email_log + timeline). Test sends from the editor.
* MCP: get_lead, update_lead (status/stage/next action/value, with conversion stamping) and add_lead_note.
* CSV export gains origin, UTM, gclid, landing page and consent columns. New tables: crm_activity, crm_sequences, crm_sequence_steps, crm_enrollments, crm_email_log (exported/imported by `wp mariacare export|import`, dropped on uninstall when data wipe is on).

= 2.15.0 =
* Four pages instead of six: Ads & Analytics is one page (spend, traffic, search and a single "Do next" list, read against leads and customers), and Security & Performance is one page (score, speed verdict, live server tiles, a ranked "Fix now" list with the fix buttons attached, every check in compact rows, compromise findings, defenses). Pages use three columns; the long "why this matters" paragraphs are gone — each row is the finding and the fix.
* The copy-paste "Hand the fixes to Claude" / "Fix it with Claude" boxes are removed. Claude now acts through the MCP server: new action tools list_fixes, apply_fix, apply_baseline_hardening, run_checks, run_scan_step, resolve_finding, quarantine_finding, rebaseline_integrity (needs confirm), block_ip, unblock_ip and snooze_task. A Settings toggle (on by default) makes the server read-only again. get_security_report now names the fix actions for each failing check.
* New one-click fixes: Update now (pending plugin and theme updates), Delete inactive plugins, Optimize database (expired transients, orphaned postmeta, old revisions, OPTIMIZE TABLE), Lock wp-config.php, Hide PHP errors (WP_DEBUG_DISPLAY off). A baseline-hardening set (uploads PHP block, directory listing, security headers, username hiding, XML-RPC, file editor, IP guard, wp-config, debug display) is applied idempotently by `wp mariacare harden` and on every deploy.
* False alarms fixed: the sustained-CPU anomaly now needs load above 0.75 per core and CPU over 50% busy as well as 2× the baseline (a weekly sync on a 1-vCPU host used to trip it), and resource findings close themselves an hour after the condition clears. The malware check no longer counts integrity or resource findings as malware. Cron hooks from well-known plugins (Yoast, W3 Total Cache, Site Kit, WooCommerce, …) and MariaCare's own plugins are never "unknown crons". WP-CLI's cache directory and page-cache directories are skipped by the permissions check. The default-prefix check is advisory (warn) — renaming live tables is riskier than the gain.
* Pipeline config is published to globals, so lead value and stage labels resolve correctly inside the embedded pages (they silently fell back to defaults since 2.5.0).
* New WP-CLI: `wp mariacare harden`, `wp mariacare checks`, `wp mariacare rebaseline`.

= 2.14.0 and earlier =
* See the git history of readme.txt before 3.0.0 for the 1.0.0–2.14.0 entries (CRM, Google Ads / GA4 / Search Console syncs, attribution, invoicing, PSI removal, process/integrity monitors, heartbeat and Center sync, Wordfence feed matching, data export/import).
