Shortlink Manager Evolved: Smarter Analytics, QR Codes, and AI-Driven Development
February 24, 2026Welcome to this special edition update! I've been hard at work on some major architectural changes for the Shortlink Manager module for Drupal, and the progress made over the last week was too significant to keep under wraps.
This release is two-fold. First, it introduces a suite of features I've had on my roadmap for a long time—things like click analytics and automated health checks. Second, this was my first real-world run using Claude Code.
I'll be honest: given my current schedule, these features should have taken me two or three months to build and test. By leveraging Claude Code as a high-level pair programmer, I've managed to compress that timeline into a single focused sprint.
Beyond Redirects: The New Suite
I've focused this update on four key areas that move the module from a basic redirect tool to a full-featured management suite.
1. My New Click Analytics Engine
Previously, I only tracked a basic redirect count. Now, I've implemented a dedicated shortlink_clicks table to give me a much clearer picture of my traffic.
- The Data: I'm now capturing referrers, user agents, and timestamps for every click.
- The Privacy: To keep my data collection responsible, I'm using SHA-256 hashing for IP addresses.
- The Dashboard: I've added a "Shortlink Dashboard" block so I can see my top-performing links and recent activity directly in my Drupal admin.
2. Intelligent Expiration Logic
I found that many of my marketing links have a shelf life. Instead of me having to manually disable them, I built three expiration methods into the module:
- Specific Date/Time: Perfect for my fixed-date campaigns.
- Maximum Clicks: Useful when I run "first-come, first-served" offers.
- Inactivity: I can now automatically expire links that haven't been touched in a set number of days.
3. Integrated QR Code Generation
To bridge the gap between offline and online, I've integrated the endroid/qr-code library. I've added the ability to generate and download PNG QR codes for any shortlink directly from the listing view—a feature I know will be a major time-saver for anyone managing print or physical media campaigns.
4. My Automated Health Checks
Broken links are the enemy of clean analytics. I've added a "Broken Destination Detection" system that acts as an early warning for my site. The module now flags links pointing to:
- Deleted or unpublished content.
- Invalid internal paths or broken external URLs.
- Redirect Chains: It identifies if a shortlink points to another redirect, which helps me keep my site speed up.
Comparison: My Main Branch vs. 1.1.0-beta2
| Feature | Main Branch (Standard) | New Beta Branch |
|---|---|---|
| Tracking | Basic Count | Full Click Logs (Referrer/User Agent) |
| Vanity URLs | Auto-generated only | Custom slugs with collision validation |
| QR Codes | None | Native PNG generation & download |
| Maintenance | Manual | Automated Expiration & Health Checks |
| Drush Support | None | Commands for health checks & bulk generation |
The "AI" Elephant in the Room
As I look toward eventually moving this module to Drupal.org, my priority remains code quality and security. I'm being very intentional about how I use Claude Code in this project.
I gave the AI access to both Drupal 10.5.x and Drupal 11.x source code on my system so it understood the specific environments and API nuances. By providing these references, the AI was constrained by real-world Drupal standards for both versions to ensure compatibility for both versions. While Claude was excellent at scaffolding the heavier lifts—like the Batch API integrations and the database schema—it also suggested features I hadn't originally considered but immediately saw the value in.
However, the "final word" is always mine. Claude did the heavy lifting for me, but I am currently testing everything on my live site to vet the code personally. I'm spending my time auditing every line and fixing bugs found during live testing. For a sole maintainer, this isn't about replacing the developer; it's about amplifying the architect.
Transparency Note: You can see the specific bugs I've already squashed and the features I've vetted in the closed issues on GitHub.
Join the Beta: How to Test
I'm looking for fellow builders to help me put these features through their paces. If you're running a Drupal 10.5+ or 11.2+ environment and want to help me vet this new functionality, you can require the beta version specifically. This version is fully backwards compatible with the 1.0.x series, so you won't lose your existing data.
Note: You'll need to ensure your composer.json allows for beta stability.
composer require r0nn1ef/shortlink_manager:1.1.0-beta2
drush updb
drush crWhat to look for:
- QR Code generation: Does the PNG download correctly on your server setup?
- Cron Expiration: Is it clearing the queue as expected in your environment?
- Drush
sl:check: Is it accurately identifying broken links on your site?
If you run into any issues or environment-specific bugs, please open a new issue on the 1.1.0-beta2 release page so I can track and fix them before the stable 1.1.0 release.
Let's Talk Roadmaps
I'm considering adding a feature to export these click logs directly to CSV for external reporting. Is that something you would find useful, or should I focus on adding more Drush commands for automation?
I'd love to hear your thoughts! Catch me on my socials to discuss the roadmap or just to say hi. I'm always looking for feedback from fellow builders.
0 Comments
Login or Register to post comments.