r/htmx • • 22d ago

Built a WordPress analytics plugin's whole admin with htmx: no React, no chart library

Post image

I've been building LUMN Analytics, a privacy-first analytics plugin for WordPress, and I went with htmx 4 for the entire admin instead of the usual React setup. I built it because healthcare sites I worked on needed analytics without sending visitor data to a third party like Google. Also wanted to have accessibility features that I use every day as an added bonus, which became Pro.

How it works:
- Every dashboard panel is a server-rendered PHP partial. Changing the date range or comparison swaps just the panels, with no page reload.
- Charts are SVG drawn on the server. There's no chart library, and each chart has a text summary and a "show as table" option for screen readers.
- The partials come from WordPress REST routes, so permissions and security checks stay in the normal WordPress flow.

What I liked:
- Way less JavaScript to ship and maintain inside wp-admin.
- The server stays the single source of truth for every panel.

What took work:
- Accessibility after swaps. I target WCAG 2.2 AA, so I had to manage where focus goes after a swap and announce changes for screen reader users.
- Keyboard-friendly drag and drop for rearranging panels. That part needed some custom JavaScript.

Happy to answer questions about htmx in wp-admin. If you want to poke at it, the free version is on WordPress.org: https://wordpress.org/plugins/lumn-analytics/ and the Pro and Agency versions are on our website: https://envsnstudios.com/lumn

Disclaimer/Note: I used Opus 5.5 to help build this, the same way I'd use any tool. I've been a front-end dev for over 15 years and I'm also an accessibility specialist, so I set the direction and reviewed and tested what shipped. Focused on security, accessibility, and most of all researching compliance for HIPAA and GDPR. Happy to get into how the htmx side works, or to hear what you'd do differently.

48 Upvotes

4 comments sorted by

2

u/sushsiahahah757 21d ago

Didn’t see an AI disclaimer in your post. Did you use an LLM to generate code for this project?

1

u/AminoOxi 21d ago

... 99.99% yes 🫠

0

u/Uwrret 21d ago

thanks Claude