Standalone WordPress plugin — installable on your own website
✓
Automatic updates directly in wp-admin
✓
Open hooks/filters for customization without touching core code
Installation på 4 trin
1
Download ZIP
Hent plugin-filen ovenfor — ingen registrering krævet.
2
Upload til WordPress
Gå til Plugins → Tilføj ny → Upload plugin og upload ZIP-filen.
3
Aktivér og licensér
Aktivér pluginnet og indtast din licensnøgle under Indstillinger.
4
Konfigurér og gå live
Tilføj behandlere, ydelser og shortcode — klar til bookinger.
Versionshistorik
Se hvad der er nyt i de seneste versioner.
v1.72.97August 2026SENESTE
▼
**🐛 BUGFIX: weekday headers in the Clinic overview/Calendar overview ("Mon, Tue, Wed...") stayed in Danish even with English selected.** Reported by Søren with a screenshot after v1.72.96's translation pass — the day names were hardcoded as a plain JS array in both `portal-app-klinik-oversigt.php` and `admin-bookings-calendar.js`, entirely outside WordPress's translation system.
v1.72.96August 2026
▼
**Clinic overview/Calendar overview — visual and UX refinements requested by Søren after live testing:**
No changes to the v1.72.95 security gate (`klinikoversigt_is_safe()`) or any AJAX/scoping logic — purely template, CSS, and JS presentation changes plus the translation catalog.
v1.72.95August 2026
▼
**🔴🔴🔴 CONFIRMED ROOT CAUSE + IMMEDIATE MITIGATION: Clinic overview was leaking cross-clinic therapist/booking data platform-wide on the SaaS installation.** v1.72.93 and v1.72.94's caching/service-worker theories were investigated in good faith but turned out not to be the actual cause — the real bug was found by inspecting tb-saas' own scoping code directly, confirmed with Søren via screenshots showing an active superadmin impersonation session during one repro.
v1.72.94August 2026
▼
**🔴🔴 SECURITY HARDENING (continued from v1.72.93): the PWA service worker (`portal-sw.js`) was itself caching personal/multi-tenant data locally on-device, independent of any server-side caching.** After shipping v1.72.93's server-side `nocache_headers()` fix, Søren reported the wrong-clinic data was still showing — on his phone specifically, not on desktop. Root cause: the service worker's "network first, cache as offline fallback" strategy for both `admin-ajax.php` calls and portal-page navigation wrote every successful response into the local Cache Storage, unconditionally. Any network hiccup afterwards (far more common on mobile data than on a desk connection) fell back to that locally cached copy — which could easily be a stale response captured during earlier testing under a different clinic/therapist. This is a per-device, client-side cache and is completely unaffected by server-side `Cache-Control` headers, so it needed its own fix.
v1.72.93August 2026
▼
**🔴🔴 SECURITY HARDENING (high priority): the therapist portal (`/tpadmin/`) sent no cache-control headers at all, on either its normal shortcode render path or its "naked" render path.** Reported by Søren: on mobile, Clinic overview showed bookings and therapist names from clinics he wasn't logged into via that session, while the same URL on desktop showed the correct, properly-scoped clinic. This is almost certainly a **pre-existing cross-session/cross-tenant caching issue affecting the whole therapist portal, not something new in Clinic overview** — Clinic overview is simply the first section to display multiple people's names in one view, making a cache mix-up visible for the first time. Other sections (Upcoming bookings, History, etc.) only ever show "your own" data, so the same underlying issue could just as easily have been serving one therapist's client bookings to a different therapist, silently.
v1.72.92August 2026
▼
**🔴 BUGFIX: Calendar overview/Clinic overview (v1.72.91) showed every therapist in the same colour.** Reported by Søren with screenshots from both wp-admin and the therapist portal (tb-saas). Root cause: newly created therapists all default to the same `color` value (`#c9a96e`, see `class-tb-admin-therapists.php`), which is fine for single-therapist contexts but made the new side-by-side calendar useless once two or more therapists shared the untouched default.
**🔴 BUGFIX: Clinic overview (therapist portal) didn't follow the clinic's selected design theme — filter box and calendar grid rendered as a mismatched dark block inside an otherwise correctly-themed card.** Reported by Søren with a tb-saas screenshot. Root cause: the new section used `var(--bg-card)` for its own surfaces, which — on at least this clinic's theme configuration — resolved inconsistently with the surrounding `.card`'s own `var(--bg2)` background (a real, separate design-token gap, not something this session tracks down further; flagged below).
v1.72.91August 2026
▼
**NEW: "Calendar overview" (clinic booking overview) — a week-based time-grid calendar showing all (or selected) therapists' bookings side by side, in BOTH wp-admin and the therapist portal.**
**wp-admin:** new tab under Bookings → Calendar overview (`admin/class-tb-admin-bookings-calendar.php`, `admin/bookings/page-calendar.php`, `admin/admin-bookings-calendar.js`). Deliberately built as new, standalone files rather than extending `class-tb-admin-bookings.php` (516 lines) or `admin-bookings.js` (already over the 600-line warning threshold) — same file-size discipline as the Events design-tab extraction.
**Therapist portal (tpadmin):** new "Clinic overview" section, visible to every logged-in therapist — shows the whole clinic's bookings, not just their own (`class-tb-therapist-portal-ajax-overview.php`, `sections/section-klinik-oversigt.php`, `portal-app-klinik-oversigt.php`). Own script file, per the established pattern (`portal-app.php` is already over the 1,000-line critical limit and is not touched).
Therapist selection is filterable via checkboxes (colour-coded using each therapist's existing `color` field) and is remembered per user: wp-admin stores the choice in `usermeta`; the therapist portal stores it directly on the therapist's own `tb_therapists` row (new `calendar_overview_prefs` column — therapists aren't WP users, so `usermeta` isn't available to them).
`TB_Booking::get_all()` gained an additive, backward-compatible `therapist_ids` (array) argument alongside the existing single `therapist_id`, used by the new week-data queries.
SaaS company-scoping is automatic and required no tb-saas changes: both new AJAX endpoints resolve the "allowed" therapist ID list via `TB_Therapist::get_all()` (already scoped through the existing `tb_therapists_where` filter) and intersect it with the requested selection before querying — a manipulated request can never reach another clinic's therapists.
New idempotent migration: `tb_therapists.calendar_overview_prefs TEXT NULL`.
v1.72.90August 2026
▼
**🔴 BUGFIX: `TB_Course::delete_product()` had no safeguards — a course product linked to an event could be deleted, breaking the event.** Reported by Søren: a course could be deleted while still linked to an event via `tb_events.linked_course_product_id`. Same unconditional-delete pattern as `TB_Service::delete()` (v1.72.88) and `TB_Therapist::delete()` (v1.72.89).
`TB_Course::delete_product( $id )` now returns `true|WP_Error`. Blocks deletion if:
Also now cleans up `tb_course_product_services` on successful delete (previously left orphaned rows — same "ghost link" bug class as the other two fixes).
Caller updated: `admin/class-tb-admin-courses.php::delete_course_product()` — new `delete_error` notice on the courses admin page.
See tb-saas v2.9.110 for the matching Shell refactor.
v1.72.89August 2026
▼
**🔴 BUGFIX: `TB_Therapist::delete()` had the same missing safeguard as `TB_Service::delete()` (v1.72.88) — unconditional hard delete, no future-bookings check.** Flagged as a related finding while fixing the service-delete gap; handled now at Søren's request.
`TB_Therapist::delete( $id )` now returns `true|WP_Error` instead of `void`. Blocks deletion if the therapist has upcoming, non-cancelled bookings (`tb_bookings.status != 'cancelled' AND booking_date >= CURDATE()`).
Caller updated: `admin/class-tb-admin-therapists.php::delete_therapist()` now shows a `delete_error` notice on the therapists list page instead of silently deleting (or silently doing nothing useful) regardless of outcome. No therapist-portal self-service delete exists for this one (only wp-admin calls `TB_Therapist::delete()`), so only one call site needed updating.
See tb-saas v2.9.109 for the matching Shell refactor (delegates to this method instead of duplicating the future-bookings check, mirroring the v2.9.108 service-delete refactor).
v1.72.88August 2026
▼
**🔴 BUGFIX: `TB_Service::delete()` had no safeguards at all — unconditional hard delete.** Reported by Søren while reviewing tb-saas' new service-delete feature (tb-saas v2.9.107): the SaaS Shell had built its own future-bookings/course-product safety checks on top of a direct `$wpdb` bypass of this method, duplicating logic that belongs here so it protects standalone plugin customers too, not just SaaS clinics.
`TB_Service::delete( $id )` now returns `true|WP_Error` instead of `void`. Blocks deletion if:
Also now cleans up `tb_discount_services` on successful delete (previously left orphaned rows — same "ghost link" bug class that `TB_Therapist::delete()` fixed for `tb_therapist_services` in v1.72.29).
Both callers updated to surface the new error: wp-admin (`admin/class-tb-admin-services.php` — new `delete_error` notice on the services list page) and the therapist portal's self-service delete (`class-tb-therapist-portal-ajax-services.php::ajax_delete_service()` — error message now reaches the existing `errMsg()` JS handler unchanged).
**Not yet fixed (separate, related finding):** `TB_Therapist::delete()` has the same "no future-booking check" gap — flagged for a future TB Admin UI session, out of scope here.
`admin/class-tb-admin-services.php` is now **671 lines** (was 654, already flagged) — 🔴 split required before the next feature added to this file.
See tb-saas v2.9.108 for the matching Shell refactor (delegates to this method instead of duplicating its checks).
v1.72.87August 2026
▼
**🔴 BUGFIX: "Primary background" in Events design had no visible effect.** Reported by Søren. Root cause: `--tb-ev-bg` was computed and set as a CSS variable in `class-tb-event-shortcode.php`, but nothing in the actual markup ever consumed it — only `--tb-ev-card-bg` ("Card background") was applied to anything visible. The same oversight existed in the admin design-tab's live preview (`class-tb-admin-events-design.php`), which read the `bg` field into a JS variable but applied `bgCard` to the preview wrapper instead.
**Fix:** `[tb_events]`'s outer grid container (the element wrapping all event cards) now actually uses `background: var(--tb-ev-bg)`, giving "Primary background" a real effect — it's the page-level background behind/around the cards, while "Card background" remains each individual event card's own background. The admin preview now shows the same two-layer structure (outer wrapper = Primary background, inner card = Card background) instead of collapsing both into one box.
See tb-saas v2.9.104 for the matching portal-preview fix (same root cause, same JS pattern was copied into the SaaS design tab).
v1.72.86August 2026
▼
**Feature: Events design tab now supports full granular colour override, matching the booking design tab.** Previously the Events design tab (TB core admin → Events → Design) only offered a choice of the 7 preset themes; individual colours could not be overridden. Now supports the same 13 colour fields (backgrounds, text, accent, borders, status colours), corner radius, and Google Font as `admin/settings/tab-design.php` — same "Reset" buttons and live preview pattern.
**File split:** `render_design()`/`save_design()` extracted from `admin/class-tb-admin-events.php` (931 lines, flagged for splitting before the next feature) into a new `admin/class-tb-admin-events-design.php`.
New `TB_Design_CSS::get_events_resolved_colors()` — mirror of `get_resolved_colors()`, resolves the `tb_events_design` option (theme + overrides) instead of `tb_booking_design`.
`[tb_events]` shortcode (`class-tb-event-shortcode.php`) now uses the resolved colours instead of only the theme preset, and gained a `--tb-ev-radius` CSS variable (was hardcoded 8px/4px throughout) plus optional Google Font import/`font-family`.
Storage format change: `tb_events_design` option now stores a full design array (`theme` + 13 colour fields + `radius` + `font_url` + `font_family`) instead of just `array('theme' => $key)`. Backward compatible — a site with only `theme` saved still resolves correctly (missing/empty override fields fall back to the theme's defaults).
No change required in tb-saas' `scope_events_design()` filter (`class-tbs-scope.php`) — it already passes the whole option value through unchanged, regardless of its shape. See tb-saas v2.9.102 for the matching per-clinic portal UI.
v1.72.85August 2026
▼
**Fix: growing backslashes in Design tab's "Font name" and "Google Font URL" fields on repeated save.** `admin/settings/tab-design.php`'s save handler read `$_POST['tb_d_' . $f]` directly, without `wp_unslash()`. WordPress always adds slashes to `$_POST` (`wp_magic_quotes()`); since the "Font name" field commonly contains single quotes (e.g. `'Lato', sans-serif`), each save round-tripped through the input added one more layer of backslashes to the stored value — same root cause as the earlier documentation-fields fix. Now wraps the read in `wp_unslash()` before sanitizing, matching the convention already used elsewhere in the plugin (e.g. `therapist-booking.php`'s locale handling).
Not a self-healing fix for already-corrupted values: any site with an already-slashed `tb_booking_design` option needs the affected field(s) re-entered and saved once after updating.
v1.72.84August 2026
▼
**New: neutral SaaS hook in `[tb_events]`'s AJAX registration JS.** If `window.tbEvCompanyId` is defined (only ever set by tb-saas, on a company's dedicated events page — see tb-saas v2.9.95), it's now appended as `tbs_company_id` in the `tb_event_register` AJAX POST — same fallback pattern `booking.js` already uses via `TB.tbs_company_id`. No-op for standalone plugin customers, who never set that global. Requested to support building a separate, company-scoped public events page in tb-saas.
v1.72.83August 2026
▼
**New: Events is now clearly marked as BETA** — Søren wants to keep testing/developing before it goes fully into production. Sidebar menu item now reads "Events (BETA)", and the Events admin page heading shows a small "BETA" badge as well, so the status is visible both from the menu and while actually on the page.
v1.72.82August 2026
▼
**Feature: course products can now be linked to multiple services, not just one.** Requested by Søren with a concrete example: a course should be able to cover both "Couples therapy" and "Couples therapy Online" — previously only one could be chosen.
New many-to-many table `tb_course_product_services` (product_id, service_id). Idempotent creation via `dbDelta()`, plus an automatic one-time backfill on `plugins_loaded`: every existing course product's current single `service_id` is copied into the new table, so existing courses keep working with zero manual action required.
The old `tb_course_products.service_id` column is kept (now documented as legacy) — set to the first-selected service purely for backward-compatible display in places that haven't been updated to read the new multi-service list. It no longer governs what a course code can be redeemed against.
**Redemption behavior change:** a course code is now valid for booking against *any* of its product's linked services, not just the single service that happened to be on the product at time of purchase. `TB_Course::validate_for_booking()` now checks membership in the full linked-service list (via the new join table) instead of exact equality against one stored ID.
Admin course product form (Courses → New/Edit course): single "Service" dropdown replaced with a scrollable multi-select checkbox list ("Services"). Requires at least one selected — server-side validated, redirects back with a notice if none chosen (the previous single-select relied on the browser's `required` attribute, which doesn't apply cleanly to a checkbox group).
`TB_Course::get_products()` / `get_product()` now attach `->service_ids` (array) and `->service_name` (comma-joined names, same property name as before for backward compatibility with existing display code) via a new `attach_services()` helper.
`[therapist_courses]` shortcode switched from its own raw query to `TB_Course::get_products()`, so it automatically shows all linked services (comma-separated in the existing pill) with no further changes needed.
Not tested in a real WordPress installation yet — verify: create/edit a course product with 2+ services selected, confirm both save and re-display correctly; purchase (or use an existing) course and confirm the code can be redeemed at step 6 against either linked service; confirm an existing (pre-upgrade) course product still shows its original single service correctly after the automatic backfill.
v1.72.81August 2026
▼
**Split of `public/js/booking.js` (1,067 lines, well over the mandatory 1,000-line threshold — overdue since two sessions ago).** Regular file-split (move HTML to templates) doesn't apply here since it's pure JS logic with no markup to extract; the file is a single jQuery IIFE with a shared closure scope (`state` object and helper functions used across every flow), which is what made a naive split unsafe without prior dependency analysis (see handover notes from the previous two sessions).
**Approach:** introduced a shared namespace object `window.TB_Booking`, created by `booking.js` and consumed by a new `public/js/booking-checkout.js`. `booking.js` exports its shared `state` object reference and helper functions (`showStep`, `showDone`, `escHtml`, `formatPrice`, `t`, `kr`, `pad`) onto the namespace; `booking-checkout.js` aliases them locally at the top of its own IIFE so none of the moved function bodies needed to change internally — pure relocation, not a rewrite.
**Split boundary (deliberately coarse — 2 files, not a finer per-domain split — to minimize risk on a revenue-critical, client-facing flow with no automated test coverage in this environment):**
`isNonceError()`/`retryWithFreshNonce()` (from v1.72.79's cache-independent nonce retry) are also exported from `booking-checkout.js`, since `initCancelPage()` in `booking.js` needs them too and the cancellation page never loads step 6.
`TB_Shortcodes::enqueue()` registers the new script as `tb-public-checkout` with `array('jquery','tb-public')` as its dependency array — guarantees `booking.js` (which creates the namespace) always loads and executes first.
Verified: brace/parenthesis balance in both files, and a full diff of all 41 top-level function names before vs. after the split confirms none were lost, duplicated, or renamed.
Not tested in a real WordPress installation yet — this touches the entire client-facing booking form (all three flows: therapy booking, gift card purchase, course purchase) plus the cancellation page, so a full run-through of each flow end-to-end is essential before considering this closed.
v1.72.80August 2026
▼
**Fix: the booking cancellation page and event cancellation page (reached via the "Cancel booking" / "Cancel registration" link in emails) did not follow the clinic's chosen design theme — always showed the same hardcoded dark colors regardless of what was selected in Settings → Design.** Root cause: `TB_Ajax_Payment::handle_cancel_page()` and `TB_Event_Ajax::handle_cancel_page()` render a fully standalone `` document directly (reached via `?tb_action=cancel` / `?tb_action=event_cancel` on the `init` hook), bypassing normal WordPress page rendering entirely — so `TB_Design_CSS::inject()`, which normally injects the selected theme's CSS variables on `wp_head`, never runs for these pages. Only the accent color was ever pulled from settings; everything else (backgrounds, text, borders, alert colors) was hardcoded to the "Dark" theme's original palette.
New `TB_Design_CSS::get_resolved_colors()` — resolves the currently active theme (preset + any saved per-color overrides from Settings → Design) into a plain color array, for use by contexts that render outside normal WP page output and therefore can't rely on `wp_head`. Built on `get_theme_presets()` (the complete 7-theme source), not on `inject()`'s own local theme array — so, as a side effect, these two cancellation pages correctly support the "Black-White" (mono) themes that `inject()` itself still doesn't (pre-existing, separate issue, out of scope here — see note in `class-tb-design-css.php`). `inject()` itself is untouched.
Both cancellation pages now derive all colors, corner radius, and (if set) the custom font from the resolved theme instead of hardcoded hex values. The "Cancel" button keeps a fixed danger-red regardless of theme (deliberate — stays legible as a destructive action even on the black/white mono themes where the accent color is black or white).
Tested and confirmed by Søren: selecting a non-default theme now correctly reflects on both the booking cancellation page and the event cancellation page.
v1.72.79August 2026
▼
**Fix: booking failed intermittently with "Security error. Reload the page and try again." and reloading the page did not help.** Root cause: the booking form's nonce (`wp_create_nonce('tb_booking_nonce')`) is baked into the page HTML at load time via `wp_localize_script`, and is only valid for up to 24 hours. On installations using a full-page cache (confirmed on this client's site: One.com's Performance Cache plugin, which uses Varnish with a **default TTL of 30 days**), the cached HTML — and its embedded nonce — can be served for far longer than the nonce's own lifetime. Once the cache is older than ~24h, every booking attempt against that cached page fails with the security error, until the cache happens to be purged/regenerated — matching the reported "periodic" pattern. A reload does not help because it simply re-serves the same stale cached page with the same expired nonce.
**Fix, cache-independent by design:** new AJAX action `tb_get_nonce` (`TB_Ajax_Booking::get_nonce()`) issues a fresh nonce on demand. `admin-ajax.php` POST requests are not cached by Varnish/similar full-page caches, so this endpoint always returns a current nonce regardless of how stale the surrounding page HTML is. `booking.js`: if `create_booking` or `cancel_booking` returns the security error, the client now silently fetches a fresh nonce via this endpoint, updates `TB.nonce`, and retries the original request **once** in the background — the visitor never sees the error. Chosen over a hosting-level cache-exclusion because it works regardless of caching configuration (and doesn't rely on remembering to configure exclusions correctly, on this host or any future one).
**Separate pre-existing bug found and fixed along the way:** `cancel_booking`'s AJAX call in `booking.js` never sent a `nonce` field at all, even though `check_ajax_referer('tb_booking_nonce', 'nonce')` was added to the handler as a CSRF fix in an earlier version (see CHANGELOG entry "Security A1"). This meant every cancellation attempt failed unconditionally with the same security error — unrelated to caching. Now sends `TB.nonce` and benefits from the same auto-retry logic above.
Not tested in a real WordPress installation yet — verify on the affected client's site: confirm bookings succeed even against a stale cached page (hard to reproduce without waiting out or manually manipulating the Performance Cache), and confirm booking cancellation now works at all (previously always failed).
v1.72.78August 2026
▼
**Replaced v1.72.77's MobilePay-only reservation approach with a simpler, unified policy — no payment is ever attempted at waitlist signup time, regardless of payment method; a fresh Stripe payment link is emailed only once a spot actually opens up.** Søren's explicit call: since reservation couldn't be implemented consistently for both gateways, he preferred one predictable flow over an asymmetric one (MobilePay reserves, Stripe rejects).
`TB_Event_Ajax::register_linked_course()`'s waitlist branch no longer branches on payment method at all — it never creates a payment order of any kind, simply confirms the waitlist spot and tells the person clearly that they don't need to pay now and will receive a payment link by email if/when a spot frees up.
`TB_Event_Registration::finalize_promoted_linked_course()` (called from the existing promotion logic — unchanged) is reworked: instead of capturing a reservation, it now generates a **fresh** Stripe Checkout session at the moment of promotion and emails a "You've got a spot — pay to confirm" link (new `TB_Email_Events::send_promoted_course_payment_link()`). The course stays unactivated until that payment actually completes — confirmed via the same `CR-` Stripe webhook handling already built in v1.72.76 (which activates the course and marks the linked event registration paid in one step, unchanged). A free (0 kr.) linked course skips the payment link entirely and activates immediately on promotion.
New idempotency guard added to Stripe's `CR-` webhook handler (`'pending' !== $course->status → return`), matching the one MobilePay already got in v1.72.77 — general robustness, and specifically relevant now that promotion can trigger a second wave of `CR-` payments.
v1.72.77's MobilePay reservation filter (`force_reservation_for_waitlisted_course()`) is now dormant — no `CR-` order is ever created while a registration is still on the waitlist, so the filter never has anything to act on. Left in place rather than removed (per the no-blind-deletion rule) — harmless as dead code, documented clearly in the surrounding comments so a future session isn't confused by it.
Confirmed (no code change needed): once payment completes, the course row's status flips from `pending` to `active` via the existing `TB_Course::activate()` — since the row already exists in `tb_courses` from the moment of the original waitlist signup, it's already visible in Courses' "Sold courses" admin list throughout, just with an updated status once paid.
Not tested in a real WordPress installation yet — verify: register for a full course-linked event and land on the waitlist (confirm no payment prompt appears at all), then free up a spot and confirm the promotion email with a working Stripe payment link arrives, and that the course/event only activate after that link is actually paid.
v1.72.77August 2026
▼
**New: waitlisted signups for a course-linked event now reserve payment instead of not charging at all — money is only actually withdrawn once a spot opens up.** Builds on v1.72.76's course-linked events. Previously, any waitlisted registration (linked or not) simply wasn't charged at all until confirmed; Søren asked specifically for course-linked waitlist signups to genuinely *reserve* the amount rather than defer charging entirely.
**MobilePay**: fully implemented using existing infrastructure, no new payment plumbing. Vipps' ePayment API always authorizes (reserves) before a separate capture call — `TB_MobilePay::create_payment()` already behaves this way. New `TB_Event_Registration::force_reservation_for_waitlisted_course()` hooks into the **existing** `tb_mobilepay_capture_mode` filter (already used by the global booking capture-mode setting) to force `'off'` (reservation-only, no auto-capture) specifically for a `CR-` order tied to a still-waitlisted course-linked registration — zero changes to `class-tb-mobilepay.php`'s booking-flow logic itself. The `CR-` webhook handler now checks whether the linked registration is still on the waitlist and, if so, skips activation/confirmation emails entirely (just logs) instead of activating a course nobody has a confirmed spot for yet. New idempotency guard (`'pending' !== $course->status → return`) also prevents duplicate activation emails if Vipps redelivers a webhook — a general robustness improvement, not just for this feature.
When the waitlisted person is later promoted (existing promotion logic in `cancel_registration_by_token()`/`cancel_single_registration()`, unchanged), new `TB_Event_Registration::finalize_promoted_linked_course()` fires: captures the reserved MobilePay payment, and only activates the course + sends confirmation emails if the capture succeeds. If capture fails (e.g. the reservation expired), the course is deliberately **not** activated — logged for manual follow-up rather than silently handing out a paid spot for free.
"Pay at the clinic" needs no reservation mechanism at all — the course simply stays unactivated until promotion, then activates directly with no payment step (unchanged principle, now applied consistently to the waitlist case too).
**Stripe is explicitly NOT supported for this** — this codebase has no existing authorize-now/capture-later mechanism for Stripe, and building one has a real footgun: card holds typically expire after ~7 days, which would silently and incorrectly fail for anyone waitlisted longer than that. Rather than build a partial/unreliable implementation, choosing Stripe while landing on the waitlist for a course-linked event now returns a clear error asking the person to choose MobilePay or "Pay at the clinic" instead. Flagging this explicitly rather than leaving a silent gap.
Not tested in a real WordPress installation yet — this touches live payment reservation/capture behavior and should be verified carefully in MobilePay test mode: register for a full course-linked event (waitlist), confirm the app shows a *reservation* (not a charge), then free up a spot and confirm the reservation is captured and confirmations are sent only at that point.
v1.72.76August 2026
▼
**New: an event can be linked to a paid course product from Courses — signing up for the event becomes a real course purchase, and buying the course directly auto-registers for the linked event.** Genuinely cross-component work spanning Events AND TB Booking Flow's course/purchase infrastructure (`class-tb-course.php`, `class-tb-ajax-products.php`, `class-tb-mobilepay.php`, `class-tb-stripe.php`) — flagged here and should be flagged in `handover-tb-booking.md` too, since several of those files were touched from this Events session. Three architecture decisions confirmed with Søren before building: (1) a linked event's price is **always** the course's price (server-enforced, not just UI — `TB_Event::save()` overrides any submitted price when a course is linked), (2) only **one** active event/series can be linked to a given course product at a time (enforced at save-time via new `TB_Event::course_product_already_linked()`, shown as a form error rather than failing silently), (3) a linked event uses the **course's** payment methods (MobilePay/Stripe/Pay at the clinic) instead of the event's own (which include "Pay on arrival") — for consistency with ordinary course purchases.
New `tb_events.linked_course_product_id`, `tb_event_registrations.linked_course_id`, `tb_courses.linked_event_cancel_token` columns (idempotent `ALTER`s).
**Direction 1 (event signup → course purchase):** new `TB_Event_Ajax::register_linked_course()` — creates a real `TB_Course::create()` row alongside the event registration(s), reuses the **existing** `CR-` order-id/payment pipeline unchanged (Stripe/MobilePay/`pay_at_clinic`) rather than inventing new payment plumbing. The `CR-` webhook handlers in `class-tb-mobilepay.php`/`class-tb-stripe.php` now check for a linked event registration after activating the course and activate/confirm that too, in the same webhook call.
**Direction 2 (course purchase → event signup):** new `TB_Event_Registration::maybe_register_for_linked_event_by_course_purchase()` — called from `class-tb-ajax-products.php::purchase_course()`'s immediate-activation paths (free/`pay_at_clinic`) and from both `CR-` webhook handlers' "not already linked from an event" branch, so it fires exactly once regardless of payment method. Registers for the whole series if the linked product is tied to a multi-day series. The new registration is marked paid immediately (the course purchase already covers it); if the event is full, the buyer lands on the event's waitlist but keeps the course regardless.
New "Based on course" picker in both the single-event form and the v1.72.74 series bulk-edit form (shared `render_course_link_field()`), auto-fills and locks the price field via JS when a course is selected, hides the event's own payment-method checkboxes (irrelevant once linked).
`[tb_events]` now shows the course's payment methods (with "Pay at the clinic" wording) instead of the event's own for a linked event, plus a short note that signing up is a course purchase.
Known limitation: if someone registers for the event directly first and *later* buys the linked course separately, the duplicate-registration guard (v1.72.62) silently skips creating a second registration — they get the course but the purchase isn't cross-linked to their existing signup. Acceptable edge case, not solved in this pass.
⚠️ `admin/class-tb-admin-events.php` is now **931 lines** — well past the point where a split should have already happened (flagged repeatedly since v1.72.72/74). Strongly recommend making this the very next piece of work before any further Events features.
Not tested in a real WordPress installation yet — this is the largest, most cross-cutting change made in this module so far and should be tested thoroughly end-to-end in both directions, with real MobilePay/Stripe test-mode payments, before relying on it in production.
v1.72.75August 2026
▼
**Fixed: a serious pre-existing bug — editing any single date of a series via the normal per-date edit form silently stripped its `series_id`, making the whole series disappear from the admin tree overview.** Reported by Søren as: "publish a series, then manually set every date back to draft — the parent event vanishes." Root cause: `TB_Admin_Events::save_event()` (the ordinary single-event edit form's save handler) never included `series_id` in the data passed to `TB_Event::save()`, and `TB_Event::save()` falls back to `NULL` whenever that key is absent entirely — so saving *any* edit to an existing series date (not just a status change) silently detached it from its series, regardless of what was actually changed. Likely present since Phase 1 (v1.72.49), only surfaced now that the admin tree view (v1.72.72) made a missing `series_id` visibly break something. Fix: `save_event()` now fetches the event's current `series_id` before saving and carries it through unchanged whenever editing an existing event — series creation (for brand-new events) is unaffected, and `save_series()` (the v1.72.74 bulk-edit form) was never affected, since it already set `series_id` explicitly.
This also resolves the second half of Søren's request — reverting a published event to "Draft" was never actually blocked by any validation (the status dropdown already allowed it); the only problem was the series-detaching side effect above. No separate "allow draft after published" feature was needed.
**Fixed: the admin tree's parent-event row showed a summed participant count (a person registered for all 3 days of a series counted as "3"), not a unique-participant count.** New `TB_Event_Registration::get_unique_participant_counts_for_series()` — counts `DISTINCT cancel_token` per status across all dates in a series (one signup, whether it covers 1 or all days, always shares one `cancel_token` — see `do_register()`), so the row now shows the actual number of people. Labelled "unique participants" in the UI to make the distinction clear against the per-date rows below, which still show raw per-date counts (correct there — the same person legitimately occupies a seat on each date they're registered for).
Not tested in a real WordPress installation yet — this fix in particular should be verified end-to-end: create a series, publish it, edit an individual date (e.g. revert to draft and back), and confirm the series stays grouped as one parent event throughout.
v1.72.74August 2026
▼
**New: "Edit" on the parent-event row now edits the WHOLE series at once.** New `?page=tb-events&edit_series=ID` view (`render_series_form()`) with the fields that are SHARED across the series: title, description, delivery method/venue/host, price, capacity, extra registration fields, payment methods, show-on-website. Deliberately WITHOUT date/time (each date keeps its own start/end, unchanged by this form) and WITHOUT status (still controlled via "Publish whole series"/"Cancel whole series" or individual per-date editing).
New `TB_Admin_Events::save_series()` — fetches each date-event's own `start_datetime`/`end_datetime`/`status` and preserves them unchanged, while updating the rest identically for all dates via the same `TB_Event::save()` a normal single-event edit uses — meaning, among other things, automatic Zoom/Teams meeting creation still happens correctly for dates that are missing a meeting link.
**New: individual "Cancel this date" links directly in the confirmation email** for a multi-day signup — no longer necessary to click through to the cancellation page and choose there (that option still exists, via the general "Cancel" link at the bottom). `TB_Event_Registration::do_register()` now stamps each event object with its own `registration_id`, so the email can build a precise per-date link (`?tb_action=event_cancel&token=…®=ID`).
The cancellation page now visually highlights the specific date if the link came from one of the new per-date links in the email (pure UX improvement — the actual cancellation still only happens via POST confirmation, not directly from the GET link, for the same security reason the whole page already followed).
⚠️ `admin/class-tb-admin-events.php` is now **819 lines** — well past the 600-line threshold, and growing with every new Events admin feature. Strongly recommend a dedicated split session before the next addition (e.g. extract `render_series_form()`/`save_series()` into their own file, same pattern as `class-tb-admin-events-participants.php`).
Not tested in a real WordPress installation yet.
v1.72.73August 2026
▼
**New: "Publish whole series"** on the parent-event row in the admin overview — the counterpart to "Cancel whole series" (v1.72.72). New `TB_Event::publish_series()` sets every date currently marked 'Draft' to 'Published' in one go (doesn't touch already-published or cancelled dates). Triggers automatic Zoom/Teams meeting creation for each date that's an online event, just like a normal single publish.
The button only shows when the series actually has draft dates to publish.
⚠️ `admin/class-tb-admin-events.php` is again just over 600 lines (625) — not urgent, but worth keeping an eye on.
Not tested in a real WordPress installation yet.
v1.72.72August 2026
▼
**File split (prerequisite for this work — both files were over the 600-line threshold):**
**New: the admin overview now shows multi-day series as a tree structure** — one parent event per series (combined title, date range, combined participant count across all days, combined status) with expandable sub-rows (one per date, "Show dates"). Reuses `TB_Event::get_grouped()` (already used by `[tb_events]`).
**New: "Cancel whole series"** on the parent row — new `TB_Event_Registration::cancel_series()` sets every date's status to 'cancelled' and cancels all active registrations. New `TB_Email_Events::send_admin_series_cancellation()` sends **one** combined cancellation email per unique participant (deduplicated on `cancel_token`) instead of one per date — a participant registered for the whole series gets one email listing all the dates they've lost.
**New: "Export all dates"** on the parent row — new `TB_Event_Registration::export_series_participants_csv()`, same CSV recipe as the existing per-date export, but with an extra "Date" column and all dates' participants combined into one file.
**New: individual cancellation of single dates.** The public cancellation page (`?tb_action=event_cancel`) now shows, for a multi-day signup, each active date with its own "Cancel this date" button, PLUS a combined "Cancel ALL dates" button (unchanged from v1.72.55). New `TB_Event_Registration::cancel_single_registration( $token, $registration_id )` — verifies ownership via token, cancels only the specific date, promotes the waitlist for that one date. New `TB_Email_Events::send_single_date_cancellation()` is explicit about WHICH date was cancelled and how many dates the participant is still registered for.
**The admin participant list** now shows, when a participant is registered for more than one date, BOTH a "Cancel this date" and a "Cancel whole series" button (decided with Søren — both options are kept, neither is removed).
No database changes in this version — everything builds on the existing schema.
Not tested in a real WordPress installation yet — this was a large, cohesive change (two file splits + four new features in the same pass); recommend a thorough test round, especially of the cancellation/cancellation-email flow itself, before production.
v1.72.71August 2026
▼
**Fix: the "X active steps" badge was never translated — a genuine bug
**More serious, caught during the fix:** the custom Python `.mo`
**Root-cause fix:** rewrote the compiler to parse plural blocks
**Verification this time was exhaustive, not spot-checks:** every one
**Lesson for future translation work in this repo:** any extraction
v1.72.70August 2026
▼
**New: English translations for the flexible 3-tier notification
Same 48 msgids also appended to `languages/therapist-booking.pot`
`.mo` recompiled. No `msgfmt`/`polib` available in this environment —
**Deliberately NOT translated in this pass — pre-existing gaps,
v1.72.69August 2026
▼
**New: 3 neutral hooks so a multi-tenant Shell can scope the GLOBAL `tb_notification_rules` table.** Unlike `tb_therapists`, `tb_services`, `tb_course_products` and `tb_giftcard_products`, this table had no `company_id` column and no filter hooks at all — a real multi-tenancy gap for the fallback layer of the 3-tier notification system (v1.72.63–68), found and fixed together with tb-saas in a joint SaaS Shell session. Booking-level and service-level rules needed no change — they're already scoped transitively via `booking_id`/`service_id`, which point into already-scoped tables.
`apply_filters( 'tb_notification_rules_where', '1=1' )` — added to `TB_Reminder::get_global_rules()`'s SELECT and `save_global_rules()`'s DELETE. Same pattern as `tb_events_where`/`tb_therapists_where`. No listeners = unchanged behavior.
`apply_filters( 'tb_notification_rule_insert', $data, $table )` — added to the shared `insert_rules()` helper, lets a Shell stamp extra columns (e.g. `company_id`) onto rows inserted into the global table specifically.
`apply_filters( 'tb_notification_global_rule_scope', '', $rule )` — added to `process_rule()`'s global branch. Needed because the hourly cron (`run_hourly_check()`) has no per-request "active company" context (unlike the other `_where` hooks, which run inside a request already bound to one company) — this lets a Shell restrict one specific global rule row to only match bookings of its own company, while rule rows without a company owner keep acting as a shared fallback for everyone (preserves current single-tenant-style behavior for existing installs).
No schema change in core — `company_id` on `tb_notification_rules` is added by the Shell (idempotent ALTER), same as `tb_therapists`/`tb_bookings`/`tb_services`.
v1.72.68August 2026
▼
**Fix to a misunderstanding from v1.72.63–65: the notification system now has a 3rd layer — service-specific setup.** Søren clarified that "override global" was meant to apply per-service (in the service catalog), not only per-booking, which had already been built. Priority order is now: **booking-specific** (if set) → **service-specific** (if set on the booking's service) → **global default**. Each layer is a full replacement of the next, not a merge — the same principle the booking override already followed.
New table `tb_service_notification_rules` (same structure as `tb_booking_notification_rules`, keyed on `service_id`). `tb_notification_sent.rule_source` ENUM extended with `'service'` (idempotent `ALTER ... MODIFY COLUMN`, since `dbDelta()` doesn't always update ENUM values on existing installations).
`TB_Reminder::get_effective_rules()` now looks up all 3 layers. `run_hourly_check()` restructured into 3 passes (global → service → booking), each correctly excluding bookings/services already covered by a higher-priority layer. The `insert_rules()` helper generalized to support all three rule tables (global/service/booking) via a shared scope-column parameter.
**wp-admin:** new "🔔 Notifications" button per service in the service catalog (`admin/class-tb-admin-services.php`, "Services" page) — same step UI as the booking modal. The file is now **654 lines** — crossed the 600-line warning threshold in this session.
**Therapist portal:** same button in the Services section, but visible ONLY to the therapist who created the service (same ownership rule as Edit/Delete — a service's notification setup applies to ALL bookings for that service, regardless of therapist, so only the creator can adjust it). `portal-app-notifications.php` extended (not a new file) with a shared `makeRowSet()` factory reused by both dialogs (booking + service) to avoid duplicating the row-building logic.
The badge in the Bookings → Reminders table now distinguishes between "Own setup" (booking level) and "Service setup" (service level).
Not tested in a real WordPress installation yet.
v1.72.67August 2026
▼
**Fix: the cancellation note box in the reminder email still didn't follow the theme** (found by Søren while testing v1.72.66 — the broader pass had missed this box because it used different hex codes than the other findings). `class-tb-email-reminder.php`'s "Want to cancel?" box was hardcoded to `#2a2018`/`#c9a96e`/`#c8c0b4` (dark/gold), unchanged by the previous fix. New shared CSS class `.tb-box-accent` (a card with a left accent border, for important notes) added to `wrap()` and used here.
Full review of all remaining hex colors in `class-tb-email-reminder.php`, `class-tb-email-booking.php`, `class-tb-email-events.php`, `class-tb-email-courses.php` confirmed no further occurrences — only the deliberately-unchanged Zoom/Teams/phone brand boxes (fixed light background, not theme-dependent) and the gift card graphic's own design system remain, both intentionally.
Not tested in a real WordPress installation yet.
v1.72.66August 2026
▼
**Fix: emails now fully follow the selected booking design theme, not just the accent color.** `TB_Email_Core::wrap()` (the shared HTML wrapper for ALL outgoing emails) previously only pulled the accent color from `tb_booking_design` — background, card background, body text color, and borders were hardcoded to the old "dark gold" look regardless of the selected theme. Reported by Søren: with the "Black-White Light" theme selected, the title text (black accent) became nearly invisible because it landed on the hardcoded dark background. `wrap()` now derives ALL colors via `TB_Design_CSS::get_theme_presets()` — the same source the portal itself uses — so emails match the selected theme 1:1.
Added `color-scheme`/`supported-color-schemes` meta tags (computed automatically from background brightness) to prevent mail clients (Apple Mail, Outlook, etc.) from guessing their own dark-mode look for the email. Gmail's own proprietary dark-mode heuristic cannot be guaranteed 100% neutralized by any known technique — this is best practice, not a guarantee across all clients.
Found and fixed several OTHER occurrences of the same "doesn't follow theme" bug, discovered while reviewing all email templates: `send_update()` (booking-changed email) had its OWN fully hardcoded table styling, separate from the `.details` class the other booking emails use — rewritten to the same pattern. New shared CSS classes `.muted`, `.tb-box`, `.tb-code-box` added to `wrap()`'s stylesheet and used to fix hardcoded muted-text colors and accent boxes in booking, event, and course emails (payment-pending box, course-code box, footer notes).
**Deliberately not touched:** the gift card graphic itself (`TB_Email_Giftcards::render_gc_card()`) has its own separate design system (3 fixed designs: minimal/warm/elegant, configured via the gift card designer) and is NOT part of the booking portal's theme — this is an intentional difference, not a bug. Only the ordinary email text outside the card graphic itself was fixed.
Not tested in a real WordPress installation yet.
v1.72.65August 2026
▼
**New: therapist-portal UI for booking-specific notification overrides — Phase 3 of 3 (completes the flexible notification system).** Builds on v1.72.63 (data model/engine) and v1.72.64 (wp-admin UI). See `handover-tb-booking.md`.
**⚠️ Component crossing, deliberately done in this session (Booking Flow chat), flagged in both `handover-tb-booking.md` and `handover-tb-admin.md` per the cross-component rule:** the therapist portal (`includes/therapist-portal/`) is normally TB Admin UI's territory. Agreed with Søren upfront to build all three phases together as one coherent feature rather than splitting across chats.
New "🔔 Notifications" button on each booking row in the portal's "Upcoming bookings" list — opens a dialog identical in behavior to the wp-admin one (v1.72.64): shows the booking's effective rules (its own override if any, otherwise the global rules as an editable suggestion), lets the therapist add/remove steps, and can clear the override to fall back to global.
New file `includes/therapist-portal/portal-app-notifications.php` — a deliberately **separate** `` block (own IIFE), following the same pattern established for `portal-app-calendar.php`/`portal-app-services.php`: `portal-app.php` is already over the 1,000-line mandatory-split threshold, so new portal JS keeps landing in its own small file rather than growing that monolith further.
New AJAX endpoints `tb_therapist_get_notification_rules` / `tb_therapist_save_notification_rules` in `class-tb-therapist-portal-ajax-booking.php`, registered both as `wp_ajax_` and `wp_ajax_nopriv_` (therapists aren't WP users). Ownership enforced server-side exactly like the existing edit/delete-booking endpoints: `booking->therapist_id !== $therapist->id` → rejected, a therapist can only see/edit notification rules for their own bookings.
⚠️ `includes/therapist-portal/portal-dashboard.php` is now **765 lines** — over the 600-line warning threshold (was already close before this session, at 743 per the previous handover). No split done this session; flagged for a future TB Admin UI session, consistent with that file's normal ownership.
Not tested in a real WordPress installation yet.
v1.72.64August 2026
▼
**New: wp-admin UI for the flexible notification system — Phase 2 of 3.** Builds on the data model/engine shipped in v1.72.63. See `handover-tb-booking.md`.
**Bookings → Reminders → "Global notification steps":** the old single checkbox + one text field is replaced with a repeatable list of steps. Each step: type (`Before appointment` / `After visit`), hours, message mode (`Standard text` / `Custom text` with its own textarea), enabled toggle. "+ Add step" adds rows client-side; save replaces the entire global rule set (delete + reinsert, indexed via matching array keys across the five posted fields per row — simpler and more robust than trying to diff against existing rows).
**New "🔔 Notifications" button per booking** in the bookings list — opens a modal showing that booking's *effective* rules (its own override if one exists, otherwise the global rules shown as an editable starting suggestion). Saving creates/replaces a booking-specific override; "Reset to global default" clears it (booking falls back to global on the next cron run). New AJAX endpoints `tb_get_booking_notification_rules` / `tb_save_booking_notification_rules` (new `admin-bookings.js` code, same `TB_Admin` nonce/ajax_url pattern as the existing edit-booking modal).
Upcoming-bookings table on the Reminders tab now shows "X of Y steps sent" (from `tb_notification_sent`) plus an "Own setup" badge when a booking has an override, instead of the old single sent/not-sent date. The reminder log table gained a "Step" column (`Before 26h` / `After 24h` etc.) alongside the existing Test/Auto badge.
Test-send button (existing, from v1.72.63) is unchanged — still sends all currently-effective enabled steps for the chosen booking.
Not tested in a real WordPress installation yet.
v1.72.63August 2026
▼
**New: flexible multi-step notification system for bookings — Phase 1 of 3 (data model + engine, no UI changes yet).** Replaces the previous hardcoded "single reminder, 26 hours before" behavior. See `handover-tb-booking.md` for full design rationale.
New tables: `tb_notification_rules` (global default steps — can now hold multiple steps, e.g. 48h and 2h before), `tb_booking_notification_rules` (per-booking override — if any row exists for a booking, it **fully replaces** the global rules for that booking, no merging), `tb_notification_sent` (tracks which rule has been sent for which booking — replaces the old single `tb_bookings.reminder_sent_at` flag, which could only represent one step). `tb_reminder_log` extended idempotently with `notification_type`/`offset_hours` for the audit trail.
Each rule has a `type`: `before` (X hours before `start_time`, the existing reminder concept, now configurable instead of hardcoded) or **`after`** (new — X hours after `end_time`, for a post-visit thank-you/satisfaction message).
Each rule supports `message_mode`: `standard` (built-in default text) or `custom` (admin-provided override text, per step). New `TB_Email_Reminder::send_after_visit()` / `TB_Email::send_after_visit()` for the after-visit template.
**One-time seed migration** on upgrade: existing `tb_settings['reminder_enabled']`/`['reminder_intro']` are migrated into a single global rule (`before`, 26h) so existing installations keep working identically after upgrading — no coverage gap.
`class-tb-reminder.php` cron loop (`run_hourly_check()`) rewritten to iterate active rules (global, excluding bookings with an override; then booking-specific) instead of one fixed SQL window.
`tb_bookings.reminder_sent_at` column is **kept** in the database (no data-loss risk) but is no longer written to by the new logic — see known UI limitation below.
⚠️ **Known Phase-1 limitation, by design:** `admin/bookings/page-reminders.php` (Settings panel, and the "Reminder sent" column in the test-send table) is **not yet updated** — it still reads the old single settings/`reminder_sent_at` and will look inaccurate (e.g. "not sent" even after a real send) until Phase 2 rebuilds that UI around the new rule model. The test-send button itself **is** rule-aware already: it sends all currently-effective steps (booking override if present, else all enabled global steps) for the chosen booking.
Not tested in a real WordPress installation yet.
v1.72.62August 2026
▼
**New: duplicate-registration guard.** `TB_Event::do_register()` (shared by single and series signups) now rejects a signup if the submitted email already has an active (registered or waitlisted) registration for that event/date — checked case-insensitively, and checked for **every** date in a series before creating any rows (atomic: no partial signup if a duplicate is found on a later date). A previously **cancelled** registration does not block re-registering — someone who cancelled can sign up again freely. Surfaces as a normal validation error ("This email address is already registered for this event...") through the existing `WP_Error` → `wp_send_json_error()` path, no AJAX handler changes needed.
**New: venue website/map link for physical events.** New optional `venue_url` field next to the existing address field in the event admin form (physical events only) — new `tb_events.venue_url` column (idempotent `ALTER`). Shown as a "See map/venue" link next to the address on `[tb_events]` and in the registration confirmation email.
Not tested in a real WordPress installation yet.
v1.72.61August 2026
▼
**New (Phase 7 of the Events module — completes the originally planned scope): broadcast a message to registered/waitlisted/cancelled participants.** See `handover-tb-events.md` for full scope and phase history.
New "Send message to participants" toggle on the participant list — a form with recipient checkboxes (Registered/Waitlist/Cancelled, defaulting to Registered+Waitlist checked), a subject line, and a message body.
Sends as an **individual email per recipient** (not one combined BCC) — matches the pattern already used for every other event email (confirmation, cancellation, waitlist promotion). New `TB_Email_Events::send_broadcast_message()` (+ `TB_Email` facade delegate) wraps the admin's message in the same visual template as the other event emails, with the event title/date shown for context.
New `TB_Admin_Events::send_broadcast()` (`admin_post_tb_send_event_broadcast`) — reuses the existing `TB_Event::get_registrations( $event_id, ['status' => ...] )` per selected group, so no new model method was needed (kept `class-tb-event.php` from growing further — see file-size note below).
**Deliberately scoped per-event/per-date**, matching the participant list's existing scope from Phase 4 — a note in the form explains that a series' broadcast has to be sent separately per date if it should reach everyone (no auto-fan-out across a series' shared `cancel_token` in this phase).
⚠️ `admin/class-tb-admin-events.php` is now **703 lines** — well past the 600-line warning threshold. This was the last planned phase for the Events module's original scope; **recommend a dedicated split session before further feature work on this file** (e.g. extract participant-list/export/broadcast into a companion `class-tb-admin-events-participants.php`, following the router+domain-class pattern already used elsewhere — courses, therapist-portal AJAX, etc.).
This completes Phases 1–7 of the originally planned Events module scope (DB/model/admin CRUD → series-by-dates → frontend signup/cancellation → participant list/export → payment → Zoom/Teams → broadcast messaging). Remaining known gaps, none newly introduced this session: waitlist-promoted paid registrations don't get an automatic new payment prompt (v1.72.58); a series' capacity/payment-method/extra-fields settings are only reliably in sync across dates if never edited individually per-date after series creation (v1.72.55/59).
Not tested in a real WordPress installation yet.
v1.72.60August 2026
▼
**New (Phase 6 of the Events module): automatic Zoom/Teams meeting creation for online events.** See `handover-tb-events.md` for full scope.
**Critical discovery made before writing any event-facing code:** both `TB_Zoom::create_meeting()` and `TB_Teams::create_meeting()` do a hardcoded `$wpdb->update()` on `tb_bookings` keyed by `$booking->id`. Reusing either method with a "pseudo-booking" object carrying an *event* ID would have silently overwritten a same-numbered booking's Zoom/Teams data in a completely unrelated table (`tb_events` and `tb_bookings` each have their own independent auto-increment counter, so ID collisions are routine, not rare). **Not shipped this way.**
Fix/prevention: extracted the pure Zoom/Teams API-calling logic into new `TB_Zoom::create_meeting_raw()` / `TB_Teams::create_meeting_raw()` — verified byte-for-byte behavior-preserving pure extraction (`create_meeting()` itself now just builds its booking-specific topic/agenda and delegates to the raw method, then does the exact same `tb_bookings` write as before). The raw methods have **zero database side effects**; callers own persistence. This is a refactor of TB Kalender-domain files done from within this Events session — flagged here and in `handover-tb-kalender.md` per the cross-component rule, but `create_meeting()`'s public behavior for existing bookings is unchanged (confirmed via brace-balance checks and a full read-through of both before/after versions).
New `TB_Event::maybe_create_online_meeting( $event_id )` — called automatically from `save()` whenever an online event is saved with `status = 'published'` and no meeting URL yet (idempotent: won't recreate on subsequent saves). For a series, each date gets its own independent meeting, consistent with how series occurrences are already treated everywhere else in this module.
**Zoom**: uses the clinic's existing global Zoom account (same credentials as the booking flow) — no per-event configuration needed beyond selecting "Zoom" as the provider.
**Teams**: fundamentally tied to a specific therapist's Microsoft 365 connection (unlike Zoom, there's no clinic-wide Teams identity in this codebase) — new "Host (Microsoft 365 therapist)" dropdown in the event admin form, shown only when Teams is selected, listing all therapists and flagging which ones aren't MS-connected. New `host_therapist_id` column on `tb_events` (idempotent `ALTER`).
The event admin form now shows the created meeting link (or an error hint) once available; the registration confirmation email now includes an actual "Join the meeting" link for online events instead of just the word "Online" — the link is only ever sent to confirmed registrants via email, never shown on the public `[tb_events]` listing itself.
⚠️ `includes/class-tb-event.php` is now **775 lines** — approaching the 1,000-line mandatory-split threshold. Strongly recommend splitting before Phase 7 (registration/payment methods into a companion file, as already flagged in v1.72.58's changelog entry).
Not yet built: the "broadcast a message to registered/cancelled participants" feature (Phase 7).
Not tested in a real WordPress installation yet — in particular, the Zoom/Teams extraction refactor and the new automatic meeting creation should both be verified end-to-end (including that existing booking Zoom/Teams flows are still completely unaffected) before relying on this in production.
v1.72.59August 2026
▼
**New: per-event payment method selection.** The event admin form now shows three checkboxes (MobilePay / Stripe / Pay on arrival) whenever price > 0 (JS-toggled on the price field, same "hidden fields don't block submit" pattern established in v1.72.52 — but this time not an issue since none of these checkboxes are `required`). New `allowed_payment_methods` column on `tb_events` (idempotent `ALTER`), new `TB_Event::get_allowed_payment_methods()`/`get_valid_payment_methods()`. Empty/missing selection falls back to all three — both for backward compatibility (events created before this version) and as a safety net against a priced event ending up with zero payment options.
`[tb_events]` now only renders the payment-method radio buttons the admin actually checked for that event (Stripe is additionally hidden if not configured, same as before). `TB_Event_Ajax::register()` independently re-validates the submitted `payment_method` server-side against the event's own allowed list — a manipulated POST can't bypass the admin's checkbox choice.
**New: live/test mode toggle for MobilePay and Stripe in Settings → Payment**, matching the toggle already built in BBB Sales/tb-saas. Each gateway now has a "Mode: Live/Test" radio plus two full credential sets (existing field names become the permanent "Live" slot — zero migration, no existing production credentials touched; new `_test`-suffixed fields hold the test/sandbox credentials). Both sets can be saved simultaneously, so switching between test and live no longer means overwriting and re-entering keys.
`TB_MobilePay`/`TB_Stripe` internals refactored around new `mode()`/`creds()` (MobilePay) and `mode()`/`secret_key()`/`webhook_secret()` (Stripe) helpers — every direct settings-array read for these keys (token fetch, payment creation, capture, cancel, status lookup, webhook signature check) now goes through one central mode-aware lookup instead of six separate duplicated reads.
MobilePay's old `mobilepay_sandbox` checkbox is removed from the settings UI (superseded by `mobilepay_mode`), but `TB_MobilePay::mode()` still reads it as a fallback when `mobilepay_mode` isn't saved yet, so existing installations behave identically until the admin next visits and saves the Payment tab.
Not tested in a real WordPress installation yet — test mode toggling and the payment-method checkboxes should both be verified end-to-end (including that "Test API connection"/"Test Stripe connection" correctly test whichever mode is currently saved) before relying on them in production.
v1.72.58August 2026
▼
**Correction to the v1.72.57 changelog entry:** the "mono theme CSS gap" flagged there was a false finding — retracted after Søren tested every theme directly on the booking portal and confirmed they all render correctly. Root cause of my mistake: `admin/settings/tab-design.php`'s theme-picker JS fills in every individual color field with the selected theme's concrete hex values before the form is submitted, so the saved `tb_booking_design` option always holds real colors — `TB_Design_CSS::inject()`'s own (incomplete) local theme list is never actually relied on for mono themes in practice. Not repeating this claim going forward.
**New (Phase 5 of the Events module): payment for priced events — Stripe + MobilePay.** See `handover-tb-events.md` for full scope.
Registering for a priced event (not on the waitlist) now offers a payment method choice — MobilePay, Stripe (only shown if configured), or "Pay on arrival" (no online payment; confirms immediately, payment handled in person, same convenience pattern as booking's `pay_at_clinic`) — and redirects the browser to the chosen gateway's checkout page. Waitlisted signups are never charged (no confirmed spot yet); this is a known, accepted limitation until a "waitlist promoted to a paid spot" payment-prompt flow is built in a future phase.
Same order-id-prefix convention as gift cards (`GC-`)/courses (`CR-`): `EV-{registration_id}-{timestamp}`. A series signup's single price (the series' representative occurrence's price — not summed across dates, matching how capacity/waitlist already work) is charged once, and the same `payment_order_id` is written to **every** registration row sharing that signup's `cancel_token`, so payment confirmation activates the whole series at once.
New `TB_Event::set_payment_order()`, `set_payment_status_by_token()`, `get_registrations_by_order_id()`, `activate_payment_by_order()` — mirrors `TB_GiftCard::activate()`/`TB_Course::activate()`.
`TB_MobilePay::maybe_update_gc_or_course()` (webhook dispatcher) and `TB_Stripe::maybe_update_gc_or_course()` (webhook + return-handler dispatcher) both extended with an `EV-` branch: on confirmed payment, marks the registration(s) paid and sends the real registration-confirmation email (no longer the "payment pending, clinic will follow up" placeholder text from Phase 3/4 — that placeholder is gone now that real payment is wired up).
`TB_MobilePay::lookup_capture_context()` extended with an `EV-` branch (capture amount comes from the event's price, looked up via the registration's `event_id` join) — needed for the existing immediate-capture flow in `TB_Ajax_Payment::handle_payment_return()` to work for events the same way it already does for bookings/gift cards/courses.
No changes needed to `TB_Ajax_Payment::handle_payment_return()`/`TB_Stripe::handle_return()` themselves — both already had generic (non-booking) branches driven entirely by `lookup_capture_context()`/`maybe_update_gc_or_course()`, which is precisely why extending those two dispatch points was sufficient.
⚠️ `includes/class-tb-event.php` is now **654 lines** — over the 600-line warning threshold (not yet at the 1,000-line mandatory-split point, but getting closer with each phase; worth planning a split — e.g. registration/payment methods into a companion `class-tb-event-registration.php` — before Phase 6 or 7 adds more).
Not yet built: actual Zoom/Teams meeting link creation (Phase 6), and the "broadcast a message to registered/cancelled participants" feature (Phase 7).
Not tested in a real WordPress installation yet — in particular, real payment flows should be tested in MobilePay/Stripe **test mode** first, same as any other payment-touching change.
v1.72.57August 2026
▼
**New: Events "Design" tab** — pick from the same 7 color themes as the booking portal (Dark, Light, Neutral, Modern Dark, Modern Light, Mono Dark, Mono Light) for the public `[tb_events]` shortcode. New tab alongside the events list (`admin.php?page=tb-events&tab=design`), stored in a new `tb_events_design` option, defaulting to `modern_light` (preserves the shortcode's existing light-card look for sites that don't touch the new setting).
New `TB_Design_CSS::get_theme_presets()` — the 7 theme color definitions, extracted as a shared static method so they don't need duplicating for this new consumer. Deliberately does **not** touch `admin/settings/tab-design.php`'s own local copy or `TB_Design_CSS::inject()` (zero risk to the already-working booking-portal design feature).
**Discovered, not fixed (flagging for a future TB Admin UI/Design session):** ~~`TB_Design_CSS::inject()`'s own theme list is missing `mono_dark`/`mono_light`...~~ **Corrected (Søren, after testing every theme directly on the booking portal):** this was NOT an actual bug. `admin/settings/tab-design.php`'s theme-picker JS fills in every individual color field (`tb_d_bg`, `tb_d_accent`, etc.) with the selected theme's concrete hex values BEFORE the form is saved — the saved overrides in `tb_booking_design` are therefore always concrete colors, regardless of whether `inject()`'s own local theme list contains the theme key or not. `inject()`'s incomplete list is only ever used as a fallback for empty fields, which never happens in practice. This claim must NOT be repeated going forward (per PROJEKT_KONTEKST.md's rule against re-asserting disproven findings).
`[tb_events]`'s cards, buttons, and form fields now read the selected theme via CSS custom properties (`--tb-ev-bg`, `--tb-ev-card-bg`, `--tb-ev-text`, `--tb-ev-accent`, etc.) instead of hardcoded colors, including the JS success/error message colors.
**New: "Export to Excel" on the participant list** — CSV download (UTF-8 BOM + semicolon delimiter, same convention as the existing accounting export in `TB_Accounting::export_csv()`, so it opens correctly in Excel with Danish characters/decimals without extra import steps). Columns: name, phone, email, comment, one column per the event's configured extra field (checkbox values as Yes/No), status, payment status, signup timestamp. Respects the currently active status filter (All/Registered/Waitlist/Cancelled) — exporting from the "Waitlist" tab exports only the waitlist, etc.
New `TB_Event::export_participants_csv()` (model) + `TB_Admin_Events::ajax_export_participants()` (`wp_ajax_tb_export_event_participants`, same `tb_admin_nonce` action/pattern as the accounting export — no JS needed, the link carries its own nonce).
⚠️ `admin/class-tb-admin-events.php` is now **605 lines** — just over the 600-line warning threshold (not yet at the 1,000-line mandatory-split point). Flagging per house rule; consider extracting the participant-list/export/design methods into a companion file before the next feature is added here.
Not tested in a real WordPress installation yet.
v1.72.56August 2026
▼
**New (Phase 4 of the Events module): admin participant list.** See `handover-tb-events.md` for full scope.
New "Participants (N)" button on each row of the Events admin list, opening a per-event participant list: name, phone, email, comment, extra registration fields (rendered as label/value using the event's own field config, checkbox values shown as Yes/No), status, payment status, and signup timestamp.
Status filter tabs (All / Registered / Waitlist / Cancelled), counts taken from the existing `TB_Event::get_registration_counts()`.
A participant who signed up for a multi-day series shows "Registered for X days in the series" under their name (new `TB_Event::get_series_signup_dates_count()`, counts non-cancelled rows sharing the same `cancel_token`).
New "Cancel" action per participant, routed through the **same** `TB_Event::cancel_registration_by_token()` used by the public self-service cancellation page — so cancelling a series participant from any one date's admin list cancels their spot on every date at once, triggers the same waitlist-promotion logic, and sends the same cancellation/promotion emails as a self-service cancellation would.
Deliberately scoped per-event/per-date for this phase (matches how the admin event list already manages series occurrences as separate rows) — a note on the participant list points to the fact that other dates in the same series have their own separate participant list.
Not yet built: payment (Phase 5), actual Zoom/Teams meeting link creation (Phase 6), and the "broadcast a message to registered/cancelled participants" feature (Phase 7).
Not tested in a real WordPress installation yet.
v1.72.55August 2026
▼
**Changed: multi-day event series now appear as ONE card on `[tb_events]`, not one card per date** — requested by Søren after testing Phase 3. A participant now signs up once for the whole series instead of separately per date.
New `TB_Event::get_grouped()` — groups `get_all()`'s flat result by `series_id` for display purposes; standalone events pass through unchanged.
`[tb_events]` now renders a single card per series: the series title, a bullet list of every date/time, and one "Sign up for the whole series" button/form. Price, capacity, waitlist setting, and extra-fields config are taken from the series' first (soonest) occurrence, since all occurrences share these by default when created via the admin UI's date-list series builder.
**Registration/model rework:** `TB_Event::register_participant()` (single) and the new `register_participant_series()` now share one internal `do_register()` implementation. A series signup creates one registration row **per date** (so admin's future per-date participant list still works, and each date keeps its own capacity count), but all rows from the same signup **share one `cancel_token`** — so a single cancellation link cancels attendance for every date in the series at once. Capacity/waitlist for a series is evaluated from its first occurrence, on the assumption all dates share the same `max_participants`/waitlist setting (true for series created normally; noted as a known limitation if dates are later edited individually to diverge).
`tb_event_registrations.cancel_token` changed from a `UNIQUE` key to a regular (non-unique) index, since series signups now intentionally reuse the same token across multiple rows. Existing installs (Søren's test site) get this via an idempotent `ALTER ... DROP INDEX` / `ADD KEY`, checked via `SHOW INDEX` so it only runs once.
`TB_Event::get_registration_by_token()`/`cancel_registration_by_token()` (singular) replaced with `get_registrations_by_token()`/`cancel_registration_by_token()` returning arrays — a single-event signup is simply the 1-row case, so no special-casing is needed anywhere downstream. Updated the only caller (`TB_Event_Ajax`, this same phase, not yet relied on elsewhere) accordingly.
`TB_Email_Events::send_registration_confirmation()`/`send_cancellation()` reworked to take the unified multi-event shape and render either one date or a full date list; subject lines and copy adapt automatically ("whole series" wording) when there's more than one date.
The standalone cancellation page (`?tb_action=event_cancel`) now lists every date in the series in its confirmation summary, and its "already cancelled"/success messages adapt to series vs. single wording.
`tb_event_register` AJAX action now takes `reg_type` (`single`|`series`) + `target_id` instead of always `event_id`, decided by which button the visitor clicked on the shortcode.
No change to the admin event list/edit screens in this pass — they still show each series occurrence as its own row with a "Part of series" tag, which remains useful for per-date admin editing; only the **public-facing** `[tb_events]` display and signup flow changed.
v1.72.54August 2026
▼
**Fixed: a published event with "Show on website" checked did not appear in `[tb_events]`** — reported by Søren. Root cause: `TB_Event::get_all()`'s `upcoming_only` filter compared `start_datetime` against `current_time('mysql')`, which uses **WordPress' own site timezone setting**. The rest of the plugin (booking availability, etc.) instead uses the plugin's own configurable timezone (`tb_get_timezone()` / `tb_settings['timezone']`, which falls back to WP's timezone only if unset). If those two differ — e.g. a test install left on the WordPress default of UTC while the plugin is configured for Europe/Copenhagen — a genuinely upcoming event could be wrongly judged as already past and filtered out.
Fix: `upcoming_only` now computes "now" via `tb_get_timezone()`, matching how the rest of the plugin reasons about the current local time.
No change to how event date/times are stored (still naive local wall-clock strings, unchanged since Phase 1).
v1.72.53August 2026
▼
**New (Phase 3 of the Events module): `[tb_events]` frontend shortcode + signup/cancellation.** See `handover-tb-events.md` for full scope.
New `[tb_events]` shortcode (`includes/class-tb-event-shortcode.php`) — lists upcoming, published, show-on-website events as cards (title, date/time, location or "Online", price, spots left / waitlist count). Each card has an inline "Sign up" form (name/phone/email/comment + the event's own configured extra fields), submitted via a small self-contained AJAX script embedded in the shortcode output (does not touch `booking.js`, which is already over the 1,000-line threshold).
New `TB_Event::register_participant()`, `cancel_registration_by_token()`, `get_registration_by_token()`, `get_registrations()` — capacity/waitlist logic: registers directly if there's room, otherwise waitlists if enabled (else rejects), and automatically promotes the oldest waitlisted registration when a registered participant cancels.
New `includes/class-tb-event-ajax.php` — `tb_event_register` AJAX handler (validates required/extra fields against the event's own config) and a standalone cancellation page at `?tb_action=event_cancel&token=...` (same GET-view/POST-confirm pattern, and the same dark-themed template, as the existing booking cancellation page).
New `includes/class-tb-email-events.php` (+ thin `TB_Email` facade delegates) — registration confirmation (or waitlist notice), cancellation confirmation, and "you've been promoted from the waitlist" emails. Each registration gets its own random 64-char `cancel_token` (new column on `tb_event_registrations`, added via an explicit idempotent `ALTER` since dbDelta's handling of `UNIQUE KEY` additions on an existing table is less predictable than plain column additions).
**Payment for priced events is intentionally NOT wired up yet (still Phase 5).** A priced event can be registered for right now — the registration is created with `payment_status = 'pending'`, the confirmation email says the clinic will follow up on payment manually, and nothing blocks the signup. This lets the whole capacity/waitlist/extra-fields/cancellation flow be tested end-to-end today without waiting for Stripe/MobilePay to be hooked in.
New neutral hooks (no listeners = no effect on standalone installs): `tb_event_registration_insert`, `tb_event_registration_created`, `tb_event_registration_cancelled`.
Not yet built: the admin participant list (Phase 4), payment (Phase 5), actual Zoom/Teams meeting link creation (Phase 6), and the "broadcast a message to registered/cancelled participants" feature (Phase 7).
Not tested in a real WordPress installation yet.
v1.72.52August 2026
▼
**Fixed: "Save" button silently did nothing in "Recurring series" mode** — reported by Søren after testing v1.72.51. Root cause: `tbEvToggleRecurrence()` only hid the single-event Start/End `<tr>` rows via `display:none`, but their ``s kept the `required` attribute. A hidden-but-required field still fails HTML5 constraint validation on submit, and since the field can't be focused (it's not rendered), the browser silently aborts the submission without showing any error bubble — indistinguishable from the button doing nothing. Switching back to "Standalone event" worked as expected because there the same fields are visible and reportable.
Fix: `tbEvToggleRecurrence()` now also toggles the `required` IDL property (not just visibility) on the Start/End inputs — `false` when hidden in series mode, `true` when shown in single mode.
v1.72.51August 2026
▼
**Changed: Events series creation now uses explicitly picked dates instead of a fixed recurrence rule.** A rule like "weekly for N occurrences" can't express "4 consecutive days" or "a Monday one week and a Wednesday the next" — reported by Søren after Phase 1 testing. The admin form's "Recurring series" mode now shows a shared start/end time-of-day plus a repeatable list of native date pickers (browser's own calendar widget per date, "+ Add date" to add more), instead of a recurrence-type dropdown + occurrence count.
New `TB_Event::generate_series_from_dates( $series_id, $dates, $template )` — builds one event per explicitly chosen date at the shared time-of-day. The old rule-based `generate_series_events()` is kept, unused but unremoved (per house rule against blind deletion), for potential future reuse.
`tb_event_series.recurrence_type` ENUM extended with a `'custom'` value (now the default) to represent date-list-based series. Existing sites get this via an explicit idempotent `ALTER ... MODIFY COLUMN` (same pattern as `delivery_type`/`calendar_type`) since `dbDelta()` doesn't reliably widen ENUMs on an already-existing table — not just the `dbDelta()` CREATE TABLE definition, which only applies to fresh installs.
Series creation now requires at least one date; submitting none redirects back to the form with a "Choose at least one date for the series" notice instead of silently creating an empty series.
No change to single-event creation/editing, or to the previously-tested extra-fields builder.
v1.72.50August 2026
▼
**Fixed: Events admin page incorrectly showed "Events requires the Clinic plan"** — copy-pasted from the Giftcards/Courses `locked_notice()` pattern without considering that Events should be included in every license plan (Solo/Clinic/Pro), not gated to a specific tier. Removed the plan-lock notice entirely; the page now renders unconditionally regardless of license status. No License Server change needed — the `'events'` feature key was never configured there, so this was purely a client-side admin-page restriction.
v1.72.49August 2026
▼
**New (Phase 1 of the Events module): database schema, `TB_Event` model, and admin CRUD for clinic events** — lectures/workshops/courses held by the clinic, separate from the therapist-based booking flow. See `handover-tb-events.md` for full scope and remaining phases.
New tables: `tb_event_series` (recurrence templates), `tb_events` (individual event occurrences — physical or online, price, capacity, waitlist flag, configurable extra registration fields as JSON, status), `tb_event_registrations` (schema only in this version — not yet written to; participant signup ships in a later phase).
New `includes/class-tb-event.php` — CRUD for events and series, series generation (`generate_series_events()`, weekly/biweekly/monthly), extra-field encode/decode, registration-count/capacity helpers.
New `admin/class-tb-admin-events.php` — new "Events" admin menu (list + create/edit). Create/edit supports: single event or recurring series (first occurrence's date/time is used as the series anchor; each generated occurrence can subsequently be edited/cancelled individually), physical/online (Zoom/Teams selector — meeting creation itself not yet wired up), price (0 = free), max participants (blank = unlimited) with optional waitlist, a repeatable "extra registration fields" builder (label/type/required, saved as JSON on the event), status (draft/published/cancelled), and a `[tb_events]` show-on-website toggle (shortcode not yet built).
Gated behind `TB_License::has_feature('events')`, same non-blocking `locked_notice()` pattern as Giftcards/Courses — no License Server changes required, this reuses the existing generic feature-flag mechanism.
Neutral hooks added for future SaaS Shell scoping (no listeners = no effect on standalone installations): `tb_events_where`, `tb_event_insert`, `tb_event_created`.
**Not yet built (see handover-tb-events.md for the full remaining plan):** `[tb_events]` frontend shortcode, participant signup/cancellation (AJAX), the admin participant list, payment (Stripe + MobilePay, same order-id-prefix pattern as gift cards/courses), actual Zoom/Teams meeting creation, and the "send a message to registered/cancelled participants" broadcast feature.
Not tested in a real WordPress installation yet.
v1.72.48August 2026
▼
**Refactor: reduced `therapist-booking.php` from 892 to 581 lines (no functional change) — proactive split before the file reached the 1,000-line mandatory-split threshold.**
Extracted `tb_inject_design_css()` (137 lines) into a new `TB_Design_CSS` class (`includes/class-tb-design-css.php`). Registered via `array('TB_Design_CSS','inject')` on the same `wp_head`/`admin_head` hooks as before.
Extracted the 6 Google Calendar AJAX wrapper functions (`tb_google_disconnect`, `get_calendars`, `set_calendar`, `test_slots`, `get_log`, `clear_log`) into a new `TB_Google_Ajax` class (`includes/class-tb-google-ajax.php`). No change to the underlying `TB_GoogleCalendar` integration.
Extracted the 6 equivalent Microsoft 365 AJAX wrapper functions into a new `TB_MS_Ajax` class (`includes/class-tb-ms-ajax.php`). No change to the underlying `TB_MicrosoftCalendar` integration.
**Minor consistency fix as part of the same move:** `tb_ms_get_calendars`/`tb_ms_set_calendar` had their `add_action()` registrations sitting outside `tb_init()` (directly after their function definitions) — an existing inconsistency versus the other 10 AJAX handlers, which register inside `tb_init()`. All 12 are now registered uniformly inside `tb_init()`. No functional change: these hooks only ever fire on an actual AJAX request, long after `plugins_loaded`/`tb_init()` has already run.
Not touched: timezone helpers (`tb_get_timezone`, `tb_local_to_timestamp`, `tb_format_time`), PWA service worker/manifest endpoints, `tb_license_ajax_handler()`, `tb_maybe_create_online_meeting()`, and the Microsoft OAuth login/redirect handlers — all remain in the main file unchanged.
Verified: brace count balances (62/62), no dangling references to the old global function names anywhere in the codebase.
v1.72.47August 2026
▼
**Fixed: several strings in the therapist portal's "Services" self-service tab were never translated to English** — reported by Søren via screenshot showing untranslated Danish text at the bottom of the services list on both `/tpadmin/` and standalone installations.
**Root cause:** the Services self-service tab (`sections/section-services.php`, built in v1.72.22–32) uses `esc_html_e()`/`esc_html__()` correctly with the `therapist-booking` text domain, but 12 of its strings were never added to the translation catalog (`languages/therapist-booking.pot` / `therapist-booking-en_US.po`/`.mo`) — the catalog was apparently not regenerated after that feature shipped. Older strings in the same file (Duration, Price, Color, etc.) were already translated correctly.
Fix: added the 12 missing `msgid`/`msgstr` pairs to the English (US) translation and to the `.pot` template, then recompiled `therapist-booking-en_US.mo`. No PHP code changes — the rendering code was already correct.
Affected strings included the bottom-of-list description text, "+ Create new service", "Hidden by the clinic", duration/notice/prep/cleanup time field labels, and the deposit helper text.
v1.72.46August 2026
▼
**Fixed: naked portal page (v1.72.45) rendered non-mobile-friendly — no viewport meta tag.** `render_shortcode()`'s own viewport `` tag is added via `add_action('wp_head', ...)`, but in the naked shell `wp_head()` fires *before* `do_shortcode()` runs — so the tag was registered too late and never actually output. Previously masked by the host theme's own boilerplate viewport tag in `header.php`; with the theme's header removed entirely, nothing was left to set it, so mobile browsers fell back to rendering at desktop width (~980px) and zooming out.
Fix: `maybe_serve_naked()` now writes its own explicit `` directly in the shell's ``, before `wp_head()` — independent of the shortcode's own (still-unfixed, but now irrelevant for this path) late hook registration.
Not yet tested on a real device.
v1.72.45August 2026
▼
**New: optional "naked" rendering of the therapist portal page** — fixes the portal looking cramped/messy on standalone installations whose theme wraps the `[therapist_portal]` shortcode in its own header/footer/sidebar, letting the host theme's typography and table CSS bleed into the portal's own design (same class of bug as the wp-admin `.form-table th` collision fixed in v1.72.44, except the culprit here is the customer's own theme instead of WP core).
New setting, Settings → General → "Therapist portal display": "Show the therapist portal without the theme's header/footer" (checkbox, saved as `tb_settings['portal_naked_page']`). **Default: off** — does not change behavior on any existing site unless explicitly enabled.
When enabled, `TB_Therapist_Portal::maybe_serve_naked()` (hooked on `template_redirect`, i.e. before the theme's template file loads) detects requests to the configured portal page and outputs a minimal HTML shell (`wp_head()`/`wp_body_open()`/shortcode output/`wp_footer()`) instead of letting the theme's `header.php`/`footer.php` render, then exits. Background color is pulled from the selected portal design theme (`tb_booking_design`) to avoid a white flash outside `.portal-wrap` before `tb_inject_design_css()` (hooked on `wp_head`) applies.
Not yet tested on a real standalone installation with a third-party theme.
v1.72.44August 2026
▼
**Fixed for real this time: wp-admin's "Create booking manually" calendar rendering only one narrow column instead of a 7-day grid** (v1.72.43's compactness fix didn't address the actual cause — Søren's follow-up screenshot showed it was worse, not better).
**Actual root cause found:** the calendar's `<table>` was nested inside `<table class="form-table">` (used to lay out the rest of the modal's fields). WordPress core's own admin CSS rule `.form-table th { width: 200px; ... }` is a plain descendant selector — it applies to **every** `<th>` nested anywhere under a `.form-table`, regardless of nesting depth, not just the form-table's own direct label cells. That forced all 7 of the calendar's weekday `<th>` header cells to 200px each, blowing the table out to ~1400px and leaving only the first column visible without horizontal scrolling. The existing, working blocked-dates calendar on the therapist edit page was never affected by this because it was deliberately built as a **standalone `<div>`, outside any `.form-table`** — not because of anything special in its CSS.
Fix, following Søren's request to use "the same method/view" as that working calendar:
Not yet tested in a real WordPress installation — please confirm all 7 columns render correctly and available days are clickable.
v1.72.43August 2026
▼
**Fixed: wp-admin's "Create booking manually" availability calendar stretched out too wide** (Søren reported it overflowing/dominating the modal on a narrow viewport, with columns cut off requiring horizontal scroll). Root cause: `#cb-cal-wrap`'s containing `<td>` had no explicit width (unlike its sibling rows, which all set `style="width:100%"` on their input/select), and the widget itself had no `max-width`/`box-sizing:border-box`, so it could grow past its intended bounds under `table-layout:auto` (the WordPress admin `.form-table` default).
Fix: `<td style="width:100%">` on the calendar row (matches sibling rows' convention) + `box-sizing:border-box` added throughout the widget + explicit `max-width:280px` on `#cb-cal-wrap` so it renders as a compact, contained date-picker rather than stretching the full modal width.
Also made cells noticeably more compact per Søren's request ("takes up too much space"): day-cell height 32px → 24px, font sizes reduced (title 13px→12px, weekday headers 10px→9px, day numbers 13px→11px, status line 11px→10px), tighter padding throughout.
Portal calendar (`portal-app.php`) not touched — Søren confirmed it already renders fine; only the wp-admin one needed this.
**Separate, flagged but not addressed here:** Søren also reported the tb-saas SaaS Shell's own "Add booking" calendar (clinic portal, `[tbs_portal]` → Bookings tab) loads but never marks any days as available. This is tb-saas' own separate implementation — not present in this session's working files (only `therapist-booking` was uploaded). Needs the tb-saas ZIP uploaded in a SaaS Shell session to diagnose; not investigated or touched here.
v1.72.42August 2026
▼
**New: availability calendar in the manual booking-creation modals (both wp-admin "Create booking manually" and the therapist portal's "Create booking"), replacing the plain ``.** The calendar marks which days actually have at least one open slot for the selected therapist/service — the exact same data source (`TB_Therapist::get_available_dates_in_month()`) the public booking form already uses, so staff see precisely what a client would see instead of guessing a date and hoping it's free.
**New shared helper `TB_Therapist::get_available_dates_in_month( $therapist_id, $service_id, $year, $month )`** — extracted from `TB_Ajax_Booking::get_available_dates()` so the day-loop/blocked-dates logic isn't duplicated across the public, wp-admin, and portal call sites. `TB_Ajax_Booking::get_available_dates()` now just calls the shared helper (no behavior change, still public/nopriv, still no nonce — read-only data).
**New AJAX endpoints:**
**wp-admin calendar** (`admin/bookings/page-list.php` + new code in `admin/admin-bookings.js`): activates once a therapist is selected, refetches on month navigation and on service change (duration affects which slots — and therefore days — are available). Light theme to match the white modal. New CSS in `admin.css` (`.cb-cal-*`).
**Portal calendar** (`includes/therapist-portal/portal-dashboard.php` + new code in `includes/therapist-portal/portal-app.php`): same behavior, dark/branded theme matching the portal's existing CSS custom properties (consistent with the existing blocked-dates calendar's visual language). Online-only blocked days get the same teal treatment as elsewhere.
Both calendars mark available days clicking sets the (now hidden) date field and fires the existing 'change' handling, so the rest of the create-booking flow (slot loading, submit) is untouched.
**Bonus fix, same bug as v1.72.40 but in wp-admin:** `ajax_admin_create_booking()` also hardcoded `delivery_type => 'physical'`, so manually creating an online booking from wp-admin never created a Zoom/Teams meeting either. Now derives it from the selected service, same fix as the portal got last version.
New translatable string `"Fetching available days..."` added to the language catalog (`.po`/`.pot`) with English translation "Fetching available days...". `.mo` recompiled (1,201 records, +1, verified).
⚠️ **File-size note:** `includes/therapist-portal/portal-app.php` grew from 1,025 → 1,140 lines with this feature — already over the 1,000-line mandatory-split threshold before this change (split previously deferred by agreement), and now further over it. Not split in this session; flagged clearly for the next TB Admin UI/Booking Flow session. `admin/admin-bookings.js` (the new file from this session's earlier split) is at 462 lines — comfortably under the threshold even after adding the calendar.
⚠️ Crosses into TB Booking Flow chat's territory (`class-tb-ajax-booking.php`, portal booking files already shared with that chat from v1.72.40's work). Flagged in both `handover-tb-admin.md` and `handover-tb-booking.md`.
Not yet tested in a real WordPress installation.
v1.72.41August 2026
▼
**File split: `admin/admin.js` (1,209 lines, over the mandatory 1,000-line split threshold) → `admin.js` (886 lines) + new `admin/admin-bookings.js` (351 lines).** Pure structural move, no behavior changes — done ahead of adding an availability-calendar picker to the manual booking modal, so the new feature doesn't land on top of an already-oversized file.
Extracted sections (all self-contained — verified no shared variables/functions leak across the split): "Live booking status" (inline status dropdown on the bookings list), "Delete booking" (delete-booking confirmation dialog), "Manual booking creation" (the "Create booking manually" modal), "Edit booking" (the edit-booking modal).
`admin-bookings.js` is enqueued alongside `admin.js` (`class-tb-admin.php`), with `tb-admin` as an explicit dependency so it loads after and can use the same `TB_Admin` localization object.
Each extracted section wrapped in its own `$(function(){...})` — safe since jQuery supports multiple document-ready registrations across script files.
Brace/paren balance verified on both files after the split (0/0 diff on each).
v1.72.40August 2026
▼
**Fixed: manually creating an online booking in the therapist portal ("Create booking") never created a Zoom/Teams meeting.** `ajax_portal_create_booking()` hardcoded `delivery_type => 'physical'` regardless of the selected service, so `tb_maybe_create_online_meeting()`'s `if ( $delivery !== 'online' ) return;` check always short-circuited. Now derives `delivery_type` from the selected service's own `delivery_type` — matches the behavior of the public booking flow, which already sends the service's real delivery type.
**Removed the "optional — client chooses" (both) service delivery type entirely.** It was effectively unused in practice — clients always pick a service that's already explicitly online or physical — and added meaningless complexity throughout the booking flow (a whole radio-selection UI block, JS branching, and extra filtering conditions that existed purely for a state nobody used). `delivery_type` is now `physical` / `online` / `phone` only, everywhere.
⚠️ Crosses into TB Booking Flow chat's territory (`class-tb-ajax-booking.php`, `class-tb-shortcodes.php`, `booking.js`) — one cohesive piece of work, solved together here per Søren's request. Flagged in both `handover-tb-admin.md` and `handover-tb-booking.md`.
Not yet tested in a real WordPress installation.
v1.72.39August 2026
▼
**Fixed: manual booking creation in the therapist portal ("Create booking", `terapeutadmin`/`tpadmin`) always failed with "Security error. Reload the page and try again."** Root cause: `ajax_portal_create_booking()` has required CSRF verification (`verify_csrf()`) since v1.71.50, but the "Create booking" form's submit handler in `portal-app.php` built its `fetch()` call directly with a raw `URLSearchParams` object, bypassing the shared `post()` helper that every other AJAX call in the file uses to attach `TB_PORTAL.nonce`. The nonce was therefore never sent, and the request failed CSRF verification on every attempt — this has been broken since v1.71.50 (June 2026), only reported now.
Fix: added `nonce: TB_PORTAL.nonce || ''` to the request body, matching the pattern used everywhere else in the file. No changes to the server-side handler, database, or public API.
Same `portal-app.php` file serves both `terapeutadmin` (standalone installations) and `tpadmin` (SaaS therapists on bookbookbook.dk) — the fix covers both without any tb-saas changes.
`pbLoadSlots()` (fetches available time slots for the form) intentionally still doesn't send a nonce — `ajax_portal_get_slots()` is read-only and was never CSRF-protected, so this was correct as-is.
v1.72.38August 2026
▼
**Fixed: therapist portal calendar legend (Availability tab, `terapeutadmin`/`tpadmin`) was missing the "online only" option.** The underlying feature — a 4th day-blocking state ("online only", teal, added in v1.71.58) — was already fully functional in the portal (toggle cycle in `ajax_toggle_blocked()`, rendering in `portal-app.php`), but `portal-dashboard.php`'s legend below the calendar only ever listed Morning/Afternoon/Full day/None. The wp-admin equivalent legend (`admin/therapists/page-form.php`) already listed all 4 states — only the portal's legend was ever updated to match when the feature was originally built. This made the feature effectively undiscoverable for therapists, even though clicking a day 4 times already produced the correct teal "online only" state.
Added the missing "Online only" legend entry to `portal-dashboard.php` (teal swatch, same color as the calendar JS uses).
Fixed the click-count hint text ("Click a day to cycle — 4th click removes.") — with the online state in the cycle, it now takes 5 clicks to return to "none", not 4. Text updated accordingly.
No changes to the toggle logic, database, or public API — display/text only.
"Online only" was also missing entirely from the language catalog (used in wp-admin's legend too, but was never translatable). Added to `languages/therapist-booking-en_US.po`/`.mo` ("Online only"), along with the updated 5-click hint text. `.mo` recompiled from the `.po` source with the same custom script as v1.72.37 (no `msgfmt`/PHP CLI available) — verified: old `.mo` had 1,198 records (1,197 real + header) vs. the `.po`'s 1,198 unique `(msgctxt, msgid)` entries at the time (a pre-existing 1-entry gap from an earlier manual build, now also incidentally closed); new `.mo` has 1,200 records (1,199 real + header), correctly reflecting the one new string.
v1.72.37August 2026
▼
**Fixed stale help text for "Portal session timeout" setting** (`admin/settings/tab-generelt.php`) — still said "Default is 480 min. (8 hours)" and the input's own fallback value defaulted to 480, both left over from before v1.72.36 changed the code default to 2880 min (48h). Text now also mentions the new 60-day hard cap. Purely a display fix — the setting itself already worked correctly regardless of what the help text said; sites with an explicitly saved `portal_session_minutes` value (e.g. an old test value) are unaffected either way, since the field always takes precedence over the code default.
English translation (`languages/therapist-booking-en_US.po`/`.mo`) updated to match. `.mo` was recompiled from scratch with a small custom script (no `msgfmt`/PHP CLI available in this environment) — verified against all 1,198 catalog entries including the 10 plural-form strings and the UTF-8 charset header, to avoid silently dropping unrelated translations.
v1.72.36August 2026
▼
**Therapist portal session: extended sliding idle timeout (8h → 48h) + new hard cap (60 days).** Session already renewed on every valid request (`renew_session()`, unchanged) — only the default `portal_session_minutes` changed (480 → 2880). New: a `login_at` timestamp is now stored in the session cookie payload at login and preserved (not reset) across renewals; `get_session_therapist()`/`get_session_locale()` now also reject the session once `MAX_SESSION_DAYS` (60, a fixed class constant — not an admin setting) has elapsed since the original login, regardless of activity. This affects both `terapeutadmin` (standalone installations) and `tpadmin` (SaaS therapists on bookbookbook.dk, since tb-saas's magic-login flow mirrors this exact cookie format) with no tb-saas changes required.
Cookies from before this version (no `login_at` field) are grandfathered: the 60-day clock starts at the first renewal after upgrade instead of logging everyone out immediately.
`clear_session()` is now called explicitly when a session is rejected for exceeding the hard cap, so a permanently-expired cookie doesn't linger client-side.
v1.72.35August 2026
▼
**Merged forward from a parallel calendar-feature session that had drifted onto a stale v1.72.16 base** — this release ports the one still-missing piece (an explicit "set active calendar" action) onto the real v1.72.34 codebase, verified line-by-line against it so nothing from the parallel `services`/`booking_page_url`/portal-menu-centering work (v1.72.17–v1.72.34) was disturbed.
**New: "Set as active calendar" button** in each of the three therapist-portal calendar panels (CalDAV/Google/Microsoft 365). Previously `calendar_type` only ever changed as a side effect of connecting or disconnecting a provider — a therapist connected to both Google and Microsoft 365 (tokens for both can coexist) had no way to freely switch between them without redoing OAuth. New `ajax_set_calendar_type()` in `class-tb-therapist-portal-ajax-calendar.php` validates the target type actually has valid credentials (and, for Microsoft, the `microsoft_calendar` license feature) before switching.
**Fixed:** `class-tb-google-calendar.php::disconnect()` and `class-tb-microsoft-calendar.php::disconnect()` previously reset `calendar_type` back to `'caldav'` unconditionally, even when disconnecting a provider that wasn't the active one. Both now only reset `calendar_type` when the provider being disconnected was actually the active one.
⚠️ Not yet tested in a real WordPress installation.
v1.72.34August 2026
▼
**Fixed: therapist portal top bar (header + nav menu) was full viewport width while the content below (`.portal-body`) was capped at `max-width:1000px` and centered** — on wide viewports this made the menu/header visually detached from the content card beneath it. Not SaaS-specific (checked tb-saas's own CSS for class-name collisions — none found, it uses a `.tbs-` prefix); this was a plain pre-existing gap in `portal-styles.php`.
`.portal-header` and `.portal-nav` now also get `max-width:1000px; margin-left:auto; margin-right:auto;`, matching `.portal-body` exactly. Mobile breakpoint (`@media(max-width:680px)`) unaffected — viewport is already narrower than 1000px there.
v1.72.33August 2026
▼
**New: `TB_Booking::get_booking_page_url( $therapist_id = 0 )` centralizes resolution of the booking page URL, replacing duplicated logic at 8 call sites across 6 files.** Default behavior is unchanged for standalone installations — permalink of `tb_settings['booking_page']`, falling back to `home_url('/')`.
**New neutral filter: `tb_booking_page_url( $default_url, $therapist_id )`.** No listeners = no effect. Lets a Shell (e.g. tb-saas) override the booking URL per company on a multi-tenant installation, where a single global `booking_page` option makes no sense — each clinic should have its own booking page.
Fixes the symptom where the therapist portal's deep link (`/tpadmin/` → Services) was empty on the SaaS installation, since `$booking_base_url` resolved to an empty string there.
v1.72.32August 2026
▼
**New: services hidden from the website by the clinic (`show_on_website = 0`, set in wp-admin or the create/edit dialog) are now grayed out in the portal's Services list, with the toggle disabled.** A therapist can see the service exists but cannot activate it themselves — matches the clinic-level flag being the clinic's own decision, not something an individual therapist should be able to override.
Row opacity dims further (0.35) and the toggle switch gets `disabled`, `cursor:not-allowed`, and a tooltip explaining why. A small "Hidden by the clinic" badge appears next to the service name.
No backend change needed — `ajax_save_services()` already only processes what's actually submitted, and a disabled checkbox's state is simply left untouched by the therapist (JS still reads its current value for the save payload, unaffected by the browser's native disabled-field submission behavior since the save flow builds its own POST body).
v1.72.31August 2026
▼
**Course-corrected after v1.72.23's approach turned out to be wrong.** Per Søren's clarification of the actual intended process: every service with "Show on web" (show_on_website) checked should always appear in the client's general service list (step 2) — regardless of whether any therapist currently offers it. Filtering by therapist availability belongs at the *therapist-selection* step (step 3), where a therapist who doesn't offer the selected service should be grayed out and unselectable — not by hiding the entire service from the list.
**`TB_Ajax_Booking::get_all_services()`**: removed the `get_offered_ids()` filtering added in v1.72.23. Now only gates on `show_on_website` (plus the existing deep-link preselect override and online-only filter), matching the originally intended, simpler process.
**Found and fixed the actual bug behind "a therapist can be selected for a service they don't offer, regardless of their toggle state": `TB_Ajax_Booking::get_therapists()`'s query for which therapists offer a service was missing `AND active = 1`.** It only checked whether a link *row existed*, not whether it was active — so a therapist who had toggled a service off still showed as offering it. The frontend (`booking.js`) already correctly grays out and disables selection for therapists where `offers_service` is false — this was purely a data bug in the query feeding that logic, now fixed with the missing `active = 1` condition.
`TB_Service::get_offered_ids()` (introduced in v1.72.23, only ever used by the now-reverted check) removed as dead code.
⚠️ Not yet tested in a real WordPress installation.
v1.72.30August 2026
▼
**Fixed the actual toggle bug: v1.72.24–26 had wrongly coupled the portal list toggle to a global flag (`active` in v1.72.24, `show_on_website` in v1.72.26) for a therapist's own services, and forced their own link to always stay active regardless of the toggle.** This meant a therapist could never turn off their own display for a service they created, and the toggle's effect was inconsistent depending on ownership — exactly the reported symptoms ("toggle doesn't work when a service has multiple therapists linked", "can't remove display for myself").
**Reverted to the correct, final three-layer model, fully clarified by Søren:**
`ajax_save_services()`: removed the owned-service special-casing entirely — the toggle now always just updates the therapist's own link's `active` field, for every service, and never touches `tb_services.active`/`show_on_website` again.
Portal template (`section-services.php`): toggle's checked-state always reflects the therapist's own link, regardless of ownership.
Clarified for Søren: a service still showing to clients after one therapist turns their own display off, because a *different, real* therapist still has it active, is expected behavior for a shared multi-therapist service — not a bug (this is distinct from the now-fixed "ghost therapist" issue in v1.72.29, which was about *nonexistent* therapists).
⚠️ Not yet tested in a real WordPress installation.
v1.72.29August 2026
▼
**Found the "ghost therapist" bug behind the remaining inconsistent visibility: `TB_Therapist::delete()` never cleaned up `tb_therapist_services` when a therapist was deleted.** Every deleted therapist (including test accounts created during earlier sessions) left orphaned link rows behind, still referencing their now-nonexistent `therapist_id`. These orphaned rows were counted as real therapists everywhere the table was queried without checking the therapist still exists — explaining both the inflated/inconsistent "X therapists" counts in the admin services list and services appearing bookable to clients even when no real, current therapist actually offers them (since `get_offered_ids()` had no way to distinguish a real active link from a ghost one).
`TB_Therapist::delete()` now also deletes the therapist's `tb_therapist_services` rows.
`TB_Service::get_offered_ids()` (drives client-facing visibility, `get_all_services()`) now `JOIN`s against `tb_therapists` — a link can only count as "offered" if the therapist it references still exists. Defense in depth: even if some future code path again left orphaned rows, they could never again make a service appear bookable.
`admin/class-tb-admin-services.php`'s therapist-count column: same `JOIN` hardening applied.
New idempotent migration in `class-tb-database.php`: deletes any existing orphaned `tb_therapist_services` rows (referencing a deleted therapist) on upgrade — safe to run repeatedly, no-op once clean.
Confirmed via code audit: only two places in the entire codebase delete from `tb_therapist_services` — `TB_Service::delete()` (when the whole service is deleted) and the newly-fixed `TB_Therapist::delete()` (when the whole therapist is deleted). No code path deletes a single link as a side effect of toggling active/visible anymore (v1.72.28's fix confirmed complete on audit).
⚠️ Not yet tested in a real WordPress installation.
v1.72.28August 2026
▼
**Fixed the real root cause of the unreliable service toggle: the admin therapist-edit page's save handler deleted the therapist↔service link entirely for any unchecked service, instead of just marking it inactive.** `admin/class-tb-admin-therapists.php`'s save handler built its `$links` array by skipping any unchecked service (`if ( empty( $svc_data['active'] ) ) continue;`) before calling `TB_Service::save_therapist_links()` — which in turn deleted any existing link not present in the submitted set. Every time an admin saved that page with a service unchecked, the underlying `tb_therapist_services` row was permanently removed, not deactivated. This explains the whole saga across v1.72.23–27: unreliable toggle behavior, services showing "None" (no linked therapist) in the admin list, and the fluctuating therapist count.
Fixed the save handler to include every submitted service (checked or not) with `active` reflecting the checkbox state, so `save_therapist_links()` only ever updates the existing row's `active` flag.
**`TB_Service::save_therapist_links()`'s delete branch removed entirely.** Per clarified business rules: a therapist's *linkage* to a service is a structural connection that toggling active/visible must never remove — only the `active` field on an existing link may change. Both callers (admin's therapist-edit page and the portal's Services tab) already submit a full/complete set on every save, so this delete branch was unnecessary and actively harmful.
⚠️ **Cannot un-delete links that were already wiped by this bug before the fix.** If `admin/class-tb-admin-services.php`'s list shows "None" for a service that should have a therapist (e.g. Couples therapy - Online, Sexology consultation - Online per the screenshots that surfaced this bug), the underlying link is genuinely gone and must be manually re-checked once on the therapist-edit page (image 3 in the bug report) — the fix only prevents this from happening again going forward.
Confirmed three independent layers per Søren's clarification, now correctly preserved by this fix:
⚠️ Not yet tested in a real WordPress installation.
v1.72.27August 2026
▼
**Fixed: unreliable toggle persistence for some services + fluctuating "X therapists" count in admin (1↔2 for a single therapist).** Root cause: the `UNIQUE KEY therapist_service (therapist_id, service_id)` on `tb_therapist_services` had apparently never actually been applied on existing installations — `dbDelta()` is notoriously unreliable at adding a *missing* index to an already-existing table, even though the `CREATE TABLE` definition always included it. Without that constraint enforced, duplicate rows for the same (therapist, service) pair could accumulate, which explains both symptoms: `admin/class-tb-admin-services.php`'s therapist count uses `COUNT(*)` (not `COUNT(DISTINCT therapist_id)`) and so counted duplicate rows as extra therapists, and the portal's toggle-save logic could update/insert the wrong one of several rows for the same link.
New idempotent migration in `class-tb-database.php`: checks for the unique index via `SHOW INDEX FROM`; if missing, deletes duplicate rows (keeping the newest per pair) before adding the constraint — runs once, safe to re-run (no-op once the index exists).
No code changes needed in the toggle-save logic itself — this was a data-integrity issue, not a logic bug in the v1.72.21-26 work.
Moved the "Save changes" button from the Services card header down to the bottom of the list, next to "+ Create new service".
⚠️ Not yet tested in a real WordPress installation.
v1.72.26August 2026
▼
**Revised model after clarification: "Active" and "Show on website" are two independent global flags**, not one control as v1.72.24–25 assumed. "Active" (`tb_services.active`) is back as a separate checkbox in the portal's create/edit dialog — it governs whether the service can be booked at all, used for special services distributed only via a direct link without appearing in the general listing. "Show on website" (`tb_services.show_on_website`) governs whether it appears in the general listing/`[therapist_services]` shortcode.
**For services a therapist owns, the list toggle now reflects/controls `show_on_website`** instead of the old per-therapist link — set one, the other follows, in both UI locations. `ajax_save_services()` syncs `tb_services.show_on_website` (not `active`) to the toggle for owned services; the owner's own link is protected from being touched by this save (see below).
**For services a therapist doesn't own (admin-created), the toggle is unchanged** — it still only controls that therapist's own opt-in link (`tb_therapist_services.active`), the original pre-v1.72.22 behavior.
**The owner's own link is now set active automatically at creation** (`TB_Service::set_therapist_link_active()`, restored) and kept permanently active — creating a service implies offering it yourself, no separate per-therapist toggle needed for that anymore.
**New: deep link + copy button on every service row in the portal's Services list**, mirroring the existing wp-admin UI (`add_query_arg('service_id', ..., $booking_base_url)` + clipboard button) — makes the "special service via direct link" workflow usable entirely from the portal.
⚠️ Not yet tested in a real WordPress installation.
v1.72.25August 2026
▼
**Simplified: removed the "Active" checkbox from the portal's create/edit service dialog.** The toggle switch in the Services list is now the sole active/inactive control, for both owned and non-owned (admin-created) services — resolving user confusion from having two separate, imperfectly-synced controls (checkbox in dialog vs. toggle in list, introduced in v1.72.22/v1.72.24).
`TB_Service::set_therapist_link_active()` (added in v1.72.24) removed again — no longer called from anywhere now that the dialog doesn't touch `active` at all.
`ajax_create_service()`: new services are now always created with `tb_services.active = 1` (globally available) and no link — matching the original v1.72.22 intent ("create only, therapist activates via the list toggle afterward"), now made consistent with the single-control model.
`ajax_update_service()`: no longer includes `active` in the data passed to `TB_Service::save()`, so editing other fields (name, price, etc.) never touches the active/inactive state.
`ajax_save_services()` (unchanged from v1.72.24): for services the therapist owns, toggling the list switch still automatically syncs `tb_services.active` (the wp-admin "Active" checkbox) to match — this is now the only direction that matters, since the dialog no longer has a competing control.
⚠️ Known limitation, not addressed this session: if a service is shared and toggled on by multiple therapists, one owner turning their own toggle off will also flip the global `tb_services.active` off for everyone (since the sync doesn't check whether other therapists still have it active). Low risk in the current single/small-clinic usage pattern; flagged for future consideration if multi-therapist adoption of peer-created services becomes common.
⚠️ Not yet tested in a real WordPress installation.
v1.72.24August 2026
▼
**Fixed: the "Active" checkbox in the portal's create/edit service dialog could never be unset.** `portal-app-services.php` always sent the `active`/`show_on_website`/`deposit_required` POST keys (as an empty string when unchecked); the server-side `isset( $_POST[...] )` check is true either way, so unchecking any of these fields in the dialog had no effect — they were always saved as on. Fixed by omitting the key entirely when unchecked, matching how a native HTML checkbox is omitted from `$_POST`, which is what the server-side check already assumed.
**New: the global "Active" checkbox (`tb_services.active`) and the therapist's own toggle in the Services list (`tb_therapist_services.active`) now stay in sync for services the therapist owns** — setting one sets the other, in both directions. New `TB_Service::set_therapist_link_active()` for a single-row, non-destructive upsert (unlike `save_therapist_links()`, which replaces a therapist's entire link set and is unsafe to call for just one service). `ajax_create_service()`/`ajax_update_service()` sync the owner's own link to match "Active"; `ajax_save_services()` syncs `tb_services.active` to match the list toggle, but only for services the therapist owns — toggling a non-owned (e.g. admin-created) service in the list still only affects that therapist's own link, never the global flag.
**This supersedes the v1.72.22 decision that a newly created service should not auto-link to its creator.** Since "Active" defaults to checked in the create dialog and now drives the link automatically, a new service is linked and activated for its creator immediately unless "Active" is unchecked at creation time.
⚠️ Not yet tested in a real WordPress installation.
v1.72.23August 2026
▼
**Fixed: newly created services were visible to clients in the booking widget even when no therapist had linked/activated them.** Root cause found while investigating a report that a service, deliberately left un-toggled by the creating therapist (portal "Services" tab, v1.72.22), still appeared in the client-facing service list. `TB_Ajax_Booking::get_all_services()` (step 2 of the booking flow, service selection before therapist selection) queried `TB_Service::get_all( true )`, which only checks `tb_services.active = 1` — it never checked whether any therapist actually offers the service (`tb_therapist_services`, `active = 1`). This gap pre-dates v1.72.22 (an admin-created service with no therapist links yet would already trigger it), but v1.72.22 made it trivial to hit: a therapist can now create a service (defaults: active + shown on website) without any auto-link, exactly the scenario this bug needed.
New `TB_Service::get_offered_ids()` — the set of service IDs linked and active for at least one therapist.
`get_all_services()` now skips any service not in that set, unless it's the deep-link-preselected service (`preselect_id`) — same override pattern already used for the `show_on_website` check, so deep links to admin-hidden-but-offered services are unaffected.
⚠️ **Crosses into TB Booking Flow's component** (`includes/class-tb-ajax-booking.php`) — flagged in both `handover-tb-admin.md` and `handover-tb-booking.md`, per the "one coherent piece of work" exception in CHAT_REGLER.md (same precedent as the Google/365 SaaS fix in v1.72.20/tb-saas v2.9.84).
⚠️ Not yet tested in a real WordPress installation.
v1.72.22August 2026
▼
**Therapists can now create, edit, and delete their own services from the therapist portal** ("Services" tab), not just toggle existing ones on/off. A new service is visible/activatable clinic-wide, same as before — no ownership restriction on visibility. Editing/deleting is restricted to the therapist who created the service; admin-created services (created from wp-admin) cannot be edited or deleted from the portal by any therapist.
New nullable column `tb_services.created_by_therapist_id` (idempotent `ALTER`, `class-tb-database.php`) — `NULL` for admin-created/pre-existing services.
`TB_Service::save()`: added `created_by_therapist_id` to its writable field list, and a new `tb_service_insert` filter applied right before `$wpdb->insert()` on the create path (mirrors `tb_booking_insert` in `class-tb-booking.php`) — no-op without a listener, the integration point a future SaaS Shell session would use for company-scoping on create.
New `includes/class-tb-therapist-portal-ajax-services.php` — session-authenticated create/update/delete handlers, validation mirrored from `admin/class-tb-admin-services.php::save_service()` (all fields except `sort_order`). Ownership check (`created_by_therapist_id` vs. session therapist ID) happens in the handlers before update/delete — `TB_Service::delete()` itself is unchanged and remains callable without a check from the admin side.
New `includes/therapist-portal/portal-app-services.php` — a **separate, self-contained `` block** (own IIFE), same reasoning as `portal-app-calendar.php`: `portal-app.php` is already over the 1,000-line threshold and is not touched by this feature.
`sections/section-services.php`: "+ Create new service" button and a create/edit dialog (all admin fields except `sort_order`); Edit/Delete buttons shown only on rows the logged-in therapist owns.
Not in scope this session: tb-saas's own listener on the new `tb_service_insert` filter (company_id scoping on therapist-created services) — deferred to a dedicated SaaS Shell session after this TB core work is tested.
⚠️ Not yet tested in a real WordPress installation.
v1.72.21August 2026
▼
**Pure structural split, no behavior change.** Extracted the "Services" section out of `includes/therapist-portal/portal-dashboard.php` (804 → 742 lines) into a new `includes/therapist-portal/sections/section-services.php`, same pattern as `section-calendar.php` in v1.72.17. Prerequisite for the self-service create/edit/delete feature added in v1.72.22.
v1.72.20August 2026
▼
**Fixed: Google/Microsoft 365 self-connect from the therapist portal failed for SaaS clinic therapists** (bookbookbook.dk `/tpadmin/`), while working correctly for standalone customers. Root cause: bookbookbook.dk hosts both the TB OAuth Relay server *and* its own TB core installation, so `TB_Relay_Client::get_auth_url()`'s `site => home_url()` param unintentionally matched the relay's own `site === home_url()` SaaS-detection heuristic — routing the request into the relay's SaaS branch, which expects `company_id`/`redirect_to` params that the standalone-oriented client never sends. Result: tokens were fetched from Google but discarded by tb-saas's own company-scoping guard (`company mismatch ... expected=0`).
`includes/therapist-portal/sections/section-calendar.php`: both connect-URL builders (Google and Microsoft) now pass through a new filter, `tb_therapist_portal_calendar_connect_url( $default_url, $therapist, $provider )`, before being used. No-op without a listener — standalone installations are unaffected. This is the integration point Shell plugins use to substitute their own SaaS-aware auth URL (see tb-saas v2.9.84).
v1.72.19August 2026
▼
**`class-tb-relay-client.php`: portal support for TB OAuth Relay pickup.** `handle_pickup()` now hooks `init` instead of `admin_init` (the latter never fires on a front-end page, so the therapist portal could not complete a relay-based connection at all), and its authorization check accepts either `manage_options` (unchanged admin flow) or a valid portal session matching the exact therapist ID in the pickup URL — a therapist can only pick up tokens for their own row.
Success and error redirects (`redirect_with_error()` and the success branch in `handle_pickup()`) now branch on `is_admin()` to send the browser back to wp-admin or to the therapist portal (`TB_Therapist_Portal::portal_url()`) depending on where the flow was initiated.
`get_auth_url()` gains an optional third `$return_url` parameter, forwarded to the relay server (requires tb-oauth-relay v1.0.16+; older relay versions ignore the parameter and keep redirecting to wp-admin, so this is backward compatible without a coordinated upgrade).
⚠️ Not yet tested against a live relay-enabled installation.
v1.72.18August 2026
▼
**Therapists can now self-connect Google Calendar and Microsoft 365 from the therapist portal** (`/terapeutadmin/` → Calendar), in addition to the existing CalDAV/iCal fields. Full feature parity with the admin-side connection UI (`admin/therapists/page-form.php`): connect/disconnect, Google calendar picker, diagnostics (test slot lookup + log view/clear) for both providers, and the Teams toggle (license-gated on `teams` feature) for Microsoft 365. Microsoft 365 connection itself is gated on the `microsoft_calendar` license feature, matching the admin side.
New `includes/class-tb-therapist-portal-ajax-calendar.php` — session-authenticated mirrors of the existing `manage_options`-gated admin AJAX handlers (`tb_google_*`/`tb_ms_*` in `therapist-booking.php`). The therapist ID is always derived from the portal session, never from POST data, so a therapist can only modify their own connection.
New `includes/therapist-portal/portal-app-calendar.php` — a **separate, self-contained `` block** for this feature (its own IIFE with a small local `post()` helper), deliberately not merged into `portal-app.php`'s shared state closure — that file is already over the 1,000-line mandatory-split threshold (see handover-tb-booking.md) and splitting its internal closure is a larger, separate task. This file only shares the global `TB_PORTAL` object, already printed on the page before it runs.
**Fixed:** the error/cancel branches in `class-tb-google-calendar.php::handle_callback()` and `class-tb-microsoft-calendar.php::handle_callback()` previously redirected straight to a hardcoded wp-admin URL, bypassing the `tb_calendar_callback_redirect` filter entirely (only the success branch went through it). Both now look up the therapist ID from the OAuth state transient and route through the same filter, now called with a new optional fourth `$error` parameter (`null` on success). This was a prerequisite for the portal to be able to show its own error banner instead of the therapist landing on a wp-admin URL they have no access to.
`class-tb-therapist-portal.php`: new `maybe_redirect_to_portal()` filter callback hooked to `tb_calendar_callback_redirect` — only acts when a short-lived `tb_calendar_origin_portal_{id}` transient is present (set in `sections/section-calendar.php` right before rendering the direct-flow connect link), so the existing wp-admin flow for other TB core customers is completely unaffected.
⚠️ Not yet tested in a real WordPress installation — covers all of: connect/disconnect for both providers, Google calendar picker, diagnostics/log for both, Teams toggle, and the redirect-back-to-portal behavior for both success and error cases.
v1.72.17August 2026
▼
**Pure structural split, no behavior change.** Extracted the "Calendar integration" card (CalDAV + iCal fields) out of `includes/therapist-portal/portal-dashboard.php` (851 → 804 lines) into a new `includes/therapist-portal/sections/section-calendar.php`, included via the existing shared-variable-scope pattern (see FIL-SPLIT-VEJLEDNING.md). Prerequisite for the Google/365 self-connect feature added in v1.72.18, which lives entirely in the new file.
v1.72.16August 2026
▼
**Loading state on the date-picker (step 4, "Vælg dato").** Clients previously saw all calendar days rendered in their inert/unavailable style with no feedback while `tb_get_available_dates` fetched real-time availability from the therapist's connected calendar (Google/Microsoft/CalDAV) — indistinguishable from "no dates available", and confusing during the network round-trip.
v1.72.15August 2026
▼
**`TB_Updater::check_for_update()`: `$obj->tested` now reads the `tested` field from the License Server's version-check response instead of a hardcoded empty string.** Falls back to `''` (unchanged behavior) if the field is absent, which is the case until License Server + Release Manager gain support for a "tested up to WP version" value.
No other changes. This does not by itself fix the "not tested" compatibility badge shown on the Plugins page — that requires the License Server side to start sending the field.
v1.72.14August 2026
▼
**Split the AJAX handlers out of `includes/class-tb-therapist-portal.php` (1,056 → 393 lines).** Pure structural change — no changes to business logic, public API, or REST/AJAX contract. Continues the v1.72.13 split of the same file.
18 AJAX methods + `maybe_consume_magic_token()` extracted into four new domain classes, grouped by concern:
The router class (`TB_Therapist_Portal`) keeps session/auth helpers, `init()`, `on_activate()`, `ensure_portal_page()`, `render_shortcode()`, and the render/CSS wrappers from v1.72.13. All ~37 `add_action('wp_ajax_...')` / `add_action('wp_ajax_nopriv_...')` registrations in `init()` updated to point at the new classes' methods.
**Visibility change (necessary for the split):** four session helpers previously `private static` — `session_ttl()`, `set_session()`, `clear_session()`, `verify_csrf()` — are now `public static`, since the moved AJAX methods call them cross-class (matches the existing pattern for `get_session_therapist()`/`portal_url()`, which were already public). All `self::` calls to these from the moved methods were replaced with explicit `TB_Therapist_Portal::` calls, per the documented "self:: doesn't work across classes" rule in FIL-SPLIT-VEJLEDNING.md.
The 4 tb-saas SaaS hooks (`tb_therapist_portal_access`, `tb_therapist_portal_login`, `tb_therapist_portal_booking_args`, `tb_therapist_portal_services`) moved unchanged along with their respective methods — two stayed on the router (`_access` in `render_shortcode()`, `_booking_args` in `render_dashboard()`), two moved to new classes (`_login` in `Ajax_Account::ajax_login()`, `_services` in `Ajax_Profile::ajax_save_services()`).
**Verified (static only):** braces balance (0 diff) in all five files; no `self::` references left in any of the four new files; no external callers anywhere in the plugin reference the moved methods under the old `TB_Therapist_Portal::ajax_*`/`::maybe_consume_magic_token` names.
**⚠️ Not yet tested in a real WordPress installation.** See test checklist in handover-tb-admin.md before production — this covers every portal write action (login/logout, booking CRUD, profile, availability, services, GDPR, blocked dates, iCal/CalDAV tests, magic-link login).
v1.72.13August 2026
▼
**Split `includes/class-tb-therapist-portal.php` (3,145 → 1,056 lines).** Pure structural change — no changes to business logic, public API, or rendered output. File was far over the 2,000-line critical threshold in CHAT_REGLER.md.
Four private static render/CSS methods converted to thin `include`-based wrappers, each delegating to a new template file under `includes/therapist-portal/`:
One `self::session_ttl()` call originally inside `render_js()`'s body was replaced with a pre-computed `$session_ttl` variable passed into the template, per the documented "self:: doesn't reliably work in templates" pitfall in FIL-SPLIT-VEJLEDNING.md.
AJAX handlers (18 methods, ~668 lines) were intentionally left untouched — split into domain files is planned as a separate, later task.
**Verified (static only):** braces balance (0 diff) in the main file and all four new template files; no `self::`/`$this` references left in any template; no external callers anywhere in the plugin call these four (private) methods directly — only the class's own `self::get_css()`/`self::render_login()` call sites, unaffected by the extraction.
**⚠️ Not yet tested in a real WordPress installation.** See test checklist in handover-tb-admin.md before production.
v1.72.12August 2026
▼
**Fix: border color field was skipped when switching design theme via the theme swatches in Settings → Design.** The JS theme-switcher updated background/text/accent color fields automatically on click, but never included `tb_d_border` in its field map — so the border color silently kept whatever value was previously saved (e.g. the original "Mørkt" theme's amber/gold border `#4a3a20`) even after switching to a completely different theme, including the new monochrome themes. Payment-method option cards and other bordered elements therefore kept showing a gold ring on themes that shouldn't have one.
`tb_d_border` added to the theme-switch field map (`admin/settings/tab-design.php`) — clicking a theme swatch now resets the border color too, same as every other field.
**Note for existing installs:** clinics who already picked a theme before this fix need to click the theme swatch again (or hit "Nulstil" next to Kantfarve) and save once, since the stale border value is already stored in `tb_booking_design` and won't self-correct without a resave.
Consent checkbox size reduced further (20px → 17px) and checkmark re-proportioned for a tighter, better-centered fit within the box.
v1.72.11August 2026
▼
**Fix: consent checkbox (privacy policy agreement) was hardcoded to a fixed dark/gold color scheme instead of following the selected design theme.** Unchecked box background (`#2a2a2a`) and border (`#888`) stayed dark regardless of theme, and the checked state was always gold (`#e8c030`) even on light or monochrome themes.
Checkbox now uses the theme's CSS variables: unchecked background follows `--tb-dark-card`, border follows `--tb-border`, hover/checked state follows the theme's accent color (`--tb-gold` / `--tb-gold-rgb`).
**New:** checkmark color now uses a new `--tb-btn-text` variable (same contrast color used on primary buttons) instead of a hardcoded near-black, so it stays legible against the accent color on every theme — including the new monochrome themes where the accent itself can be white.
Reduced checkbox size slightly (22px → 20px) and re-proportioned the checkmark so it sits better centered within the box.
Affects both the booking-flow consent field and the gift card/course purchase consent field (same shared CSS class).
v1.72.10August 2026
▼
**Two new monochrome design themes added to Settings → Design:** "Sort-Hvid Mørkt" (Black-White Dark) and "Sort-Hvid Lyst" (Black-White Light). Pure black/white/grayscale palettes — accent color is white-on-black (dark theme) or black-on-white (light theme) instead of a hue, so buttons stand out through contrast rather than color.
Success/danger (error) colors kept as functional red/green in both new themes for at-a-glance readability of status badges.
No changes to preview JS, color-picker logic, or the save/validation flow beyond adding the two new theme keys to the allowed list — purely additive, same pattern as existing themes.
v1.72.09July 2026
▼
**Bugfix: intermittent "technical error" on booking submission for clinics using Google Calendar or Microsoft 365 integration.** Reported by multiple clients across different installations and services; suspected (and confirmed by code review) to correlate with longer gaps between bookings.
**Root cause:** `TB_GoogleCalendar::get_valid_token()` and `TB_MicrosoftCalendar::get_valid_token()` refreshed an expired access token and saved it to the database, but never updated the in-memory `$therapist` object passed to them. For services with prep/cleanup buffer time, `tb_calendar_create_event()` reuses the *same* `$therapist` object for the main event and the prep/cleanup buffer events (`tb_calendar_create_buffer_events()` in `class-tb-caldav.php`). Each of these calls `get_valid_token()` again, and since the object still showed the old (expired) token in memory, every call triggered a fresh OAuth refresh request — up to 3 redundant, synchronous network calls to Google/Microsoft (each with a 15s timeout) on a single booking, all happening before the client received a response. Under network latency this could exceed PHP's execution time limit, causing the request to die without returning valid JSON — surfacing to the client as a generic "Der opstod en fejl" message (via the frontend's `.fail()` handler, not a graceful `wp_send_json_error`).
**Fix:** both `get_valid_token()` methods (direct refresh path and relay refresh path, Google + Microsoft) now also update the in-memory `$therapist` object's token fields after a successful refresh, so repeated calls with the same object within a single request reuse the fresh token instead of refreshing again.
This explains why the bug was hard to reproduce: retrying shortly after a failed booking would already have a freshly-refreshed (valid) token in the DB, avoiding the redundant-refresh path on the next attempt.
**Also added:** `TB_Booking::create()` now logs the actual `$wpdb->last_error` (plus therapist/date/time context) to `debug.log` when the booking insert fails, instead of failing silently with no diagnostic trail.
No change to public API, database schema, or calendar sync behavior — purely an internal caching/logging fix.
v1.72.08Juli 2026
▼
**Split af `class-tb-email.php`** (var 1.018 linjer, over 1.000-linjers-grænsen i CHAT_REGLER.md). Ren struktur-ændring — ingen ændringer i email-indhold, forretningslogik eller det offentlige API.
`class-tb-email.php` er nu en tynd facade/router (84 linjer) — alle eksisterende `TB_Email::`-kald (fra ajax-, stripe-, mobilepay-, admin-, therapist-portal-, gdpr- og reminder-koden) fortsætter helt uændret.
Ny fil `includes/class-tb-email-giftcards.php` → `TB_Email_Giftcards`: gavekort-emails.
Ny fil `includes/class-tb-email-courses.php` → `TB_Email_Courses`: forløbs-emails.
Ny fil `includes/class-tb-email-reminder.php` → `TB_Email_Reminder`: påmindelsesmail + rå admin-email (GDPR).
⚠️ **Kryds-plugin-hensyn:** `TB_Email::wrap()` er bevidst bevaret (privat, tynd delegering) fysisk på `TB_Email`-klassen, fordi tb-saas' `class-tbs-scope.php` tilgår den via `ReflectionMethod('TB_Email','wrap')` som fallback. Fjernes den herfra, knækker tb-saas. Se `handover-saas-shell.md` — kendt post-launch-opgave at erstatte Reflection med en rigtig hook, ikke løst i denne split.
**Ikke testet i en rigtig WordPress-installation endnu** — kun statisk verificeret (klammer/parenteser balancerer i alle 6 filer, alle 18 oprindelige metoder til stede, ingen `self::`-referencer efterladt til metoder der er flyttet til `TB_Email_Core`).
v1.72.07Juli 2026
▼
**"Gensend email"-knap for solgte gavekort og solgte forløb.** Klinikken kan nu gensende koden til klienten hvis den oprindelige email ikke er modtaget eller er blevet væk — uden at skulle udstede et nyt gavekort/forløb.
**Gavekort:** ny `admin_post_tb_resend_giftcard` → `TB_Admin_Giftcards::resend_giftcard()`. Henter det fulde gavekort (`TB_GiftCard::get_issued()`) og kalder `TB_Email::send_giftcard_confirmation()` igen (samme mail som ved oprindeligt køb, sendes til modtager og evt. køber). Fejlbesked hvis hverken modtager- eller køber-email er sat.
**Forløb:** ny `admin_post_tb_resend_sold_course` → `TB_Admin_Courses::resend_sold_course()`. Henter forløbet (`TB_Course::get_issued()`, inkl. `product_name`/`service_name` via eksisterende JOIN) og kalder `TB_Email::send_course_confirmation()` igen. Fejlbesked hvis klient-email mangler.
Ny knap "Gensend email" i Handlinger-kolonnen på begge "Solgte …"-lister, samme GET+nonce-mønster som eksisterende Slet-knap.
Ingen ny database-kolonne eller ændring i forretningslogikken for selve salget — udelukkende en gensend-funktion oven på eksisterende email-metoder.
**Udestående (tb-saas-chat):** samme "Gensend email"-knap skal tilføjes i klinikportalens "Solgte gavekort"/"Solgte forløb", med ejerskabsguard (`TBS_Portal_Data_Giftcards::get_giftcard()` / `TBS_Portal_Data_Courses::get_one_sold()`).
v1.72.06Juli 2026
▼
**Admin-notifikation ved forløbssalg:** ny `TB_Email::send_course_admin_notification( $course )` — sender salgsdetaljer (klient, kontaktoplysninger, forløb, sessioner, beløb, forløbskode) til klinikkens admin-email. Mirror af det eksisterende `send_admin_notification()`-mønster for bookinger.
Nyt filter `apply_filters('tb_course_admin_notification_email', $admin_mail, $course)` — SaaS Shell kan override modtageren til klinikkens kontakt-email (mirror af `tb_admin_notification_email`). Eget filter fordi `$course` er et array, ikke et objekt.
Nyt neutralt filter `apply_filters('tb_course_insert', $row)` i `TB_Course::create()` — lader Shell stemple `company_id` på forløbsrækken før insert (mirror af `tb_booking_insert`). Ingen effekt uden listeners.
Kaldt fra alle 3 steder hvor `send_course_confirmation()` allerede kaldes: `class-tb-ajax-products.php` (betal-ved-behandling + normal aktivering), `class-tb-stripe.php` og `class-tb-mobilepay.php` (webhook-aktivering)
`class-tb-stripe.php`/`class-tb-mobilepay.php`: forløbs-data ved webhook-aktivering udvidet med `client_phone` og `price_paid` (var ikke med før, nu tilgængelig til admin-mailen)
⚠️ **`class-tb-email.php` er nu 1.018 linjer — over 1.000-linjers-grænsen i CHAT_REGLER.md.** Bør splittes (fx i booking-emails / gavekort-emails / forløbs-emails / admin-notifikationer) inden næste feature tilføjes i denne fil.
**Udestående (tb-saas-chat):** `tb_course_insert` skal lyttes på for at stemple `company_id`, og `tb_course_admin_notification_email` skal lyttes på for at route til klinikkens `owner_email` — uden dette lander forløbs-admin-mails på site-adminnens `admin_email` for SaaS-klinikker, ikke klinikejerens egen adresse
v1.72.05Juli 2026
▼
**Design-tema følges nu konsekvent i booking-widget'en (rettet 3 samhørende fejl):**
**Ny CSS-variabel `--tb-gold-rgb`**: RGB-triplet af det valgte temas accentfarve, udregnet i `tb_inject_design_css()` (hex→RGB) og som fallback i `:root` i `booking.css`. Gør det muligt at bygge tint/skygge-varianter af accentfarven uden at hardkode én bestemt temafarve
Ingen ændring i "Mørkt"-temaets udseende (samme RGB-værdier), men alle andre temaer (Lyst, Neutralt, Moderne Mørkt, Moderne Lyst) viser nu korrekte hover-, fokus- og accentfarver
v1.72.04Juli 2026
▼
**Split af `class-tb-ajax.php`** — filen var vokset til ~1.026 linjer (over 1.000-linjers-grænsen i CHAT_REGLER.md). Ren struktur-oprydning, ingen ændringer i forretningslogik.
`class-tb-ajax.php` er nu en ren router (77 linjer): registrerer `wp_ajax_*`-hooks via en eksplicit action→klasse-mapping og ruter `tb_action`-URL-kald
**Ny fil `class-tb-ajax-payment.php`** (306 linjer): `handle_payment_return`, `handle_cancel_page` — begge ændret fra `private` til `public static`, da routeren nu kalder dem på tværs af klasser
`therapist-booking.php`: 3 nye `require_once`-linjer tilføjet efter `class-tb-ajax.php`
Verificeret: klammer/paranteser balancerer i alle fire filer (Python-tælling), ingen `self::`-referencer efterladt i de udtrukne filer, metodeantal matcher original 1:1
v1.72.03Juli 2026
▼
**Forløbskøb indsamler nu samme klientoplysninger som booking:** telefon (valgfri), besked (valgfri), samtykke til privatlivspolitik (**påkrævet**, ligesom ved almindelig booking)
**Ny admin-mulighed: redigér solgte forløb.** Under Forløb → "Solgte forløb" er der nu Rediger/Slet-knapper pr. forløb — kan rette klientens navn, email, telefon, besked, sessioner brugt/i alt, udløbsdato og status. Mønsteret er 1:1 mirror af det eksisterende "Rediger gavekort" i gavekort-admin
`class-tb-database.php`: nye idempotente kolonner `client_phone` og `client_notes` på `tb_courses` (kører automatisk ved næste versionsbump, ingen genaktivering nødvendig)
`class-tb-course.php`: `create()` gemmer nu telefon/besked; nye metoder `get_issued()`, `update_issued()`, `delete_issued()` (mirror af `TB_GiftCard`)
`class-tb-shortcodes.php`: nye felter i forløbs-formularen (telefon, besked, samtykke-checkbox), genbruger `$privacy_link` fra booking-sektionen i samme metode-scope
`public/js/booking.js`: `submitCourse()` sender nye felter + validerer samtykke client-side
`admin/class-tb-admin-courses.php`: ny redigeringsformular + `tb_edit_sold_course`/`tb_delete_sold_course` admin_post-handlers
v1.72.02Juli 2026
▼
**Forløbskøb: betalingsmetode-valg tilføjet.** Køb af forløb (`[therapist_booking]` → Forløb) understøttede før kun MobilePay implicit (payment_method blev aldrig sendt fra frontend). Der er nu et rigtigt valg mellem MobilePay, Kortbetaling (Stripe) og "Betal ved behandling" — styret af de samme indstillinger som almindelig booking (`allow_mobilepay`, `allow_card`, `allow_pay_at_clinic`)
**"Betal ved behandling" for forløb:** når valgt, springes betalingsgateway helt over — forløbet aktiveres med det samme og bekræftelsesmail sendes. Nyttigt til hurtigt at teste at `TB_Email::send_course_confirmation()` rent faktisk afsender, uden at skulle gennemføre en rigtig betaling
Intet ekstra licens-/plan-tjek tilføjet på Stripe/MobilePay for forløb — `courses`-featuren kræver allerede Klinik/Pro, som begge inkluderer `mobilepay`-featuren, så et ekstra tjek ville være redundant
`class-tb-shortcodes.php`: nye betalingsmetode-radioknapper i forløbs-købsformularen (trin `tb-step-cr-2`), skjules når forløbet er gratis
`public/js/booking.js`: `showCourseForm()`/`submitCourse()` sender nu `payment_method`; knapteksten skifter dynamisk (MobilePay/Kort/Betal ved behandling)
`class-tb-ajax.php` (`purchase_course()`): validerer `payment_method` mod `mobilepay`/`stripe`/`pay_at_clinic`
v1.72.01Juli 2026
▼
**Marketing/sælgende tekst (ingen funktionsændringer):** Plugin-header `Description`-linjen omskrevet til en kortere, mere sælgende one-liner (nævner Stripe + MobilePay eksplicit)
**Ny rig beskrivelse i "Se detaljer"-popup** (`TB_Updater::plugin_info()` → `plugins_api`/`plugin_information`): udtrukket til ny privat metode `get_description_html()` i `class-tb-updater.php`. Struktureret med overskrifter, fed tekst og emoji-sektioner (booking, flere terapeuter, kalendersynk, betaling, kommunikation, sikkerhed, fleksibilitet) — betalingssektionen nævner både Stripe og MobilePay ePayment eksplicit
Ingen ændringer i update-check-logik, licensvalidering eller download-flow
v1.72.00Juli 2026
▼
**Test-release (ingen funktionsændringer):** ren versionsbump til brug for test af automatisk plugin-opdatering (`TB_Updater` + License Server `version-check`/`download_url`-flow). Kodebasen er identisk med v1.71.59 bortset fra versionsnummeret.
v1.71.58Juli 2026
▼
**Ny blokerings-type `online`:** terapeuten kan markere en dag som "kun online" — alle tidsslots vises normalt, men kun ydelser med `delivery_type = online` eller `both` tilbydes klienten
**Ny toggle-cykel:** ingen → hel dag blokeret (rød) → formiddag blokeret → eftermiddag blokeret → kun online (teal) → ingen. Første klik = hel dag blokeret
Admin kalender: teal farve + 📹-ikon for online-dage; legende opdateret med korrekt rækkefølge
Terapeutportal kalender: samme farve/ikon/tooltip som admin
`TB_Therapist::add_blocked_date()`: `'online'` tilføjet til whitelist
`TB_Therapist::get_available_slots()`: `online`-type behandles som ingen blokerig af slots (ikke `full`)
`TB_Ajax::get_available_dates()`: returnerer nu `{date, online_only}` objekter i stedet for strenge; forhåndsindlæser blokerede datoer i ét DB-kald
`TB_Ajax::get_all_services()` og `get_services()`: filtrerer til `delivery_type IN (online, both)` når `online_only=1` sendes med
`booking.js`: håndterer nyt dato-format; online-only dage får teal farve i klientkalender; vælges en online-only dag med en fysisk ydelse aktiv, ryddes ydelsesvalget og klienten sendes til ydelseslisten med kun online-ydelser
v1.71.56Juli 2026
▼
**Sikkerhed:** Google- og Microsoft OAuth-tokens (`google_access_token`, `google_refresh_token`, `ms_access_token`, `ms_refresh_token`) krypteres nu (AES-256-CBC) før de gemmes i databasen, i stedet for klartekst
Ny delt klasse `TB_Crypto` (`includes/class-tb-crypto.php`) — udtrukket fra `TB_CalDAV::encrypt_password()`/`decrypt_password()`-mønsteret, som nu delegerer til den (uændret nøgleafledning/format — 100% bagudkompatibel med eksisterende CalDAV-adgangskoder og portal-session-cookies)
Bagudkompatibel migrering: `TB_Crypto::decrypt_token()` falder tilbage til rå værdi hvis dekryptering fejler (dvs. eksisterende ukrypterede tokens fra før v1.71.56) — tokens re-krypteres automatisk ved næste token-fornyelse
Rørte filer: `class-tb-google-calendar.php`, `class-tb-microsoft-calendar.php`, `class-tb-relay-client.php` (alle 4 skrivepunkter + alle brugssteder af tokens)
Baggrund: Del af Google OAuth-verifikationsproces — Google kræver eksplicit dokumenterede databeskyttelsesmekanismer for følsomme data (adgangstokens) i privatlivspolitikken
v1.71.55Juni 2026
▼
Ydelser: Skjult ydelse med dybt link ("semi-aktiv") — ydelse med `Vis på hjemmesiden` slået fra vises ikke i `[therapist_services]` oversigten, men kan bookes via dybt link (`?service_id=X`)
Admin ydelsesliste: "Vis på web"-kolonne viser nu amber "Skjult" badge (i stedet for blot –) med tooltip der forklarer konceptet; dybt link-kolonnen får en gul fremhævningsboks med teksten "Del dette link for at booke ydelsen"
`get_all_services` AJAX: Skjult ydelse inkluderes alligevel i svaret når `preselect_id` matcher — booking-formularen kan dermed preselecere og booke skjulte ydelser via dybt link
`booking.js`: Sender `preselect_id` med i `tb_get_all_services`-kaldet ved deep link preselection
v1.71.54Juni 2026
▼
Terapeutportal: "Portal-side slug" tekstfelt erstattet med dropdown (wp_dropdown_pages) — konsistent med øvrige side-vælgere i indstillinger
Gem af dropdown opdaterer tb_portal_page_id direkte med det valgte side-ID
v1.71.53Juni 2026
▼
Terapeutportal: `ensure_portal_page()` overskriver ikke længere `tb_portal_page_id` hvis den allerede peger på en gyldig publiceret side
Terapeutportal: Gem af "Portal-side slug" i admin opdaterer nu `tb_portal_page_id` med det samme så redirect virker uden manuel SQL
v1.71.52Juni 2026
▼
Terapeutportal: Portal-sidens slug er nu konfigurerbar via felt i TB core admin → Indstillinger → Generelt
v1.71.51Juni 2026
▼
Terapeutportal: Magic login-link funktion tilsæjet direkte i login-formen
Sikkerhed A2: Alle 12 muterende terapeutportal AJAX-handlers manglede CSRF-beskyttelse — ny `verify_csrf()` metode baseret på session-token (ikke WP-nonce, da terapeuter ikke er WP-brugere)
Sikkerhed B2: `ajax_portal_create_booking` respekterede ikke `tb_can_book`-filteret — Shell kan nu blokere manuel portal-booking
v1.71.48Juni 2026
▼
Fix: `tb_calendar_should_create_event`-filteret i v1.71.47 returnerede tidlig `return` og sprang dermed `tb_calendar_create_buffer_events()` over — oprydnings- og forberedelsestid kom ikke med i kalenderen. Rettet: filteret wrapper nu kun hoved-event-oprettelsen; buffer-events oprettes altid uanset filterets resultat
v1.71.47Juni 2026
▼
Ny: `apply_filters('tb_calendar_should_create_event', true, $booking, $therapist)` øverst i `tb_calendar_create_event()` — Shell kan returnere false for at forhindre duplikat kalenderaftale. Brugt i SaaS når Teams er provider: `TB_Teams::create_meeting()` opretter allerede en kalenderaftale via `/me/events`, så `TB_MicrosoftCalendar::create_event()` skal springes over
Ny: `do_action('tb_calendar_after_delete', $booking, $therapist)` i `tb_calendar_delete_event()` — Shell kan reagere på sletning og rydde op i Teams-mødet (`teams_meeting_id`) separat. Uden dette hook slettede aflysning kun kalenderaftalen fra `ms_event_id` men ikke Teams-mødet
Begge hooks er neutrale — no-op for plugin-kunder uden lyttere
v1.71.46Juni 2026
▼
Ny: `apply_filters('tb_ms_refresh_token', null, $therapist)` i `TB_MicrosoftCalendar::get_valid_token()` — Shell kan kortSlutte relay HTTP-kaldet ved at returnere et token direkte. Bruges i SaaS for at undgå loopback: `TBR_Microsoft::do_token_refresh($therapist)` kaldes som PHP-funktion i stedet for HTTP til bookbookbook.dk/wp-json/tb-relay/v1/ms/refresh-token. Neutral hook — null = ingen lytter, eksisterende kode kører uændret
v1.71.45Juni 2026
▼
Ny: `apply_filters('tb_teams_is_configured', $result)` i `TB_Teams::is_configured()` — Shell kan overstyre det globale konfigurationstjek. Nødvendigt i SaaS fordi `TB_MicrosoftCalendar::is_configured()` tjekker relay-URL via `TB_Relay_Client::is_enabled()` som returnerer `false` på bookbookbook.dk (relay er dette site, ikke en ekstern URL), hvilket fejlagtigt fik `is_configured()` til at returnere `false` selv om terapeuten har gyldige tokens. Neutral hook — no-op for plugin-kunder uden lyttere
v1.71.44Juni 2026
▼
Udvidet: `TB_Zoom::get_credentials($booking = null)` sender nu valgfrit `$booking` som 2. arg til `tb_zoom_credentials`-filter (var 1 arg) — Shell kan dermed slå company_id op fra `$booking->company_id` i stedet for session, hvilket er nødvendigt under klient-AJAX-booking-flow
Udvidet: `TB_Zoom::create_meeting()` sender `$booking` til `get_credentials()` og tjekker credentials inline (ikke via `is_configured()`) — ensures per-company credentials bruges korrekt
Udvidet: `TB_Zoom::get_token()` modtager nu `$creds`-array eksplicit i stedet for at hente dem selv — undgår dobbelt filter-kald pr. request
`test_connection()` og `delete_meeting()` uændret i adfærd (kalder `get_credentials()` uden booking — virker fra admin/portal-session)
v1.71.43Juni 2026
▼
Ny: `apply_filters('tb_zoom_credentials', $creds)` i `TB_Zoom::get_credentials()` — Shell kan injicere per-company Zoom-credentials (account_id, client_id, client_secret) så SaaS-klinikker bruger deres egne Zoom-apps
Ny: `apply_filters('tb_online_meeting_provider', $provider, $booking, $therapist)` i `tb_maybe_create_online_meeting()` — Shell kan overstyre den globale `online_meeting_provider` pr. virksomhed
Ny: `apply_filters('tb_zoom_license_ok', $bool, $booking)` — Shell kan bypass klassisk licenstjek for SaaS
Ny: `apply_filters('tb_teams_license_ok', $bool, $booking)` — Shell kan bypass klassisk licenstjek for SaaS
Teknisk: Zoom token-cache er nu per-credentials (md5 af account_id) så SaaS-klinikker med egne credentials ikke deler token
Alle 4 hooks er neutrale — no-op for plugin-kunder uden lyttere
v1.71.39Juni 2026
▼
Ny: `do_action('tb_payment_confirmed', $order_id, $payment_method)` — fyres på de steder hvor en betaling RENT FAKTISK er gennemført (penge modtaget, ikke kun reserveret): MobilePay booking-flow (`payment_return`), MobilePay gavekort/forløb-flow, MobilePay webhook, Stripe `process_confirmed_payment()` (booking, deposit og fuld betaling), Stripe gavekort-aktivering, Stripe forløb-aktivering
MobilePay: ny `$tbs_money_captured`-sporing skelner mellem "kun reserveret" (capture-tilstand "Kun reservation") og "rent faktisk trukket" — hooket fyres KUN ved faktisk capture, ikke ved reservation alene
Formål: lader Shell bygge en selvstændig betalings-/udbetalingslogbog uafhængig af booking-data, uden at skulle gætte retroaktivt hvilke betalinger der reelt blev gennemført
Neutral hook — no-op for plugin-kunder uden lyttere
v1.71.38Juni 2026
▼
Ny: `do_action('tb_mobilepay_payment_initiated', $order_id, $booking_or_data, $settings)` i `TB_MobilePay::create_payment()` — fyres efter order_id er kendt, lige før MobilePay-API-kaldet
Ny: `do_action('tb_stripe_payment_initiated', $booking_id, $order_id, $booking_or_data, $secret)` i `TB_Stripe::create_checkout_session()` — fyres lige før Stripe Checkout-API-kaldet
Formål: lader Shell stemple hvilket nøglesæt (platform/klinikkens egne) der reelt blev brugt til den enkelte betaling, PÅ betalingstidspunktet — uden dette var Shell nødt til at udlede det retroaktivt af klinikkens nuværende indstilling, hvilket gav forkerte tal i Betalingsoverblik hvis klinikken havde skiftet model siden
Begge hooks er neutrale (no-op) for plugin-kunder uden lyttere
v1.71.37Juni 2026
▼
Forenkling: fjernet 'delayed' (3-dages cron) capture-tilstand igen — viste sig at være baseret på en misforståelse af Vipps' udbetalingsfrist (3 arbejdsdage fra capture til bankkonto), ikke en forretningsregel om hvornår selve capture skal ske
Capture-tilstand er nu kun to muligheder: "Med det samme" (standard) og "Kun reservation" (genskaber den oprindelige adfærd — manuel capture i Vipps-portalen, gebyrfri test)
v1.71.36Juni 2026
▼
Ny: Capture-tilstand for MobilePay (TB core admin → Betaling): "Med det samme" (standard, uændret adfærd), "Forsinket" (3 dage via cron) og "Kun reservation" (gebyrfri test — captures aldrig automatisk)
Ny: `TB_MobilePay::schedule_capture()` + `run_scheduled_capture()` — planlægger capture via `wp_schedule_single_event()`, sporet i ny tabel `tb_mobilepay_captures`
Ny: `TB_MobilePay::release_scheduled_capture()` — frigiver automatisk en planlagt capture (og kalder Vipps' cancel-endpoint) når booking annulleres via eksisterende `tb_booking_cancelled`-hook
Ny: `TB_MobilePay::cancel_payment()` — eksplicit annullering/frigivelse af en reservation hos Vipps
Ny: filtre `tb_mobilepay_capture_mode` og `tb_mobilepay_capture_delay_days` — neutrale for standalone-kunder, lader tb-saas styre capture-tilstand per klinik (superadmin + klinikportal)
Ny tabel: `tb_mobilepay_captures` (order_id, context_type/id, amount_minor, status, scheduled_at, captured_at)
v1.71.35Juni 2026
▼
🔴 KRITISK FIX: MobilePay-betalinger blev reserveret men ALDRIG captured (`capturedAmount=0` i produktionslog) — pengene blev ikke trukket fra kunden
Ny: `TB_MobilePay::capture_payment($order_id, $amount_minor)` — eksplicit capture via `POST /epayment/v1/payments/{reference}/capture`
Fix: `handle_payment_return()` capturer nu betalingen ved `AUTHORIZED`-status før booking/gavekort/forløb markeres betalt — depositum capturer kun depositum-beløbet, fuld betaling capturer fuld pris
Fix: gavekort/forløb-flowet (uden `$booking`-objekt) slår beløb op via ny `lookup_capture_amount()` (price_paid fra tb_giftcards/tb_courses) og capturer korrekt
Sikkerhed: hvis capture fejler markeres betalingen IKKE som gennemført — undgår falsk bekræftelse til kunden
v1.71.34Juni 2026
▼
Ny: `apply_filters('tb_mobilepay_settings', ...)` i `TB_MobilePay::s()` — Shell kan injicere per-klinik MobilePay-nøgler
v1.71.33Juni 2026
▼
Fix: `booking_form()` kalder nu `apply_filters('tb_payment_settings', ...)` — allow_card/allow_mobilepay virker korrekt i SaaS
v1.71.32Juni 2026
▼
Ny: `do_action('tb_booking_cancelled', $booking)` i `send_cancellation()` — Shell kan sende notifikation til terapeut og klinik ved klient-aflysning
v1.71.31Juni 2026
▼
Ny: `apply_filters('tb_admin_notification_email', $email, $booking)` i `send_admin_notification()` — Shell kan override modtager til klinikkens email
v1.71.30Juni 2026
▼
Fix: `TB_Email::wrap()` henter nu primærfarve fra `get_option('tb_booking_design')['accent']` — emails følger klinikkens valgte tema i SaaS
v1.71.29Juni 2026
▼
Ny: 4 hooks til SaaS terapeutportal-integration i `class-tb-therapist-portal.php`:
v1.71.28Juni 2026
▼
Fix: Service-dot farve — fjernet inline `style="background:'+svc.color+'"` fra `booking.js`; farve sættes nu via CSS-klasse
v1.71.27Juni 2026
▼
Fix (utilstrækkelig): Service-dot CSS-fallback — virkede ikke, se v1.71.28
v1.71.26Juni 2026
▼
Ny: `.tb-lang-switcher` CSS-klasser i `booking.css` — inline styles fjernet fra `class-tb-shortcodes.php`
Ny: `.tbs-booking-page-title { display:none }` override-punkt for tb-saas
v1.71.25Juni 2026
▼
Intern refaktor (detaljer ikke dokumenteret)
v1.71.24Juni 2026
▼
Intern refaktor (detaljer ikke dokumenteret)
v1.71.23Juni 2026
▼
Ny: `apply_filters('tb_payment_settings', $settings, null)` i `enqueue()` — Shell kan injicere allow_card/allow_mobilepay
Ny: `apply_filters('tb_stripe_secret_key', $key)` i `class-tb-stripe.php` — Shell kan injicere per-klinik Stripe SK
Ny: `apply_filters('tb_stripe_connect_params', [], $data)` — stub til fremtidig Stripe Connect
Ny: Stripe-betalingssti for `purchase_giftcard()` og `purchase_course()` i `class-tb-ajax.php`
v1.71.22Juni 2026
▼
Ny: `invoice_token()` + `invoice_public_url()` i `class-tb-accounting.php` — offentlig faktura-URL
Ny: `maybe_serve_public_invoice()` via `template_redirect` i `class-tb-admin-accounting.php`
v1.71.21Maj 2026
▼
Ny: Bekræftelsesmail viser nu gavekort-information ved gavekortbetaling
Ændret: class-tb-ajax.php gemmer gc_info (type, discount, remaining) på
Ændret: class-tb-email.php bygger $gc_row ud fra booking->gc_amount_used,
v1.71.20Maj 2026
▼
Refaktor: class-tb-admin-settings.php splittet fra 1.290 linjer til 192 linjer
Oprettet admin/settings/ mappe med 7 template-filer (tab-generelt, tab-gavekort,
Alle filer under 600 linjer — ingen logik ændret, kun strukturel opdeling
tb_dc() global funktion erstattet med public static TB_Admin_Settings::tb_dc()
v1.71.12Maj 2026
▼
Oprettet config/constants.php — 9 konfigurérbare konstanter samlet ét sted
therapist-booking.php loader config/constants.php som allerførste include
Magic numbers erstattet med navngivne konstanter i 15 filer
v1.71.10Maj 2026
▼
Fix: Booking-portal krævede to klik for at skifte sprog — rod-aarsag var at
v1.71.09Maj 2026
▼
Refaktorering: Erstattet plugin_locale-filter med switch_to_locale() paa template_redirect
v1.71.08Maj 2026
▼
Fix: Sprogswitcher i terapeut-portal bruger nu ?lang=xx URL-parameter ved reload
Fix: Login-redirect inkluderer ?lang=xx naar terapeutens sprog afviger fra WP site-sproget
Fix: Booking-formularens sproglinks brugte allerede ?lang= korrekt — ingen aendring der
v1.71.07Maj 2026
▼
Fix: Bookingportal viser nu korrekt WP site-sprog som standard (ikke altid engelsk)
Fix: Sprogskift virker nu uanset om WP-admin er sat til dansk eller engelsk
Refaktorering: Erstattet upaalidelig unload/reload paa init med plugin_locale-filter
Ny: tb_match_locale() helper — faelles locale-matching for filter, cookie og GET-param
Ny: tb_set_locale_cookie_from_url() — saetter tb_locale-cookie naar ?lang= bruges i URL
v1.71.06Maj 2026
▼
Fix: Plugin-sproget følger nu altid WP site-sproget (Indstillinger → Generelt) som standard — ingen konflikt med WP-admin sprogvalg
Fix: Klienter og terapeuter kan nu altid skifte sprog uanset hvad WP-admin sproget er sat til
Ny: Forenklet sprog-arkitektur — tb_locale-cookie deles af booking-portal og terapeut-admin; ?lang=xx URL-param sætter cookie
Fjernet: Plugin-sprog indstilling (frontend_locale) fra admin-indstillinger — WP site-sproget er nu altid standard
Fjernet: plugin_locale og load_textdomain_mofile filtere — erstattet af simpel unload/reload på init priority 1
v1.71.05Maj 2026
▼
Fix: Kritisk class-name-fejl (TB_TherapistPortal -> TB_Therapist_Portal) i tb_maybe_reload_textdomain() og tb_filter_plugin_locale() — aarsag til at terapeut-portalens sprogskaelger ikke slog igennem efter reload
Fix: Plugin-locale-filter koerte aldrig get_session_locale() da class_exists-tjekket altid returnerede false
Ny: Dedikeret tb_therapist_locale cookie saettes ved login, locale-skift og ryddes ved logout — giver hurtig locale-detection paa plugins_loaded uden DB-kald
Forbedret: tb_filter_plugin_locale() bruger nu cookie som primaer kilde, DB-opslag som fallback for aeldre sessioner
v1.71.05Maj 2026
▼
Fix: Kritisk class-name-fejl ('TB_TherapistPortal' → 'TB_Therapist_Portal') i tb_maybe_reload_textdomain() og tb_filter_plugin_locale() — årsag til at terapeut-portalens sprogvælger ikke slog igennem efter reload
Fix: Plugin-locale-filter kørte aldrig get_session_locale() da class_exists-tjekket altid returnerede false
Ny: Dedikeret 'tb_therapist_locale' cookie sættes ved login, locale-skift og ryddes ved logout — giver hurtig locale-detection på plugins_loaded uden DB-kald
Forbedret: tb_filter_plugin_locale() bruger nu cookie som primær kilde, DB-opslag som fallback for ældre sessioner
v1.71.03April 2026
▼
Tilføjet 1 ny string (DB-fejl: %s)
POT regenereret: 1198 strings (op fra 1197 i v1.71.02)
100% dækning i en_US.mo
v1.71.02April 2026
▼
Klik på et sprog tilføjer `?lang=xx` til URL'en og reloader siden
Bruger den eksisterende `tb_get_frontend_locale()` URL-prioritering
Vises kun hvis der er mere end ét sprog defineret i `tb_get_supported_locales()`
Sprog persisterer i URL'en (kan deles eller bookmarkes)
Ny `locale VARCHAR(10) DEFAULT NULL` kolonne i `tb_therapists` (auto-migreret via dbDelta)
Ny AJAX-handler `tb_therapist_save_locale` der validerer og gemmer
`TB_TherapistPortal::get_session_locale()` — public helper der returnerer
`get_session_therapist()`: ændret fra `private` til `public static` så
Tilføjet `get_session_locale()` som lightweight alternativ uden side-effekter
`ajax_save_locale()`: validerer mod `tb_get_supported_locales()` før save
JS `portal-lang-switcher` change-event: kalder AJAX og reloader på success
Tilføjet 3 nye strings (Adgangskoderne er ikke ens, Profil gemt ✓, Ugyldigt sprog)
POT regenereret: 1197 strings (op fra 1194 i v1.71.01)
100% dækning i en_US.mo
v1.71.01April 2026
▼
Email/password felter med labels og placeholders
"Log ind"-knap
AJAX-fejlmeddelelser ("Forkert email eller adgangskode.", osv.)
Klinikken sætter standardsprog under Indstillinger → Generelt
Klienter kan overstyre med URL-parameter: `?lang=en` eller `?lang=en_US`
Klientens valgte sprog gemmes i `client_locale` ved booking, så efterfølgende emails (bekræftelse, ændring, aflysning, påmindelse) sendes på samme sprog uanset klinikkens standardsprog
v1.68.32April 2026
▼
Fjernet separat "Påmindelser" submenu-punkt fra sidepanelet
Tilføjet "⏰ Påmindelser"-faneblad i nav-tab-wrapper på Alle bookinger siden
Påmindelsesindholdet renderes direkte via `render_reminders_tab()` (omdøbt fra `page_reminders()`)
Aktiv/deaktiveret-status vises som badge direkte under fanebladet
v1.68.31April 2026
▼
Dialog der vises inden viderestilling til betaling siger nu "Du viderestilles nu til kortbetaling..." ved Stripe og "...til MobilePay betaling..." ved MobilePay
v1.68.30April 2026
▼
`process_confirmed_payment()` refererede `s.label` i SQL — kolonnen eksisterer ikke i `tb_services` (hedder `s.name`)
MySQL returnerede NULL → `if (!$booking) return` — al efterfølgende kode (DB-opdatering, mail, kalender) skippedes
Rettelse: `s.label AS service_label` → `s.name AS service_label`
v1.68.29April 2026
▼
`'stripe'` tilføjet til gyldige betalingsmetoder i `TB_Booking::create()` — ellers gemtes alle kortbetalinger som 'mobilepay' i DB
`handle_return()` kalder nu `process_confirmed_payment()` direkte uden API-opslag: Stripe kalder kun success_url ved gennemført betaling — API-opslaget var overflødigt og fejlede muligvis pga. netværks-timeout
`process_confirmed_payment()` sætter nu `payment_method = 'stripe'` i DB (fuld betaling og depositum)
Booking vises nu korrekt som "Bekræftet / Betalt / Kort" i admin efter Stripe-betaling
Bekræftelsesmail sendes nu korrekt ved Stripe-betalinger
v1.68.28April 2026
▼
Booking med `status='pending'` sættes til `cancelled` når betaling afbrydes (MobilePay og Stripe)
Klienten modtager en tydelig email: "Booking ikke gennemført" med link til at booke igen
Booking oprettes aldrig i kalender ved afbrudt betaling (kun ved bekræftet betaling)
Bookingsiden viser en klar fejlside i stedet for "Betaling afventer" ved abort
`?tb_payment_pending` og `?tb_stripe_cancelled` viser nu samme fejlside som `?tb_payment_failed`
v1.68.28April 2026
▼
Booking med `status='pending'` sættes til `cancelled` når betaling afbrydes (MobilePay og Stripe)
Klienten modtager en tydelig email: "Booking ikke gennemført" med link til at booke igen
Booking oprettes aldrig i kalender ved afbrudt betaling (kun ved bekræftet betaling)
Bookingsiden viser nu en klar fejlside i stedet for "Betaling afventer" ved abort
Fjernet: `?tb_payment_pending` og `?tb_stripe_cancelled` — erstattet af `?tb_payment_failed`
v1.68.27April 2026
▼
`deposit_choice` manglede i `$.post()`-data-objektet i `submitBooking()` — formularen bruger ikke `serialize()` men et manuelt objekt
Serveren modtog aldrig valget og faldt altid tilbage til depositum
Rettelse: `deposit_choice: $('#tb-deposit-choice').val()` tilføjet til POST-data
v1.68.26April 2026
▼
`depositActive` var defineret efter `hasDeposit` brugte den → `hasDeposit` altid `false` pga. JS var-hoisting
Rettelse: `depositActive` flyttes til at blive beregnet før `hasDeposit`
v1.68.25April 2026
▼
Hvis en ydelse kræver depositum, grås "Betal ved behandling"-muligheden ud med teksten "Ikke muligt ved depositum"
Hvis klienten har valgt "Betal ved behandling" og vælger en ydelse med depositum, skiftes automatisk til MobilePay (eller Stripe)
Ingen serverside-ændringer nødvendige
v1.68.24April 2026
▼
Når en ydelse har depositum, vises nu to valgmuligheder i bookingformularen:
Valget er visuelt integreret med de eksisterende betalingskort (samme stil)
Knaptekst og prisinformation opdateres dynamisk efter valg
Panel nulstilles automatisk ved ny ydelse/terapeut
AJAX læser `deposit_choice` og bruger fuld pris ved valg af "full"
v1.68.23April 2026
▼
str_replace slugte afsluttende `}` for foreach + `wp_send_json_success()` + `}` for `get_all_services()` → parse-fejl ved aktivering
Filen er nu syntaktisk korrekt (brace-depth = 0)
v1.68.22April 2026
▼
Admin: null-guard på `$service->deposit_amount` ved oprettelse af ny ydelse
CSS: manglende semikolon i `display:none;` inline style rettet
Stripe: `handle_return` guard udvidet til også at skippe ved `deposit_paid`-status (undgår dobbelt-processing ved webhook-race)
v1.68.21April 2026
▼
Terapeuten kan nu kræve et depositum på ydelsesniveau — indstilles i Ydelseskatalog under "Depositum"
Klienten betaler kun depositumbeløbet online (MobilePay eller Stripe); restbeløbet betales ved fremmøde
Depositum-badge vises på ydelseskortet i bookingformularen
Betalings-UI viser tydeligt opdeling: "Betales nu: X kr. (depositum) — Restbeløb ved fremmøde: Y kr."
Bekræftelsesmail inkluderer separat "Restbeløb"-linje med restbeløb når depositum er betalt
DB: `deposit_amount` på `tb_services`; `requires_deposit`, `deposit_amount`, `deposit_paid`, `deposit_payment_id` på `tb_bookings`
Ny `payment_status`-value: `deposit_paid` (vises som "Depositum betalt" i admin)
Fuldt bakud-kompatibelt: eksisterende ydelser og bookinger påvirkes ikke (DEFAULT 0)
v1.68.20April 2026
▼
Ny `class-tb-reminder.php` — sender påmindelsesmail 26 timer før aftale via WP hourly cron
Cron finder bookinger i ±30 min. vindue; sender kun én gang (marker via `reminder_sent_at`)
Ny `TB_Email::send_reminder()` — branded reminder-email med aftaledetaljer, mødelink og aflysningsknap
Klient mindes om 24-timers aflysningsfrist med tydeligt fremhævet infobox
Tilpasset intro-tekst kan sættes i admin-indstillinger
DB-migration: `reminder_sent_at DATETIME NULL` på `tb_bookings`
Tilføjet to nye Moderne-temaer: Moderne Mørkt og Moderne Lyst
v1.68.15April 2026
▼
TB_MicrosoftCalendar::is_configured() relay-aware — returnerer true når relay er aktivt, så Teams-test virker uden lokale MS credentials
TB_MicrosoftCalendar::get_valid_token() kalder relay ms/refresh-token endpoint ved token-fornyelse i relay-tilstand
relay_url: tvinges automatisk til https:// ved gem — http:// giver mixed content fejl
relay_url: advarsel i admin hvis URL bruger http://
Moderne Mørkt: næsten sort (#0b0c0f) med orange/coral accent (#ff5c35)
Moderne Lyst: varm off-white (#fafaf9) med samme coral accent
Valg af Moderne-tema foreslår automatisk DM Sans-font i designindstillingerne
v1.68.13April 2026
▼
Kortbetaling: Visa, Mastercard og Maestro kort-ikoner vises som badges ud for Kortbetaling-valgmulighed i bookingformularen
v1.68.12April 2026
▼
Stripe kortbetaling: kunder kan nu vælge at betale med kredit- eller debitkort via Stripe Hosted Checkout
Ny klasse class-tb-stripe.php: opretter Checkout Sessions, verificerer webhook-signaturer (HMAC-SHA256), håndterer return og cancel callbacks
Admin: Stripe-sektion i Betaling-fane med Secret Key, Webhook Secret og Test-forbindelsesknap
Admin: ny indstilling allow_card (Kortbetaling aktivér/deaktivér pr. site)
Kortbetaling radio-knap i bookingformular — vises kun når allow_card er slået til
Webhook URL vist direkte i admin: /?tb_action=stripe_webhook med event checkout.session.completed
Stripe-annulleret besked: egen besked når kunden forlader Stripe Checkout uden at betale
Betaling afventer-besked opdateret til at dække både MobilePay og kortbetaling
stripe badge i booking-oversigt og manuelt booking-panel
TB_Stripe::create_checkout_session() understøtter både booking-objekter og array-format (gavekort/forløb)
Dobbelt-bekræftelse guard: både webhook og return-handler tjekker payment_status !== paid inden emails sendes
session_id gemmes som payment_order_id på booking for fuld sporbarhed
Licensgate: kortbetaling kræver samme plan som MobilePay (has_feature mobilepay)
v1.67.04april 2026
▼
Rettet: locked_notice viste fejlagtigt låse-besked på Klinik-plan
v1.68.11April 2026
▼
Refresh-knap på consent-URL sektion (virker både ved succes og fejl)
Detaljeret fejlvisning: fejltype, HTTP-status, relay-respons-body og liste over mulige årsager
v1.68.10April 2026
▼
Consent-URL fetch: site-parameter manglede i relay-kaldet — relay validerede licensen mod eget domæne i stedet for kundens, hvilket gav 'ugyldig licens'
v1.68.09April 2026
▼
Consent-URL hentes nu fra browser (fetch API) i stedet for server-til-server — løser fejl hvor booking-server ikke kunne nå relay-server direkte
v1.68.08April 2026
▼
Kalender-indstillinger: Microsoft admin consent-URL hentes automatisk fra relay-server og vises direkte med Kopiér-knap
Cache på 1 time for consent-URL (ryddes automatisk hvis relay-URL ændres)
save_settings: \$old-variabel tilføjet så cache-ryd ved URL-ændring virker korrekt
v1.68.07April 2026
▼
Kalender-indstillinger: link til Microsoft organisationsgodkendelse (admin consent) når relay er aktivt
Vejledning om at organisationsbrugere skal have IT-admin til at godkende én gang
v1.68.06April 2026
▼
Kritisk: use_teams-checkboxen gemtes ikke fordi TB_Therapist::save() har en hardkodet feltliste — use_teams tilføjet til listen
v1.68.05April 2026
▼
Per-terapeut Teams-toggle: 'Brug Teams til online møder' vises på terapeutprofil når Microsoft 365 er forbundet
DB-migration: `use_teams TINYINT(1)` kolonne på `tb_therapists`
Bagudkompatibilitet: global `online_meeting_provider = teams/both` virker stadig som fallback
v1.68.04April 2026
▼
Kritisk fejl: Microsoft relay sendte 'microsoft' som provider-streng, men klienten tjekkede for 'ms' — $update-array blev tomt, SQL-fejl ved gem af tokens. Relay sender nu konsekvent 'ms'.
v1.68.03April 2026
▼
Relay pickup: fuld debug-log via transient — viser præcist hvad der sker ved hvert trin
Relay pickup: tydelig fejlbesked hvis Microsoft ikke returnerer refresh_token
Relay pickup: DB-verificering efter gem — bekræfter at tokens faktisk er gemt
Admin: debug-log vises automatisk på terapeutsiden efter relay-forsøg
Admin: relay_error URL-parameter giver specifik fejlbesked per fejltype
Relay pickup: fejl resulterede i stum page-reload — nu altid redirect med fejlkode
v1.68.02April 2026
▼
Double-encoding af relay-URL i returlink fra relay (brugte rawurlencode + add_query_arg)
Fjernet overflødig urldecode() i pickup-handler — PHP dekoder $_GET automatisk
Microsoft OAuth: skiftet fra prompt=select_account til prompt=consent for at tvinge ny refresh_token
Microsoft forbindelse viste ikke som aktiv fordi refresh_token ikke altid blev returneret
v1.68.00April 2026
▼
TB OAuth Relay integration: terapeuter forbinder Google Calendar og Microsoft 365 uden at kunden selv opretter API-credentials
Ny indstilling under Kalender-fanen: Relay-toggle + Relay-server URL
`includes/class-tb-relay-client.php`: pickup-handler og auth-URL-builder
Direkte credentials (Google/Microsoft) skjules automatisk når relay er aktiv
Succesbeskeder for relay-forbindelser (google_relay_connected, ms_relay_connected)
Betalingsoplysninger vises automatisk i boks nederst på alle fakturaer
Faktura-header, tabeloverskrifter og accentfarver afspejler valgt farve
v1.65.0April 2026
▼
Nyt regnskabsmodul: Indtægtsoversigt med KPI-kort, månedsgraf og terapeut-/ydelsesfordeling
Datofilter med genveje (denne måned, forrige måned, kvartal, år)
Eksport til Excel/CSV med UTF-8 BOM (Excel åbner korrekt med dansk tegnsæt)
Nyt faktura-modul: opret, rediger og send fakturaer via email
Per-linje momshåndtering: 0% momsfrit og 25% kan blandes på samme faktura
Auto-fakturanummerering med årsbaseret sekvens (2026-001, 2026-002 ...)
Forhåndsudfyld faktura direkte fra booking med ét klik
Print-venlig HTML-faktura: åbnes i ny fane, udskrives/gemmes som PDF via browser
Ny database-tabel: tb_invoices
v1.65.0April 2026
▼
Nyt regnskabsmodul: Indtægtsoversigt med KPI-kort, månedsgraf og terapeut-/ydelsesfordeling
Datofilter med genveje (denne måned, forrige måned, kvartal, år)
Eksport til Excel/CSV med UTF-8 BOM (Excel åbner korrekt med dansk tegnsæt)
Nyt faktura-modul: opret, rediger og send fakturaer via email
Per-linje momshåndtering: 0%% momsfrit og 25%% kan blandes på samme faktura
Auto-fakturanummerering med årsbaseret sekvens (2026-001, 2026-002 ...)
Forhåndsudfyld faktura direkte fra booking med ét klik
Print-venlig HTML-faktura: åbnes i ny fane, udskrives/gemmes som PDF via browser
Ny database-tabel: tb_invoices
v1.65.0April 2026
▼
Nyt regnskabsmodul: Indtægtsoversigt med KPI-kort, månedsgraf og terapeut-/ydelsesfordeling
Datofilter med genveje (denne måned, forrige måned, kvartal, år)
Eksport til Excel/CSV med UTF-8 BOM (Excel åbner korrekt med dansk tegnsæt)
Nyt faktura-modul: opret, rediger og send fakturaer via email
Per-linje momshåndtering: 0% momsfrit og 25% kan blandes på samme faktura
Auto-fakturanummerering med årsbaseret sekvens (2026-001, 2026-002 ...)
Forhåndsudfyld faktura direkte fra booking med ét klik
Print-venlig HTML-faktura: åbnes i ny fane, udskrives/gemmes som PDF via browser
Ny database-tabel: tb_invoices
v1.64.13April 2026
▼
Ydelseskatalog: ny "Dyblink" kolonne med kopi-knap til direkte booking-link per ydelse
v1.64.12April 2026
▼
Nyt bookingflow: klienten vælger nu ydelse først (trin 2), derefter terapeut filtreret på ydelsen (trin 3)
Ny AJAX-handler tb_get_all_services returnerer alle aktive ydelser uden terapeut-filter
Terapeut-overskrift viser nu 'Vælg terapeut — [Ydelse]' efter ydelsesvalg
Klienter fra ydelse-siden (service_id i URL) springer ydelsestrinnet over og lander direkte på terapeut-valg
v1.64.11April 2026
▼
Dato-trin viser nu ydelsens navn i overskriften: 'Vælg dato — Parterapi'
v1.64.10April 2026
▼
Ydelse auto-vælges efter terapeut-valg: klienter der kom fra en ydelse-side springer nu trin 3 (ydelsesvalg) over og lander direkte på kalender
v1.64.9April 2026
▼
Ydelse-link springer nu direkte til terapeut-valg (trin 2) uden at vise type-valgskærmen
Forløb-link springer nu direkte til forløbs-oversigt uden at vise type-valgskærmen
class-tb-courses-shortcode.php: book-link tilføjer nu ?mode=course til URL
class-tb-shortcodes.php: booking-app får nu data-mode attribut fra PHP (samme strategi som data-service)
v1.64.8April 2026
▼
Rettet: service_id URL-parameter virker nu på staging-sites i undermapper
service_id skrives nu som data-service attribut direkte på booking-elementet af PHP — afhænger ikke af URL-parsing
URL-parameter ?service_id=X bevares som fallback for direkte links
v1.64.7April 2026
▼
Rettet: Terapeut-trinnet springes ikke længere over selv om kun én terapeut tilbyder ydelsen — klienten skal altid se og bekræfte hvem der er valgt som behandler
v1.64.6April 2026
▼
Ydelsespreselection: book-knap i shortcode tilføjer nu ?service_id=X til booking-URL
Bookingformular filtrerer terapeuter baseret på service_id — terapeuter der ikke tilbyder ydelsen vises gråede og kan ikke vælges
Hvis kun én terapeut tilbyder den valgte ydelse, vælges den automatisk
Terapeuter sorteres så dem der tilbyder ydelsen vises øverst
v1.64.5April 2026
▼
Bekræftelsesmail til klient viser nu behandlingsnavnet i detalje-tabellen
Admin notifikationsmail viser nu behandlingsnavnet mellem Terapeut og Dato
v1.64.4April 2026
▼
Bookingformular viser nu korrekt platform (Zoom/Teams/Begge) baseret på indstillingen under Online møder
Radio-label og info-boks tilpasses dynamisk til valgt udbyder
Teams vises med lilla farve (#6264A7), Zoom med blå (#2D8CFF)
v1.64.3April 2026
▼
Rettet: Betaling og Design faner var tomme — manglende </div> på Online møder-fanen
tb-tab-online manglede sin afsluttende div, hvilket nested Betaling og Design forkert i DOM'en
v1.64.2April 2026
▼
Rettet: Admin consent redirect gik til wp-admin login — bruger nu home_url som fallback når ikke logget ind
Rettet: prompt=consent ændret til select_account — brugere ser ikke consent-siden igen efter admin har godkendt
Organisationsgodkendelse: vejledning tilføjet om Azure Enterprise Applications → User assignment required → No
v1.64.1April 2026
▼
Rettet: Admin consent callback gav 'ugyldig state' fejl — admin consent og bruger-OAuth er nu separate flows
Admin consent-link generator tilføjet under Indstillinger → Kalender → Microsoft 365
Kopiér-knap til consent-linket der sendes til organisationens IT-administrator
Succes-besked vises i admin når organisationsgodkendelse er gennemført
v1.64.0April 2026
▼
CHANGELOG.md opdateres automatisk ved hvert versionsbump via build-script
Installationslog viser nu altid korrekte ændringsnoter fra CHANGELOG.md
build.py oprettet: automatiserer version-bump, CHANGELOG og ZIP-pakning
v1.63.9April 2026
▼
Installationslog opdateres nu korrekt ved aktivering/opdatering via force=true parameter
`record_version()` logger altid ved aktivering — duplikat-tjek kun ved auto-migrering
Changelog-noter i installationslog: regex rettet til at matche `## v1.63.x` format
CHANGELOG.md udvidet med detaljerede beskrivelser tilbage til v1.50.0 (130+ versioner)
v1.63.8April 2026
▼
Rettet: Installationslog-noter viste ingenting — regex matchede `## [version]` men CHANGELOG.md bruger `## vX.Y.Z` format
Rettet: Changelog-overskrifter usynlige mod mørk baggrund — farver ændret til guld (#c9a96e / #e2c99a)