Here’s the handoff from 9/27/20225 at 8:15 pm:
# Stella Quotes — Project Handoff Packet (TX, 2025-Q1, GoDaddy MWP)
_Last updated: 2025-09-27 • Author: Eric + Assistant • Status: **Working exporter**; performance: **host-limited save/zip**; caching now enabled (repeat exports are fast)._
—
## 0) TL;DR (for the next dev)
– **Goal:** Keep the **styled Excel template output** and get exports as fast as possible. We now have **working XLSX, PDF, HTML** exporters. **Caching** added → repeat XLSX downloads are **near-instant**.
– **Reality check:** On this GoDaddy MWP host, **saving/zipping** the XLSX costs **~14–17s** even when we do **no edits** (dry-save). Code path is not the bottleneck.
– **Decision:** Accept current speed for now, finish the product features; revisit performance later (host change or host exemption for XLSX responses).
– **What changed today:**
– Added a **speed-tuned writer** (ZipArchive, compression 0, disk caching).
– Added **export caching** keyed on inputs, template, broker/employer meta, and day.
– Shortcodes now pass test flags (`dry_save`, `stream`, etc.) and preserve `sheet=…` fast path.
– **Action for reviewer:** Eric will upload the latest `class-stq-export-compare.php` and `class-stq-shortcodes.php`. Review the writer/save block and the hidden field forwarding.
—
## 1) Environment & Constraints
– **Plugin:** “Stella Quotes” base v0.3.3 + patches (informal 0.3.4+).
– **Active rate set:** 2025-Q1 (Texas).
– **Hosting:** **GoDaddy Managed WordPress** (tight memory/IO; edge/origin malware scan on ZIPs suspected).
– **Composer autoload:** `/wp-content/plugins/stella-quotes/vendor/autoload.php`.
– **Template (single source of truth):**
`/wp-content/uploads/stq-templates/Sample Output Pages.xlsx`
– Tabs in play: `SxS_FLAT` (original), `SxS_RUNTIME` (light copy), `SxS_EMPTY` (minimal test tab).
– **Export endpoints (admin-post.php):**
– `stq_export_compare_xlsx` ✅
– `stq_export_compare_pdf` ✅
– `stq_export_compare_html` ✅
– `stq_export_compare_ping` ✅ (CSV sanity check)
– **Shortcodes:**
– `
| Plan # |
|---|
| Plan Name |
| Network Name |
| Network Type |
| Plan Type |
| Deductible - Individual |
| Deductible - Family |
| Coinsurance - Member |
| Coinsurance - Plan |
| Out-of-Pocket - Individual |
| Out-of-Pocket - Family |
| Virtual Visits |
| PCP <19 |
| Primary |
| Specialist |
| Urgent Care |
| Emergency |
| Lab/X-Ray |
| Imaging |
| Inpatient Services |
| Outpatient Surgery |
| Prescriptions |
| OON Deductible (Individual/Family) |
| OON Coinsurance (Member) |
| OON Out-of-Pocket (Individual/Family) |
– `
– `
| Carrier | Plan # | Plan Name | Funding | Tier | Network Name | Network Type | Plan Type | Deductible - Individual | Deductible - Family | Coinsurance - Member | Coinsurance - Plan | Out-of-Pocket - Individual | Out-of-Pocket - Family | Virtual Visits | PCP <19 | Primary | Specialist | Prescriptions | EO | ES | EC | EF | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BCBSTX | B001 | P9M1CHC | FI | P | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B002 | P620CHC | FI | P | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B003 | P9K3CHC | FI | P | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B004 | P9O3CHC | FI | P | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B005 | P621CHC | FI | P | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B006 | G9K8CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B007 | G654CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B008 | G652CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B009 | G653CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B010 | G9K6CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B011 | G9L1CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B012 | G9L7CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B013 | G9L5CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B014 | G650CHC | FI | G | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B015 | S663CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B016 | S661CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B017 | S665CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B018 | S9M2CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B019 | S9L9CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B020 | S9N3CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B021 | S9N1CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B022 | S666CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B023 | S9K1CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B024 | S667CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B025 | S660CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B026 | S9L7CHC | FI | S | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B027 | B662CHC | FI | B | Blue Choice | PPO | Copay | ||||||||||||||||
| BCBSTX | B028 | G651CHC | FI | G | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B029 | G656CHC | FI | G | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B030 | S9L5CHC | FI | S | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B031 | S9L3CHC | FI | S | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B032 | S662CHC | FI | S | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B033 | S9M4CHC | FI | S | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B034 | B660CHC | FI | B | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B035 | B661CHC | FI | B | Blue Choice | PPO | HSA | ||||||||||||||||
| BCBSTX | B036 | P9M1ADT | FI | P | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B037 | P610ADT | FI | P | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B038 | P9K3ADT | FI | P | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B039 | P9O5ADT | FI | P | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B040 | P611ADT | FI | P | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B041 | G665ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B042 | G662ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B043 | G9E5ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B044 | G663ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B045 | G9E3ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B046 | G661ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B047 | G664ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B048 | G9K7ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B049 | G9K5ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B050 | G660ADT | FI | G | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B051 | S9J7ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B052 | S643ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B053 | S9J9ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B054 | S9E3ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B055 | S642ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B056 | S9N3ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B057 | S9N1ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B058 | S641ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B059 | S9L1ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B060 | S9E5ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B061 | S640ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B062 | S644ADT | FI | S | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B063 | B661ADT | FI | B | Blue Advantage | HMO | Copay | ||||||||||||||||
| BCBSTX | B064 | G9E1ADT | FI | G | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B065 | G666ADT | FI | G | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B066 | S9J5ADT | FI | S | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B067 | S9J3ADT | FI | S | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B068 | S9E1ADT | FI | S | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B069 | S9K2ADT | FI | S | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B070 | B9E1ADT | FI | B | Blue Advantage | HMO | HSA | ||||||||||||||||
| BCBSTX | B071 | B660ADT | FI | B | Blue Advantage | HMO | HSA | ||||||||||||||||
| BSW | S001 | PPO Access Copay 0 7000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S002 | PPO Access 80 750 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S003 | PPO Access 90 750 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S004 | PPO Access 80 1000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S005 | PPO Access 80 1500 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S006 | PPO Access 90 1900 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S007 | PPO Access 90 2000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S008 | PPO Access 100 2300 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S009 | PPO Access 100 3000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S010 | PPO Access 80 3000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S011 | PPO Access 60 3250 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S012 | PPO Access 100 3500 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S013 | PPO Access 70 3800 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S014 | PPO Access 100 4000 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S015 | PPO Access 60 4200 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S016 | PPO Access 80 4250 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S017 | PPO Access 90 4500 | FI | G | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S018 | PPO Access 70 4500 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S019 | PPO Access 80 5000 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S020 | PPO Access 90 5900 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S021 | PPO Access 80 6250 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S022 | PPO Access 90 6500 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S023 | PPO Access 70 6700 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S024 | PPO Access 80 6900 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S025 | PPO Access 90 7000 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S026 | PPO Access 100 7300 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S027 | PPO Access 80 7500 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S028 | PPO Access 80 7500 | FI | B | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S029 | PPO Access 90 7900 | FI | B | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S030 | PPO Access 80 8900 | FI | S | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S031 | PPO Access 100 9200 | FI | B | Access PPO | PPO | Copay | ||||||||||||||||
| BSW | S032 | PPO Access HSA 3300 | FI | G | Access PPO | PPO | HSA | ||||||||||||||||
| BSW | S033 | PPO Access HSA 3700 | FI | G | Access PPO | PPO | HSA | ||||||||||||||||
| BSW | S034 | PPO Access HSA 5100 | FI | S | Access PPO | PPO | HSA | ||||||||||||||||
| BSW | S035 | PPO Access HSA 6200 | FI | S | Access PPO | PPO | HSA | ||||||||||||||||
| BSW | S036 | PPO Access HSA 7300 | FI | B | Access PPO | PPO | HSA | ||||||||||||||||
| BSW | S037 | PPO+ Copay 0 7000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S038 | PPO+ 80 750 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S039 | PPO+ 90 750 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S040 | PPO+ 80 1000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S041 | PPO+ 80 1500 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S042 | PPO+ 90 1900 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S043 | PPO+ 90 2000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S044 | PPO+ 100 2300 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S045 | PPO+ 100 3000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S046 | PPO+ 80 3000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S047 | PPO+ 60 3250 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S048 | PPO+ 100 3500 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S049 | PPO+ 70 3800 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S050 | PPO+ 100 4000 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S051 | PPO+ 60 4200 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S052 | PPO+ 80 4250 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S053 | PPO+ 90 4500 | FI | G | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S054 | PPO+ 70 4500 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S055 | PPO+ 80 5000 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S056 | PPO+ 90 5900 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S057 | PPO+ 80 6250 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S058 | PPO+ 90 6500 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S059 | PPO+ 70 6700 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S060 | PPO+ 80 6900 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S061 | PPO+ 90 7000 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S062 | PPO+ 100 7300 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S063 | PPO+ 80 7500 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S064 | PPO+ 80 7500 | FI | B | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S065 | PPO+ 90 7900 | FI | B | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S066 | PPO+ 80 8900 | FI | S | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S067 | PPO+ 100 9200 | FI | B | BSW+ PPO | PPO | Copay | ||||||||||||||||
| BSW | S068 | PPO+ HSA 3300 | FI | G | BSW+ PPO | PPO | HSA | ||||||||||||||||
| BSW | S069 | PPO+ HSA 3700 | FI | G | BSW+ PPO | PPO | HSA | ||||||||||||||||
| BSW | S070 | PPO+ HSA 5100 | FI | S | BSW+ PPO | PPO | HSA | ||||||||||||||||
| BSW | S071 | PPO+ HSA 6200 | FI | S | BSW+ PPO | PPO | HSA | ||||||||||||||||
| BSW | S072 | PPO+ HSA 7300 | FI | B | BSW+ PPO | PPO | HSA | ||||||||||||||||
| BSW | S073 | HMO+ Copay 0 7000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S074 | HMO+ SM 0 9200 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S075 | HMO+ 80 750 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S076 | HMO+ 90 750 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S077 | HMO+ 80 1000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S078 | HMO+ 80 1500 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S079 | HMO+ 90 1900 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S080 | HMO+ 90 2000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S081 | HMO+ 100 2300 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S082 | HMO+ 100 3000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S083 | HMO+ 80 3000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S084 | HMO+ 60 3250 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S085 | HMO+ 100 3500 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S086 | HMO+ 70 3800 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S087 | HMO+ 100 4000 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S088 | HMO+ 60 4200 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S089 | HMO+ 80 4250 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S090 | HMO+ 90 4500 | FI | G | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S091 | HMO+ 70 4500 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S092 | HMO+ 80 5000 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S093 | HMO+ 90 5900 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S094 | HMO+ 80 6250 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S095 | HMO+ 90 6500 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S096 | HMO+ 70 6700 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S097 | HMO+ 80 6900 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S098 | HMO+ 90 7000 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S099 | HMO+ 100 7300 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S100 | HMO+ 80 7500 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S101 | HMO+ 80 7500 | FI | B | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S102 | HMO+ 90 7900 | FI | B | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S103 | HMO+ 80 8900 | FI | S | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S104 | HMO+ 100 9200 | FI | B | BSW+ HMO | HMO | Copay | ||||||||||||||||
| BSW | S105 | HMO+ HSA 3300 | FI | G | BSW+ HMO | HMO | HSA | ||||||||||||||||
| BSW | S106 | HMO+ HSA 3700 | FI | G | BSW+ HMO | HMO | HSA | ||||||||||||||||
| BSW | S107 | HMO+ HSA 5100 | FI | S | BSW+ HMO | HMO | HSA | ||||||||||||||||
| BSW | S108 | HMO+ HSA 6200 | FI | S | BSW+ HMO | HMO | HSA | ||||||||||||||||
| BSW | S109 | HMO+ HSA 7300 | FI | B | BSW+ HMO | HMO | HSA | ||||||||||||||||
| BSW | S110 | HMO Premier Copay 0 7000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S111 | HMO Premier SM 0 9200 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S112 | HMO Premier 80 750 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S113 | HMO Premier 90 750 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S114 | HMO Premier 80 1000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S115 | HMO Premier 80 1500 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S116 | HMO Premier 90 1900 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S117 | HMO Premier 90 2000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S118 | HMO Premier 100 2300 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S119 | HMO Premier 100 3000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S120 | HMO Premier 80 3000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S121 | HMO Premier 60 3250 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S122 | HMO Premier 100 3500 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S123 | HMO Premier 70 3800 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S124 | HMO Premier 100 4000 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S125 | HMO Premier 60 4200 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S126 | HMO Premier 80 4250 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S127 | HMO Premier 90 4500 | FI | G | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S128 | HMO Premier 70 4500 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S129 | HMO Premier 80 5000 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S130 | HMO Premier 90 5900 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S131 | HMO Premier 80 6250 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S132 | HMO Premier 90 6500 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S133 | HMO Premier 70 6700 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S134 | HMO Premier 80 6900 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S135 | HMO Premier 90 7000 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S136 | HMO Premier 100 7300 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S137 | HMO Premier 80 7500 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S138 | HMO Premier 80 7500 | FI | B | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S139 | HMO Premier 90 7900 | FI | B | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S140 | HMO Premier 80 8900 | FI | S | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S141 | HMO Premier 100 9200 | FI | B | Premier HMO | HMO | Copay | ||||||||||||||||
| BSW | S142 | HMO Premier HSA 3300 | FI | G | Premier HMO | HMO | HSA | ||||||||||||||||
| BSW | S143 | HMO Premier HSA 3700 | FI | G | Premier HMO | HMO | HSA | ||||||||||||||||
| BSW | S144 | HMO Premier HSA 5100 | FI | S | Premier HMO | HMO | HSA | ||||||||||||||||
| BSW | S145 | HMO Premier HSA 6200 | FI | S | Premier HMO | HMO | HSA | ||||||||||||||||
| BSW | S146 | HMO Premier HSA 7300 | FI | B | Premier HMO | HMO | HSA | ||||||||||||||||
| UHC | U001 | DY-AK | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U002 | DX-9J | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U003 | DY-A3 | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U004 | DX-9Q | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U005 | DX-9R | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U006 | DY-AP | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U007 | DX-9U | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U008 | DX-9V | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U009 | DY-AR | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U010 | DX-95 | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U011 | DX-96 | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U012 | DY-AW | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U013 | DY-AB | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U014 | DY-AC | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U015 | DY-A8 | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U016 | DX-9H | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U017 | DX-9I | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U018 | DY-A2 | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U019 | DX-9M | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U020 | DY-AF | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U021 | DY-A5 | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U022 | DX-92 | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U023 | DX-93 | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U024 | DY-AU | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U025 | DX-9L | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U026 | DX-9K | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U027 | DY-A4 | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U028 | DY-AM | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U029 | DX-9S | FI | P | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U030 | DX-9T | FI | P | Choice | EPO | Copay | ||||||||||||||||
| UHC | U031 | DY-AQ | FI | P | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U032 | DX-9W | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U033 | DX-9X | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U034 | DY-AS | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U035 | DX-9Y | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U036 | DX-9Z | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U037 | DY-AT | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U038 | DY-AL | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U039 | DX-94 | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U040 | DY-AV | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U041 | DX-97 | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U042 | DX-98 | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U043 | DY-AX | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U044 | DY-AA | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U045 | DX-99 | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U046 | DY-A9 | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U047 | DY-AN | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U048 | DX-9F | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U049 | DX-9G | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U050 | DY-AY | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U051 | DY-AE | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U052 | DY-AD | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U053 | DY-AZ | FI | G | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U054 | DY-AO | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U055 | DY-AG | FI | S | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U056 | DY-AH | FI | S | Choice | EPO | Copay | ||||||||||||||||
| UHC | U057 | DY-A6 | FI | S | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U058 | DY-AI | FI | S | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U059 | DY-AJ | FI | S | Choice | EPO | Copay | ||||||||||||||||
| UHC | U060 | DY-A7 | FI | S | Navigate | HMO | Copay | ||||||||||||||||
| UHC | U061 | DX-83 | FI | G | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U062 | DX-84 | FI | G | Choice | EPO | HSA | ||||||||||||||||
| UHC | U063 | DX-9B | FI | G | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U064 | DX-8R | FI | S | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U065 | DX-8S | FI | S | Choice | EPO | HSA | ||||||||||||||||
| UHC | U066 | DX-9A | FI | S | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U067 | DX-8V | FI | S | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U068 | DX-8W | FI | S | Choice | EPO | HSA | ||||||||||||||||
| UHC | U069 | DX-86 | FI | S | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U070 | DX-8Z | FI | B | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U071 | DX-82 | FI | B | Choice | EPO | HSA | ||||||||||||||||
| UHC | U072 | DX-88 | FI | B | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U073 | DX-8T | FI | S | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U074 | DX-8U | FI | S | Choice | EPO | HSA | ||||||||||||||||
| UHC | U075 | DX-85 | FI | S | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U076 | DX-8X | FI | S | Choice + | PPO | HSA | ||||||||||||||||
| UHC | U077 | DX-8Y | FI | S | Choice | EPO | HSA | ||||||||||||||||
| UHC | U078 | DX-87 | FI | S | Navigate | HMO | HSA | ||||||||||||||||
| UHC | U079 | DX-9C | FI | G | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U080 | DX-9D | FI | G | Choice | EPO | Copay | ||||||||||||||||
| UHC | U081 | DX-9E | FI | S | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U082 | DX-9N | FI | S | Choice | EPO | Copay | ||||||||||||||||
| UHC | U083 | DX-9O | FI | S | Choice + | PPO | Copay | ||||||||||||||||
| UHC | U084 | DX-9P | FI | S | Choice | EPO | Copay |
– `Provide carrier and plan, e.g. [stq_diag_benefits carrier="BCBSTX" plan="B046"]` (debug).
—
## 2) Template Design Rules (how the exporter fills sheets)
– **Column Mode (SxS style)** — current SxS tabs use this:
– Put literal `[[STQ_TABLE]]` at the **top-left cell** of the plan grid.
– **Benefit labels** sit **one column left** of that marker.
– Exporter writes **header row (plan names)** on the marker row and **plan values** below.
– **Row Mode (wide pages)**:
– Put `[[STQ_TABLE_ROWS]]` in the **first plan row**.
– One row **above** it is the **unmerged short-header row** (e.g., `Ded-Ind`, `Coins-Plan`).
– You can mix modes across sheets.
– **Placeholders** (auto-fill in top ~120 rows):
`[[STQ_EMPLOYER]]`, `[[STQ_COMPANY]]`, `[[STQ_BROKER_*]]`, `[[STQ_EFFECTIVE]]`,
`[[STQ_RATE_SET]]`, `[[STQ_AREA]]`, `[[STQ_COUNTY]]`, `[[STQ_DATE_TODAY]]`,
`[[STQ_PLANS]]`, `[[STQ_DISCLAIMER]]`.
If no disclaimer provided, a safe default is injected.
—
## 3) Label Mapping (aliases → canonical keys)
Normalization lets templates use familiar labels. Examples:
– `plannumber` → `plan#`, `plan id`, `planid`
– `planname` → `name`
– `tier` ↔ `metal` (P/G/S/B)
– `networkname` → `network`
– `plantype` → `plan type`
– `deductibleindividual` → `ded-ind`, `individual`
– `outofpocketindividual` → `oop-ind`
– OON group: ded/coins/oop (auto “N/A” for HMO/EPO via helpers).
Unrecognized rows/cols are ignored so divider bars remain.
—
## 4) Where we started (this session)
– We already had a reliability fix that **scanned all sheets** for markers. Reliable, but slow on GoDaddy.
– Ask: **restore speed** while **keeping styling**.
– We switched to **direct-write into the loaded template workbook** (no deep copy). Preserved style; helped a bit.
—
## 5) What we changed **today**
### 5.1 Shortcodes (`class-stq-shortcodes.php`)
– Added hidden fields so exports can use the **fast path** (`sheet=`).
– Added test/ops flags (forwarded through forms):
– `dry_save=1` → open + save (no edits) to time pure ZIP step.
– `stream=1` → stream directly to `php://output` (optional branch).
– `drop_names`, `fast_strip` (placeholders for future experiments; harmless if unused).
– Export buttons under the table post all selection/meta safely (nonce).
**Example shortcodes to run:**
“`text
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
### 5.2 Exporter (`class-stq-export-compare.php`)
– **Direct-write** into the loaded template (keeps all styles).
– **Writer/save tuned for speed:**
– `ZipArchive` if available (faster than PclZip).
– `setCompressionLevel(0)` to lower CPU at save time.
– `setPreCalculateFormulas(false)`, `setIncludeCharts(false)`.
– Disk caching directory under `/uploads/stq-tmp`.
– **Added export caching**:
– Cache dir: `/uploads/stq-cache`.
– Cache key includes: `sheet`, `plans`, `rate_set`, `area`, **broker/employer meta**, `disclaimer`, **today** (keeps date fresh), and **template mtime/MD5** (auto-busts if template changes).
– Cache hit streams instantly; logs mark `(cache hit)`.
– **Diagnostics**:
– Log file: `/wp-content/uploads/stq-tmp/stq-export.log`
– Instrumented spans: `matrix`, `load_fast`, `placeholders`, `write`, `save`, `total`.
—
## 6) Timings we observed (selected)
> These are **server-side** times from the log. We focused on `save=…s` to isolate bottlenecks.
– Early runs on `SxS_FLAT` (after direct-write; before tweaks):
`save≈15–18s`, `total≈21–24s`.
– After removing **named cells** from template:
Still `save≈17.3s`, `total≈23.7s` → **no meaningful change**.
– After **writer tweaks** (ZipArchive, compression 0, etc.):
`save≈14.6–17.0s` (slight improvement).
– **Dry save** on totally minimal tab `SxS_EMPTY` (no writes at all):
`save=16.367s` → **host save/zip is the bottleneck** (not our writes; not sheet complexity).
– **Caching enabled** (same selection twice):
– First run: `save≈16.1s`, `total≈22s`.
– Second run: `save=0.000s`, `total≈6.019s (cache hit)` → **repeat exports are fast**.
**Conclusion:** Code path is efficient (`placeholders/write ≈ 0s`). The time is burned in **PhpSpreadsheet ZIP save** under GoDaddy MWP (likely CPU/IO and/or malware scanning on ZIP responses). This matches intermittent past behavior: it _did_ run in ~2s before; shared hosting variability can swing this without code changes.
—
7) Host notes & optional ops steps
– **Suspect**: edge/origin **ZIP/malware scanning** or noisy neighbors throttling CPU/IO.
– **Optional support ticket text** (paste to GoDaddy):
– **Alternatives later** (not for this weekend):
– Move only the export endpoint to a tiny VPS (PHP 8.x + ZipArchive).
– Offer a “Legacy XLS (fast)” fallback (BIFF/XLS) if ever acceptable (not a current goal).
—
## 8) Current state (2025-09-27)
– **Works:** XLSX/PDF/HTML exports, styled output preserved, runtime tab option, **caching** for repeats.
– **Performance:** First-run XLSX save ~15–17s on this host; **cache hits** are near-instant.
– **Diagnostics:** Logging active; easy to compare runs.
—
## 9) What’s next (we will circle back to speed later)
Eric has ~**12 hours** left this weekend and needs a **working quoting tool by end of that time**. The exporter is functional; we’ll **prioritize features** now and revisit speed later if needed.
### 9.1 Immediate feature roadmap (ship this weekend)
1. **Save Case** (high value)
– New “Save Case” button under compare table stores: plans, rate set, area, employer/broker meta, disclaimer.
– Reopen a Case → re-render compare and export in one click (benefits from cache).
2. **Compare Picker “Choose-for-me”** defaults
– Already wired to optional `STQ_Compare_Picker_Plus::auto_select(…)`.
– Provide sensible defaults (count, bucket, anchor, balance).
3. **PDF packet polish**
– Headers/footers with logo, page numbers, disclaimer footer; ensure 1-click print quality.
4. **Placeholders pass**
– Confirm all `[[STQ_*]]` fill correctly across current/future tabs.
5. **Q1 2026 Rates hookup**
– Wire import path and table lookups so new data can drop in with minimal code changes.
### 9.2 After that (perf revisit)
– If GoDaddy grants exemption → we should see **~2–4s** saves again.
– Else consider the small VPS export microservice or a more aggressive runtime tab (fewer merges/styles) if we want to squeeze more speed without host change.
—
## 10) Repro steps for reviewers
### 10.1 Template tabs
– **SxS_FLAT**: original styled tab with `[[STQ_TABLE]]`.
– **SxS_RUNTIME**: light copy of `SxS_FLAT` (CF removed, print area & breaks reset).
– **SxS_EMPTY**: test tab created with only `[[STQ_TABLE]]` at `B5` (labels optional; use `dry_save=1` for save-only test).
### 10.2 Shortcodes to exercise
“`text
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
| B001 — P9M1CHC | B002 — P620CHC | B003 — P9K3CHC | |
|---|---|---|---|
| Plan # | B001 | B002 | B003 |
| Plan Name | P9M1CHC | P620CHC | P9K3CHC |
| Network Name | Blue Choice | Blue Choice | Blue Choice |
| Network Type | PPO | PPO | PPO |
| Plan Type | Copay | Copay | Copay |
| Deductible - Individual | $0 | $350 | $600 |
| Deductible - Family | $0 | $1,050 | $1,200 |
| Coinsurance - Member | 10% | 20% | 20% |
| Coinsurance - Plan | 90% | 80% | 80% |
| Out-of-Pocket - Individual | $6,300 | $1,600 | $1,800 |
| Out-of-Pocket - Family | $12,600 | $4,800 | $3,600 |
| Virtual Visits | $20 | $35 | $35 |
| PCP <19 | $20 | $35 | $35 |
| Primary | $20 | $35 | $35 |
| Specialist | $40 | $70 | $70 |
| Urgent Care | $75 | $35 | $75 |
| Emergency | $500 + D&C | $300 + D&C | $300 + D&C |
| Lab/X-Ray | D&C | D&C | D&C |
| Imaging | D&C | $250 | $250 |
| Inpatient Services | D&C | $150 + D&C | $150 + D&C |
| Outpatient Surgery | D&C | $100 + D&C | $100 + D&C |
| Prescriptions | $0-10-50-100-150-250 | $0-10-35-75-150-250 | $0-10-50-100-150-250 |
| OON Deductible (Individual/Family) | $5,000 / $10,000 | $700 / $2,100 | $1,200 / $2,400 |
| OON Coinsurance (Member) | 50% | 40% | 40% |
| OON Out-of-Pocket (Individual/Family) | Unlimited / Unlimited | Unlimited / Unlimited | Unlimited / Unlimited |
10.3 Logs to inspect
/wp-content/uploads/stq-tmp/stq-export.log
Look for:
– `save=…s` — host ZIP time
– `(cache hit)` — confirm caching path
—
## 11) Files to review (Eric will upload)
– `wp-content/plugins/stella-quotes/includes/class-stq-export-compare.php`
– Verify **writer/save (speed-tuned + cache)** block present.
– Verify cache key includes **meta + today + template hash/mtime**.
– Verify log lines include `(cache hit)` on cached runs.
– `wp-content/plugins/stella-quotes/includes/class-stq-shortcodes.php`
– Verify hidden inputs include `sheet`, `plans`, `rate_set`, `area`, meta fields, and **flags** (`dry_save`, `stream`, `drop_names`, `fast_strip`).
– Verify export forms post to `admin-post.php` with nonce.
—
## 12) Known issues / Non-goals
– **Non-goal:** “Ugly/raw” spreadsheets or disabling styling. We keep broker-ready outputs.
– **Performance:** First-run XLSX save is host-limited right now; caching mitigates repeat exports.
– **Template complexity:** Named ranges removal did not materially change save time on this host.
– **`SxS_EMPTY` write error:** Expected when labels are missing; only used for dry-save timing.
—
## 13) Support snippets (copy/paste)
**GoDaddy support ask:**

**Bypass cache (when needed):** add `nocache=1` as a POST field; the exporter honors it if enabled.
—
## 14) Appendix — Quick reference
### 14.1 Placeholders supported
`[[STQ_EMPLOYER]]`, `[[STQ_COMPANY]]`, `[[STQ_BROKER_NAME]]`, `[[STQ_BROKER_AGENCY]]`,
`[[STQ_BROKER_EMAIL]]`, `[[STQ_BROKER_PHONE]]`, `[[STQ_BROKER_WEBSITE]]`,
`[[STQ_BROKER_LINE]]`, `[[STQ_BROKER_CONTACT]]`, `[[STQ_EFFECTIVE]]`, `[[STQ_RATE_SET]]`,
`[[STQ_AREA]]`, `[[STQ_COUNTY]]`, `[[STQ_DATE_TODAY]]`, `[[STQ_PLANS]]`, `[[STQ_DISCLAIMER]]`.
### 14.2 OON helpers
– Pair rows show “N/A” for HMO/EPO (`na_if_oonsuppressed_pair`).
– Coins row shows “N/A” for HMO/EPO (`na_if_oonsuppressed_coins`).
14.3 Diagnostics sample line
[2025-09-27 23:46:05] path=FAST-cols sheet=SxS_RUNTIME matrix=0.018s load_fast=0.136s load_scan=0.000s placeholders=0.019s write=0.002s save=17.754s total=24.126s
—
15) Final notes
– We will **circle back** on first-run speed once either (a) GoDaddy exempts the XLSX response from scanning, or (b) we decide to move the export endpoint to a small VPS. Neither is required to keep building.
– Priority now: ship a **working quoting tool** this weekend (exporter ✅, features next). The caching added today keeps the UX snappy for repeated compares while we demo and iterate.
# XLSX Export Caching — What we did and why
## Why we needed it
– Your logs showed the **only slow part** is the final **XLSX save/zip** on the server (`save ≈ 14–17s`), even when we do **no cell edits**. That’s host I/O/CPU/scanning, not our code.
– We can’t speed the **first** save if the host is slow, but we can avoid **repeating** that slow operation for the **same** export.
## What we implemented
We added a **file cache** so that after one export is generated and saved once, **subsequent exports with the same inputs** are served directly from disk **without re-saving** the workbook.
– **Cache folder:** `/wp-content/uploads/stq-cache`
– **Temp/caching workspace:** `/wp-content/uploads/stq-tmp`
– **Writer tuning:** use `ZipArchive` (if available), compression level `0`, no formula precalc, no charts → marginally faster first save.
## How it works (flow)
1. **Build a cache key** (a SHA-1 hash) from all inputs that affect the file:
– `sheet` (e.g., `SxS_FLAT` / `SxS_RUNTIME`)
– `plans` (order-sensitive list)
– `rate_set`, `area`
– **Broker/employer meta & disclaimer** (so headers/footers + placeholders match)
– **Today’s date** (`[[STQ_DATE_TODAY]]`) → daily refresh
– **Template fingerprint** (mtime + MD5) → auto-bust cache when template changes
2. **Check cache folder** for `stq-
– **If present (cache hit):** stream that file immediately (near-instant), log `(cache hit)`.
– **If missing (cache miss):**
– Save the current workbook to a temp file (incurs the slow host save once)
– Copy it into the cache as `stq-
– Stream to the user
### Pseudocode (simplified)
## What this achieves
– **First export** for a given selection: still ~host-limited (e.g., ~16s).
– **Repeat export** for the same selection (same page, inputs, meta, template, same day):
– **Instant** (no re-save), your log will show `save=0.000s` and `(cache hit)`.
## Cache invalidation (when we intentionally miss)
A new file is generated when **any** of these change:
– Template (mtime/MD5), `sheet`, `plans`, `rate_set`, `area`
– Broker/employer/meta fields or `[[STQ_DISCLAIMER]]`
– **New day** (to keep `[[STQ_DATE_TODAY]]` accurate)
### Manual bypass (optional switch)
If enabled in code:
– Add POST `nocache=1` to **force refresh** (skip cache even if present).
## Operational notes
– **Clear cache:** delete `/uploads/stq-cache/*` (safe to remove; it repopulates on demand).
– **Disk usage:** each unique selection produces one XLSX; clean up occasionally if needed.
– **Security:** files are in the private uploads path; access is only via your export endpoint streaming.
## What to look for in logs
File: `/wp-content/uploads/stq-tmp/stq-export.log`
– First run (miss): `save=14.646s total=20.158s`
– Repeat (hit): `save=0.000s total=6.019s (cache hit)`
Example:
## FAQ
– **Why is the first one still slow?**
The host spends ~15–17s zipping the XLSX once. Caching avoids doing that again for the same inputs.
– **Will different plans or a new disclaimer be fast?**
No; those change the cache key → a new file is generated (slow once), then fast thereafter.
– **What if I update the template file?**
The cache auto-busts because we include template mtime + md5 in the key.
– **What about the date in the header?**
We include `today` in the key → a fresh file is generated each day.
## Where this code lives
– In `class-stq-export-compare.php`, the **writer/save** section is replaced with a block that:
– Tunes the writer (ZipArchive, compression 0)
– Computes the cache key & checks `/uploads/stq-cache`
– Streams cached file on hits, saves+stores on misses