I needed a comment system for plain PHP websites. A system that works on nothing more than the classic LAMP stack that every shared host offers. Hosted services were out of the question, since they keep the conversation on someone else's servers. A self-hosted script was what I wanted.
I found HashOver on GitHub, a free comment system written by Jacob Barkdull that does exactly that. Its design was right, but its last release dates from 2019: seven years without updates is a long time for computer code that faces the open internet. So I brought it up to date with Claude Code: first a port to PHP 8.4 with a security audit, then a complete rewrite on a modern base. The result is HashOver 2, and it's right here (the comment section at the bottom of this page).
What changed in HashOver 2
- Runs on PHP 8.4 and newer, with strict types and Composer, and stores comments in an SQLite database.
- Security hardened with current practices. Every request is checked against cross-site forgery, passwords are hashed with
password_hash(), e-mail addresses are encrypted, and comments go through an HTML5 sanitiser with an allow-list. - Built to WCAG 2.1 level AA, to make commenting accessible to everyone.
Main features
- Threaded replies, likes, the most popular comments highlighted, and four sort orders.
- No account needed. Visitors can comment anonymously; only the comment itself is required. Adding a password lets them edit or delete their comments later, from any browser.
- Moderation is included. An administrator login to edit or delete any comment, straight from the page.
- Notification e-mails to the site owner for every new comment, and to commenters when someone replies to them.
- Works without JavaScript.
- Five languages included: English, French, German, Spanish and Japanese, chosen per page, so the translations can share a single thread.
- Spam protection with a built in honeypot; Akismet and Cloudflare Turnstile can be switched on.
- RSS feeds per page, and comment counts for links in article lists.
Privacy features
Comments stay on your own server. Gravatar, storing IP addresses and every external service are off unless you turn them on, and stored IP addresses are forgotten after a retention period. HashOver 2 also works under a strict Content-Security-Policy: no inline scripts, styles or event handlers.
Requirements
Any LAMP host with PHP 8.4 or newer and the dom, mbstring, pdo_sqlite and sodium extensions. No separate database server: SQLite is a single file. HashOver lives outside the website's document root, so its code, configuration and comments can't be downloaded; the installation guide also covers shared hosting.
See it in action
HashOver 2 runs on this website. The comment section at the bottom of this page is HashOver 2, and so is the one under every project, every IT tip and every blog article.
Further information
- HashOver 2 is free software under the GNU Affero General Public License, version 3 or later (AGPL-3.0); the code is available on GitHub, with the security design documented.
- HashOver was created by Jacob Barkdull in 2014: original project on GitHub. HashOver 2 is a rewrite and is not compatible with HashOver 1.x installations.
- The AGPL asks you to offer the source code to your visitors if you modify HashOver on your website. By default, a "HashOver source code" link under every comment thread does that; a page like this one, linking to the code, can do it instead.
Comments
0 comments
No comments yet. Be the first to comment!