shlinkio/shlink
61.0
Adequate · 17 November 2026
18.1k
lines of production code
PHP
primary language
5
measurements over time
What this system is
Features
API keys now support role-based restrictions and structured metadata
Users can now create API keys with specific permissions (roles) rather than having unrestricted access. The system introduces a new \ApiKeyMeta\ model to handle key metadata, including auto-generated names and expiration dates, and a \RoleDefinition\ class to define specific restrictions such as limiting keys to authored short URLs, domain-specific access, or excluding orphan visits. This allows for more granular control over API key capabilities.
module/Rest/src/ApiKey/Model · high confidence
Add Matomo integration for sending visit data
This change introduces a new capability to send visit data to a Matomo analytics instance. It adds configuration options (MatomoOptions) to enable the feature and define connection details like base URL, site ID, and API token via environment variables. A new service (MatomoVisitSender) and builder (MatomoTrackerBuilder) handle the actual transmission, including setting a 10-second timeout, sending country codes instead of names, and passing visit dates. The implementation includes logic to resolve short URLs, set referrers, and handle IP addresses, with a result model to track successful and failed sends.
module/Core/src/Matomo · high confidence
Add hidden CLI command to read environment variable values
A new hidden CLI command \env-var:read\ has been added to the Config module, allowing users to display the current value of a specified Shlink environment variable. The command accepts an environment variable name as an argument and uses an interactive prompt to help users select from the list of valid Shlink environment variables if none is provided, ensuring the input is valid before displaying the formatted value.
module/CLI/src/Command/Config · high confidence
Added Apache and Nginx virtual host configuration examples
New example configuration files for Apache and Nginx have been added to help users deploy Shlink. The Apache example sets up a virtual host on port 80 pointing to the Shlink public directory, while the Nginx example configures a server block with PHP-FPM support (targeting PHP 8.4 via the socket path) and security rules to deny access to hidden files.
data/infra/examples · high confidence
Added Mercure event listeners for short URLs and visits
New event listeners have been added to publish short URL creation and visit events to Mercure. The \NotifyNewShortUrlToMercure\ and \NotifyVisitToMercure\ classes extend abstract base listeners to handle these specific events, enabling real-time updates via the Mercure protocol for these actions.
module/Core/src/EventDispatcher/Mercure · high confidence
Added Redis Pub/Sub listeners for short URL and visit events
New event listeners, NotifyNewShortUrlToRedis and NotifyVisitToRedis, have been added to the Core module to publish real-time updates via Redis Pub/Sub. These classes extend existing abstract async listeners and integrate with the unified publishing API, allowing real-time update topics to be enabled or disabled individually via configuration options.
module/Core/src/EventDispatcher/RedisPubSub · high confidence
Added visit count tracking for short URLs and orphan visits
New listener classes, ShortUrlVisitsCountTracker and OrphanVisitsCountTracker, have been added to the Core module to increment visit counts in the short\_url\_visits\_counts and orphan\_visits\_counts database tables respectively. These listeners hook into the Doctrine ORM lifecycle (onFlush and postFlush) to detect new Visit entities and update the corresponding counters using database-specific upsert syntax (MySQL, PostgreSQL) or a select-then-insert/update pattern for other platforms like SQLite and SQL Server.
module/Core/src/Visit/Listener · high confidence
Core module introduces centralized configuration loading
The new Core module provides a ConfigProvider that automatically loads application configuration from PHP files matching the pattern {,\*.}config.php in the module's config directory. This abstracts the configuration loading process, allowing the application to aggregate settings from multiple config files seamlessly.
module/Core/src · high confidence
Initial Docker image support with RoadRunner and configurable entrypoint
This change introduces the first official Docker image for Shlink, serving the application via RoadRunner. The provided entrypoint script automates the initialization process by creating necessary data directories, conditionally downloading the GeoLite2 database based on the GEOLITE\_LICENSE\_KEY environment variable, and optionally creating an initial API key via INITIAL\_API\_KEY. It also ensures proper signal handling by executing the RoadRunner server using \exec\.
docker · high confidence
Initial project scaffolding and development environment setup
This change establishes the foundational structure for the Shlink project, introducing the Docker-based development environment (docker-compose.yml, Dockerfile, indocker helper) and essential configuration files (phpunit, mago static analysis, .gitignore). It also includes the initial CHANGELOG, UPGRADE guide, SECURITY policy, and Code of Conduct, setting the stage for the application's core modules (Core, CLI, Rest) and build processes.
(repo-wide) · high confidence
Initial public entry point and URL rewriting configuration
The application now includes a standard Apache entry point in the public directory. The new .htaccess file configures URL rewriting to serve existing files and directories directly, while routing all other requests to index.php. The index.php script serves as the single entry point, requiring and executing the bootstrap logic from the config/run.php file.
public · high confidence
Interactive CLI tool for managing short URL redirect rules
Users can now interactively add, remove, re-arrange, and save redirect rules for specific short URLs via the command line. The new RedirectRuleHandler provides a guided interface to define rule conditions, including device type, language, browser, IP address, geolocation (country and city), date ranges (before/after), and various query parameter checks (exact value, any value, or valueless).
module/CLI/src/RedirectRule · high confidence
Introduce dynamic redirect rules for short URLs
Users can now define specific conditions that determine which long URL a short link resolves to, replacing the previous static mapping. This change introduces new entity models (RedirectCondition and ShortUrlRedirectRule) that support matching requests based on query parameters (including any-value and valueless variants), visitor language, device type, IP address, geolocation (country and city), browser, and date ranges (before/after). These rules allow for dynamic, context-aware redirects where multiple conditions can be combined and prioritized.
module/Core/src/RedirectRule/Entity · high confidence
Introduce model layer for dynamic redirect rules
The system now supports dynamic redirects based on visitor context. This change introduces the core data models (RedirectConditionData, RedirectConditionType, RedirectRuleData, RedirectRulesData) that define the structure for these rules. The RedirectConditionType enum enumerates the supported conditions, including device type, browser, IP address, geolocation (country code and city name), language, query parameters (including any-value and valueless variants), and date ranges (before/after). Validation logic is embedded in the model to ensure values like country codes and IP addresses are valid, providing a foundation for the new dynamic redirection capabilities.
module/Core/src/RedirectRule/Model · high confidence
Introduced CrawlingHelper to abstract short code crawling logic
A new CrawlingHelper class and its interface have been added to the Core/Crawling module to centralize the retrieval of crawlable short codes. This helper delegates to a CrawlableShortCodesQueryInterface, providing a dedicated layer for crawling-related data access that can be used by other components, such as the dynamically generated robots.txt action.
module/Core/src/Crawling · high confidence
Introduction of API key roles and granular permissions
The system now supports assigning specific roles to API keys, enabling granular access control. The new ApiKey entity stores hashed keys and a collection of roles (via ApiKeyRole), allowing keys to be restricted to specific domains, authored short URLs, or exclude orphan visits. This change introduces the underlying data model for role-based permissions, including methods to check if a key is admin, short-URL restricted, or valid, and to generate specifications for query filtering based on assigned roles.
module/Rest/src/Entity · high confidence
Introduction of Domain entity with configurable redirect settings
A new Domain entity has been added to the core domain layer, representing a specific domain authority. This entity now supports the configuration of not-found redirects, allowing users to define custom redirect behaviors for base URL redirects, regular 404 errors, and invalid short URL errors via the NotFoundRedirectConfigInterface.
module/Core/src/Domain/Entity · high confidence
New API key management repository with transaction safety
The ApiKeyRepository now provides methods to create an initial API key idempotently (only if none exist), check if a key name exists, and delete keys by name. The implementation uses pessimistic write locks to prevent race conditions during creation and existence checks, ensuring data integrity when managing API keys.
module/Rest/src/ApiKey/Repository · high confidence
New CLI commands for managing API keys
The CLI now includes dedicated commands for managing API keys, allowing users to generate new keys with optional names and expiration dates, list existing keys with their status and roles, rename keys, disable keys, and delete keys. These commands replace previous mechanisms and provide a more structured way to handle API key lifecycle operations directly from the command line.
module/CLI/src/Command/Api · high confidence
New CLI commands for managing and exporting visit data
Users can now delete all orphan visits using the new 'visit:orphan-delete' command, download the GeoLite2 geolocation database manually via 'visit:download-db', and list non-orphan visits with 'visit:non-orphan'. The existing 'visit:orphan' command now supports filtering by domain and visit type, while 'visit:locate' has been updated to handle geolocation updates and retry logic more robustly. Additionally, visit listing commands now support CSV output format and pagination to prevent memory issues when handling large datasets.
module/CLI/src/Command/Visit · high confidence
New CLI commands for managing domain-specific not-found redirects and listing domains
Users can now configure custom 'not found' redirects (for base URLs, regular 404s, and invalid short URLs) on a per-domain basis using the new \domain:redirects\ command. Additionally, the \domain:list\ command allows viewing all configured domains, with an optional \-r\ flag to display their specific redirect settings, and the \domain:visits\ command provides a way to retrieve visit statistics for a specific domain.
module/CLI/src/Command/Domain · high confidence
New CLI commands for managing tags and their visits
The CLI now provides dedicated commands for tag management: \tag:list\ displays tags with their short URL and visit counts, \tag:delete\ removes one or more tags, \tag:rename\ changes a tag's name (handling not-found or conflict errors), and \tag:visits\ lists visits associated with a specific tag, supporting domain filtering and pagination. These commands replace previous ad-hoc or less structured interactions with tag data in the command line interface.
module/CLI/src/Command/Tag · high confidence
New CLI utility classes for process execution and formatted table output
This change introduces four new classes in the CLI module's Util namespace to improve how the command-line interface handles background processes and displays data. The new ProcessRunnerInterface and its implementations (ProcessRunner and PhpProcessRunner) provide a standardized way to execute external commands with configurable timeouts (defaulting to 20 minutes) and verbose logging support, while PhpProcessRunner specifically ensures commands are prefixed with the correct PHP binary. Additionally, the new ShlinkTable class wraps Symfony's Console Table helper to offer consistent styling for headers and footers, and includes an optional feature to insert row separators between table entries for better readability in multi-line outputs.
module/CLI/src/Util · high confidence
New REST actions for managing tags
The REST API now exposes dedicated action classes for tag operations: ListTagsAction handles GET /tags with pagination support, TagsStatsAction provides a new GET /tags/stats endpoint returning tag statistics, UpdateTagAction enables PUT /tags to rename tags, and DeleteTagsAction allows DELETE /tags to remove multiple tags. These actions enforce API key authentication and delegate to the TagService.
module/Rest/src/Action/Tag · high confidence
New REST endpoints for listing domains and configuring domain redirects
Added two new REST actions: a GET /domains endpoint that lists all configured domains and includes the system's default 404 redirect configuration, and a PATCH /domains/redirects endpoint that allows users to set or update the 404 redirect rules for a specific domain. The list action centralizes domain retrieval and exposes default redirect settings, while the redirects action uses Valinor for request validation and updates the domain's not-found redirect configuration via the domain service.
module/Rest/src/Action/Domain · high confidence
New REST endpoints to manage short URL redirect rules
Added two new REST actions that allow users to list and set redirect rules for a specific short URL via the \/short-urls/{shortCode}/redirect-rules\ endpoint. The GET action retrieves the current default long URL and associated redirect rules, while the POST/PATCH action accepts a validated payload (mapped via Valinor) to update these rules, returning the updated state.
module/CLI/src/Command/RedirectRule, module/Rest/src/Action/RedirectRule · high confidence
New command to send historical visits to Matomo
A new CLI command, \integration:matomo:send-visits\, has been added to allow users to backfill their Matomo analytics by sending existing visits from Shlink to a configured Matomo instance. The command supports filtering by date range (using \--since\ and \--until\ options) and provides interactive confirmation and progress feedback, helping users migrate their visit history to Matomo after initial configuration.
module/CLI/src/Command/Integration · high confidence
New request model for domain redirect configuration
A new DomainRedirectsRequest class has been introduced to handle the mapping and validation of domain-specific redirect settings. This model accepts optional base URL, regular 404, and invalid short URL redirect targets, allowing users to configure how a specific domain handles these scenarios. It supports falling back to default configuration values when specific redirects are not provided, streamlining the process of setting up domain-level redirect rules via the REST API.
module/Rest/src/Action/Domain/Request · high confidence
New service for managing API key lifecycle
The API key management logic has been consolidated into a new ApiKeyService (and its interface), which now handles creating, checking, listing, renaming, disabling, and deleting API keys. This service introduces support for auto-generated unique names when creating keys, enforces uniqueness constraints on custom names, and allows keys to be managed by their name rather than just their raw value. A new ApiKeyCheckResult class is used to encapsulate the outcome of key validation checks.
module/Rest/src/Service · high confidence
New utility classes for batch processing, IP matching, and redirect handling
This change introduces several new utility classes in the Core module. DoctrineBatchHelper provides a mechanism to wrap iterables for database operations, flushing and clearing the entity manager in batches to manage memory usage during large imports. IpAddressUtils adds logic to match IP addresses against groups of static IPs, CIDR blocks, and wildcard patterns, supporting the creation of IP-based redirect conditions. RedirectResponseHelper and RedirectStatus are introduced to handle redirect responses, allowing configuration of the HTTP status code (including 307 and 308), cache visibility, and allowed HTTP methods. NoValue is a new enum used to distinguish between an explicitly provided null value and an absent argument.
module/Core/src/Util · high confidence
New utility classes for command locking and confirmation workflows
Added CommandUtils and LockConfig classes to the CLI module to standardize how commands handle user confirmations and distributed locking. CommandUtils provides static methods to display warnings before executing callbacks and to manage lock acquisition with automatic release, ensuring commands do not run concurrently. LockConfig offers a structured way to define lock parameters such as name, blocking behavior, and time-to-live, decoupling these concerns from individual command implementations.
module/CLI/src/Command/Util · high confidence
REST module initialization with unified versioned and unversioned routing
The new Rest module introduces a ConfigProvider that centralizes route configuration, automatically prefixing all API endpoints with a versioned path (/rest/v{version:1\|2\|3}) while ensuring the health check endpoint remains accessible via an unversioned path (/rest/health). This change establishes the foundational routing structure for the REST API, supporting multi-segment slugs and consolidating how routes are loaded and prefixed.
module/Rest/src · high confidence
Short URLs now support conditional redirect rules
Users can now define specific redirect rules for a short URL that override the default destination based on request conditions. The new ShortUrlRedirectRuleService allows setting and managing these rules, while the ShortUrlRedirectionResolver checks them in priority order during visit resolution, returning the matching rule's long URL if conditions are met, or falling back to the original short URL destination.
module/Core/src/RedirectRule · high confidence
Support for importing short URLs, visits, and redirect rules from other Shlink instances
Users can now import short URLs, their associated visits, and redirect rules from other Shlink instances. The new ImportedLinksProcessor handles the import process, allowing users to optionally import short codes (generating new ones or skipping on conflict) and import visits for existing short URLs. It also supports importing orphan visits and redirect rules, with error handling to prevent a single failing URL from stopping the entire import process.
module/Core/src/Importer · high confidence
Support for multi-segment slugs and extra path handling
Two new middleware components have been added to handle complex URL structures. ExtraPathRedirectMiddleware resolves short URLs that may include extra path segments, supporting both appending extra paths to the redirect and ignoring them, while also enabling multi-segment slug resolution by iteratively checking path parts. TrimTrailingSlashMiddleware ensures that trailing slashes are correctly handled in the short code attribute when multi-segment slugs and trailing slash features are enabled together, preventing matching failures.
module/Core/src/ShortUrl/Middleware · high confidence
Architecture
Core module configuration migrated to Laminas and split into dedicated config files
The Core module's dependency injection and event configuration has been restructured. The application framework has been migrated from Zend to Laminas, utilizing Laminas\\ServiceManager\\ConfigAbstractFactory for service factories. The previous monolithic configuration has been split into three distinct files: dependencies.config.php (registering services like ShortUrl, Visit, and Geolocation components), entity-manager.config.php (defining entity mappings), and event\_dispatcher.config.php (configuring event listeners for Mercure, RabbitMQ, Redis, and Matomo). This change centralizes the wiring of core services and event handlers within the Core module.
module/Core/config · high confidence
Behavioural changes
2 commits (0 fixes) modifying module, module/Core
A change to existing behaviour in module, module/Core — 2 commits, 3 files: “Rename IpGeolocationMiddleware to GeolocationMiddleware”; “Decouple GeolocationMiddleware from GeoLite2”.
module/Core/src/Geolocation/Middleware, module/Core/test/Geolocation/Middleware · medium confidence · unverified
API key role resolution logic and validation
The CLI module now uses a dedicated RoleResolver to determine API key permissions based on input flags. This resolver enforces a validation rule that prevents generating keys with domain-only roles if the specified domain matches the system's default domain, throwing an InvalidRoleConfigException in that case. It also handles the creation of roles for authored short URLs, specific domains, and the exclusion of orphan visits.
module/CLI/src/ApiKey · high confidence
API key roles are deprecated
The Role enum in the API key module has been marked as deprecated, signaling that the existing API key role system (including authored short URLs, domain-specific access, and orphan visit filtering) is no longer supported. This change reflects the removal of deprecated features and the migration of role-related logic, indicating that users should avoid relying on these specific role-based restrictions in new integrations.
module/Rest/src/ApiKey · high confidence
Add paginated output format for visits commands to prevent memory exhaustion
Visits listing commands now support a new 'paginated' output format that processes visits in 1000-visit chunks instead of loading the entire dataset into memory at once. This change introduces the VisitsListFormat enum and VisitsListInput class to manage date range filtering and format selection, allowing users to specify the 'paginated' format to avoid out-of-memory errors when dealing with large volumes of visit data.
module/CLI/src/Input · high confidence
Adopt Valinor for object mapping and validation
The system now uses the Valinor library to validate and map input data, replacing previous mechanisms. This introduces a new MapValidationMiddleware that converts Valinor mapping errors into standard ValidationExceptions, ensuring consistent error handling. A MapperBuilderWithCacheDelegatorFactory is added to optimize performance by caching mapping definitions in production environments. Additionally, an OrderingConverter is implemented to validate and map ordering parameters (field and direction) for list endpoints, ensuring that only allowed fields and valid sort directions (ASC/DESC) are accepted.
module/Core/src/ObjectMapper · high confidence
Application bootstrapping and configuration loading restructured
The application's initialization flow has been reorganized to use a centralized config aggregator (config/config.php) that explicitly loads module providers (Core, CLI, Rest, etc.) and applies post-processors for base paths, multi-segment slugs, and redirect methods. A new container.php entry point now handles environment variable promotion via the EnvVars enum, sets global PHP settings (memory limit, timezone, error reporting), and registers the service container. Dedicated config files (cli-app.php, cli-config.php, run.php) now clearly separate CLI application setup, Doctrine migrations configuration, and standard HTTP application execution, replacing the previous monolithic or scattered bootstrap logic.
config · high confidence
Async listeners now support granular real-time update topic configuration
The async notification system for short URLs and visits has been refactored to introduce an abstract base class structure, allowing individual real-time update topics (such as new short URLs, new visits, or orphan visits) to be enabled or disabled independently via configuration. This change ensures that notifications to remote systems like Mercure, RabbitMQ, or Redis pub/sub are only sent for the specific event types that the user has explicitly opted into, reducing unnecessary network traffic and allowing for more precise control over real-time data streams.
module/Core/src/EventDispatcher/Async · high confidence
Automated MSSQL ODBC driver installation in CI
The CI pipeline now includes a dedicated script to install the Microsoft ODBC driver 18 for SQL Server on Ubuntu 24.04. This change ensures the required database connectivity libraries are present for MSSQL tests, replacing manual or ad-hoc setup steps with a reproducible installation process.
data/infra/ci · high confidence
CLI application initialization is now handled by a dedicated factory
The creation of the Symfony Console Application has been moved into a new ApplicationFactory. This factory retrieves CLI configuration and application options from the container to instantiate the console application and register commands via a ContainerCommandLoader, centralizing the bootstrap logic for the CLI module.
module/CLI/src/Factory · high confidence
CLI module configuration and dependency wiring
The CLI module now registers its command set and service dependencies via explicit configuration files (cli.config.php and dependencies.config.php) using Laminas ConfigAbstractFactory. This establishes the available commands for managing short URLs, visits, API keys, tags, domains, database migrations, redirect rules, and Matomo integration, while wiring the required core services (such as ShortUrlService, ApiKeyService, and GeolocationDbUpdater) to these commands.
module/CLI/config · high confidence
CLI module introduces centralized configuration loading
The CLI module now includes a ConfigProvider that abstracts configuration loading by invoking loadConfigFromGlob to merge configuration files matching the pattern {,\*.}config.php. This change establishes a standardized mechanism for the CLI module to load its configuration from multiple sources, replacing any previous ad-hoc configuration handling within this module.
module/CLI/src · high confidence
CLI short URL commands migrated to Symfony attributes and invokable pattern
The short URL management commands (create, edit, list, delete, resolve, and visits) have been rewritten to use Symfony Console attributes (e.g., \#\[AsCommand\], \#\[Option\], \#\[MapInput\]) and the invokable command pattern. This change introduces structured input validation via Valinor mappers, replaces the previous Zend/Laminas paginator with Pagerfanta, and standardizes command behavior across the CLI module. Users will experience consistent command signatures, improved input handling, and updated output formatting for short URL operations.
module/CLI/src/Command/ShortUrl · high confidence
Centralized async listener control and request ID propagation
The event dispatcher now uses a new EnabledListenerChecker to explicitly gate async job dispatching based on specific feature flags (RabbitMQ, Redis Pub/Sub, Mercure, Matomo, and GeoLite), ensuring that async tasks are only created when their corresponding integrations are enabled. Additionally, a new RequestIdProvider forwards the request ID from the sync process to async job processes, improving traceability across distributed operations.
module/Core/src/EventDispatcher/Helper · high confidence
Config post-processors reorganized and enhanced for routing flexibility
The configuration post-processing logic has been restructured into dedicated classes within the Core module. A new BasePathPrefixer automatically prepends the configured base path to route and middleware paths, ensuring correct URL generation when deployed behind proxies or in subdirectories. The ShortUrlMethodsProcessor now dynamically sets allowed HTTP methods on the redirect route based on the configured redirect status code, restricting legacy 301/302 redirects to GET only while allowing 307/308 redirects to use any method. Additionally, a MultiSegmentSlugProcessor enables support for multi-segment slugs when the corresponding environment variable is enabled, modifying route patterns to accept multiple path segments.
module/Core/src/Config/PostProcessor · high confidence
Configurable per-domain not-found redirects with placeholder support
The configuration layer now supports defining distinct redirect targets for not-found scenarios (invalid short URLs, regular 404s, and base URL misses) on a per-domain basis. The new \NotFoundRedirectResolver\ processes these redirects and replaces \{DOMAIN}\ and \{ORIGINAL\_PATH}\ placeholders in the target URLs with the corresponding values from the request, ensuring that dynamic paths and domains are correctly preserved in the final redirect location.
module/Core/src/Config · high confidence
Core configuration options migrated to environment variables
The application's configuration system has been refactored to load settings directly from environment variables via new Options classes in the Core module. This change introduces dedicated configuration objects for CORS (including credentials and origin handling), real-time update topics, redirect behavior (status codes, cache visibility, and extra path modes), URL shortening (schema, slug length, trailing slashes), tracking preferences (anonymization, IP/referrer/UA disabling), robots.txt rules, and RabbitMQ integration. Users can now control these behaviors entirely through environment variables, replacing previous configuration mechanisms.
module/Core/src/Config/Options · high confidence
Core exceptions now return RFC 7807 Problem Details
Exceptions in the Core module (such as ValidationException, ShortUrlNotFoundException, and DomainNotFoundException) now implement ProblemDetailsExceptionInterface and return structured JSON responses (RFC 7807) instead of plain text. This change standardizes error responses with consistent titles, error codes, and HTTP status codes, improving machine-readability for API consumers.
module/Core/src/Exception · high confidence
Database schema refactoring for domains, geolocation, and redirect rules
The entity mappings in the Core module have been restructured to support new database tables and improved data modeling. A new \domains\ table has been added to manage custom domain configurations, including specific redirect URLs for regular 404s and invalid short URLs. Geolocation tracking is now persisted via a \geolocation\_db\_updates\ table that records the status, reason, and errors of database downloads. Redirect logic has been expanded with new \short\_url\_redirect\_rules\ and \redirect\_conditions\ tables, allowing short URLs to have multiple conditional redirects with specific match keys and values. Additionally, visit tracking has been enhanced with a \redirect\_url\ field on the \visits\ table to record the final destination of a visitor, and visit counts are now stored in dedicated \short\_url\_visits\_counts\ and \orphan\_visits\_counts\ tables for more efficient aggregation.
module/Core/config/entities-mappings · high confidence
Database schema updates for dynamic redirections, visit counting, and security hardening
This release introduces several database migrations to support new features and improve data integrity. A new rule-based redirection system is added via the short\_url\_redirect\_rules, redirect\_conditions, and their join table, replacing the legacy device\_long\_urls table which is migrated and dropped. Visit counting is optimized by introducing short\_url\_visits\_counts and orphan\_visits\_counts tables to store aggregated counts instead of raw row counts. Security is enhanced by hashing all API keys in the database using SHA256 and adding a redirect\_url column to the visits table to track final redirect destinations. Additionally, long URL columns are converted to TEXT type to support longer URLs, a long\_url\_hash column is added to short\_urls for efficient lookups, and a geolocation\_db\_updates table is created to track geolocation database download statuses. Several fixes address index ordering and transactional behavior issues specific to Microsoft SQL Server.
module/Core/migrations · high confidence
Database-level pagination for tags list
The tags listing now uses database-level pagination instead of loading all tags into memory. This change introduces new paginator adapters that fetch tags directly from the database with support for search filtering, ordering by name, and API key restrictions, improving performance and scalability for large tag collections.
module/Core/src/Tag/Paginator · high confidence
Domain list now includes configured not-found redirects
The domain listing response now includes specific not-found redirect configurations for each domain. A new \DomainItem\ model serializes domain data to include a \redirects\ field, allowing users to see the custom 404 handling rules configured per domain rather than just the domain authority and default status.
module/Core/src/Domain/Model · high confidence
Domain repository now filters results by API key permissions
The new DomainRepository implementation ensures that domain lists and lookups respect API key roles. When an API key is provided, the repository applies specifications to filter results: for DOMAIN\_SPECIFIC roles, it restricts domains to those explicitly allowed by the key; for AUTHORED\_SHORT\_URLS roles, it restricts domains to those associated with short URLs created by that key. This prevents unauthorized domains from appearing in lists or being resolved via API key authentication.
module/Core/src/Domain/Repository · high confidence
Domain service now supports per-domain not-found redirects and API key scoping
The new DomainService introduces the ability to configure specific not-found redirects for individual domains via the \configureNotFoundRedirects\ method, moving beyond the previous global default. Additionally, the \listDomains\ method now respects API key permissions, filtering results based on \DOMAIN\_SPECIFIC\ roles to ensure users only see domains they are authorized to manage.
module/Core/src/Domain · high confidence
Enhanced tag listing with visit statistics and flexible ordering
The tags list endpoint now returns detailed visit statistics (total visits, non-bot visits) alongside the tag name and short URL count. This change introduces new data models (TagInfo, OrderableField) and parameter handling (TagsParams, TagsListFiltering) to support ordering by various fields and to expose the new visit summary data in the API response.
module/Core/src/Tag/Model · high confidence
Enhanced visit tracking with type filtering, bot stats, and redirect URL capture
The visit tracking system now captures the redirect URL for every tracked visit, allowing users to see where visitors were sent. Visit statistics have been expanded to distinguish between total visits and non-bot visits for both regular and orphan visits. Additionally, orphan visits can now be filtered by their specific type (invalid short URL, base URL, or regular 404) via the API and CLI, providing more granular control over visit data analysis.
module/Core/src/Visit/Model · high confidence
Error pages now use custom inline styles instead of Bootstrap
The 404 and invalid short-code error templates have been replaced with new standalone HTML files that no longer depend on the Bootstrap framework. These pages now feature a lightweight, self-contained design using system fonts and inline CSS, removing the external dependency on league/plates and Bootstrap while maintaining a clean, centered layout for error messages.
module/Core/templates · high confidence
Extracted Matomo visit tracking into a dedicated service
The logic for sending visit data to Matomo has been extracted into a new \SendVisitToMatomo\ service. This service acts as an event listener that intercepts \UrlVisited\ events, checks if Matomo integration is enabled, and delegates the actual transmission to a \MatomoVisitSender\ while ensuring errors are logged without disrupting the main application flow.
module/Core/src/EventDispatcher/Matomo · high confidence
Extracted utility functions to global helpers and replaced short-code generator
The application now uses extracted global helper functions for common array operations (contains, some, every, map) and utility tasks like date parsing, locale normalization, and crawler detection, replacing previous inline or library-specific implementations. Additionally, the short code generation logic has been updated to use NanoID instead of the previous short-id library, supporting both strict (alphanumeric) and standard (lowercase alphanumeric) modes.
module/Core/functions · high confidence
Geolocation database updates are now tracked with retry logic and progress reporting
The geolocation database updater has been moved to the Core module and now tracks download attempts, allowing it to skip updates if a download is already in progress or if too many consecutive errors have occurred recently. It also reports progress during downloads and distinguishes between new database creation and updates to existing files.
module/Core/src/Geolocation · high confidence
Improved event dispatching reliability and real-time update capabilities
This change introduces a new listener that automatically closes and reopens database connections after asynchronous tasks, preventing connection leaks and ensuring the entity manager is in a clean state for subsequent operations. It also adds a new event listener that triggers geolocation for previously unlocated visits whenever the GeoLite2 database is updated or created, ensuring location data remains current. Additionally, the system now supports granular control over real-time update topics, allowing individual topics (such as new visits or short URL updates) to be enabled or disabled independently, and refactors the update generation logic into a dedicated service for better maintainability.
module/Core/src/EventDispatcher · high confidence
Introduction of NotFoundType model for categorizing 404 errors
A new NotFoundType class has been added to the error handler model layer to explicitly categorize not-found visits. This class analyzes the incoming HTTP request to determine if the 404 error corresponds to a base URL access, a regular 404, or an invalid short URL, providing a structured way to distinguish between these different types of missing resources.
module/Core/src/ErrorHandler/Model · high confidence
Introduction of new domain-specific event classes for the event dispatcher
The event dispatcher module now includes dedicated event classes—ShortUrlCreated, UrlVisited, and GeoLiteDbCreated—to represent specific system occurrences. These classes implement JsonSerializable and JsonUnserializable interfaces, enabling them to be serialized for asynchronous processing or transport. This change provides a structured way to dispatch and handle events related to short URL creation, URL visits, and GeoLite database updates, supporting the broader architecture for async event listeners and improved visit tracking.
module/Core/src/EventDispatcher/Event · high confidence
Migrated API key entity mappings to external configuration files
The entity mapping definitions for the ApiKey and ApiKeyRole classes have been moved from inline annotations to external PHP configuration files located in the entities-mappings directory. These new files define the database schema for the api\_keys and api\_key\_roles tables, including the one-to-many relationship between API keys and their associated roles, ensuring the metadata is now managed via a centralized configuration approach.
module/Rest/config/entities-mappings · high confidence
Mitigate excessive error logging for unconfigured Mercure
A new middleware, NotConfiguredMercureErrorHandler, has been added to the REST module to handle Mercure-related exceptions more gracefully. Previously, errors from clients not using Mercure triggered large error traces in the logs; this change intercepts those specific exceptions, logs a simple warning message instead, and returns a standard Problem Details response, reducing log noise for users who have not configured Mercure.
module/Rest/src/Middleware/Mercure · high confidence
Modernized visit tracking with new entities and enhanced data capture
The visit tracking system has been refactored to introduce dedicated entities for counting visits: \OrphanVisitsCount\ for unlinked visits and \ShortUrlVisitsCount\ for visits to specific short URLs, enabling more granular analytics. The core \Visit\ entity now captures the \redirectUrl\ where a visitor was sent and exposes the \visitedUrl\ in JSON serialization for all visit types, not just orphans. Additionally, the \VisitLocation\ entity has been modernized to standardize geolocation data storage, and the \Visit\ entity's date field is now immutable.
module/Core/src/Visit/Entity · high confidence
New CLI and persistent-worker entry points for Symfony Console, Doctrine, RoadRunner, and FrankenPHP
The application now uses dedicated scripts in the bin directory to bootstrap its runtime environments. The bin/cli script initializes the Symfony Console application for command-line interactions, while bin/doctrine provides a custom entry point for Doctrine ORM console tools. Additionally, bin/roadrunner-worker.php and bin/frankenphp-worker.php replace previous execution models with persistent workers that handle HTTP requests and, in RoadRunner's case, dispatch async event listeners as background jobs, including garbage collection and request ID forwarding.
bin · high confidence
New adapter for paginated short URL listing
A new ShortUrlRepositoryAdapter has been introduced to handle pagination for short URL lists. This adapter integrates with the ShortUrlListRepositoryInterface to fetch paginated results and total counts, utilizing ShortUrlsParams, API key context, and the default domain to apply filtering logic consistent with the updated repository structure.
module/Core/src/ShortUrl/Paginator · high confidence
New configuration structure for core application components
The application now uses a new set of global configuration files in config/autoload to manage core settings. This includes dedicated configs for the database connection (entity-manager.global.php) with support for encryption and specific driver options, caching and Redis integration (cache.global.php), and a centralized error handling setup using Problem Details (error-handler.global.php). Additionally, the middleware pipeline (middleware-pipeline.global.php) and routing (routes.config.php) are now explicitly defined, supporting features like IP geolocation, trailing slash handling, and multi-segment slugs. The installer configuration (installer.global.php) has also been updated to reflect the available setup options.
config/autoload · high confidence
New development environment configuration via PHP array
The application now supports loading development environment variables from a PHP array file (shlink\_dev\_env.php.dist) instead of relying solely on .env files. This new configuration file provides pre-configured defaults for local development, including settings for MySQL, MariaDB, PostgreSQL, and MSSQL databases, as well as integrations for Matomo, Mercure 1.0, RabbitMQ, and Redis. This change simplifies local setup by offering a structured, code-based configuration template that developers can copy and customize.
config/params · high confidence
New development infrastructure with FrankenPHP, RoadRunner, and PHP 8.5 support
The development environment has been restructured to include new Dockerfiles for FrankenPHP, PHP-FPM, and RoadRunner, all based on PHP 8.5 Alpine images. This change introduces RoadRunner as the application server for development, replacing previous setups, and adds a dedicated Nginx reverse proxy configuration for the Mercure hub. The infrastructure now standardizes on specific versions for native dependencies, including PDO SQLSRV 5.13 and MS ODBC 18, while ensuring consistent extension installation (such as xdebug, APCu, and zip) across all development containers.
data/infra · high confidence
New health check and Mercure info endpoints with improved reliability
The REST module now exposes two new endpoints: a /health endpoint that verifies database connectivity and returns a JSON status (pass/fail) along with the application version, and a /mercure-info endpoint that provides the Mercure hub URL and a valid JWT subscription token. The health check implementation has been hardened to handle database connection exceptions gracefully, preventing random 503 responses when the underlying connection is expired. Additionally, the Mercure info action now correctly formats the hub URL by appending the /.well-known/mercure path segment.
module/Rest/src/Action · high confidence
New model classes for pagination, device/browser detection, ordering, and renaming
The Core/Model layer introduces several new value objects to support updated functionality: AbstractInfinitePaginableListParams standardizes pagination parameters; Browser and DeviceType enums parse user agents (via phpuseragentparser) to identify browsers and devices for dynamic redirects; Ordering provides a structured way to handle list sorting fields and directions; Renaming encapsulates API key rename operations with validation; and BulkDeleteResult models the outcome of bulk deletion actions.
module/Core/src/Model · high confidence
New short URL request processing middleware components
The REST API now includes four new middleware classes in the ShortUrl namespace to handle request preparation and response formatting for short URL creation. CreateShortUrlContentNegotiationMiddleware allows clients to request plain text responses containing only the short URL via a format query parameter or Accept header. DropDefaultDomainFromRequestMiddleware automatically removes the default domain from request payloads to simplify downstream processing. OverrideDomainMiddleware enforces domain restrictions for API keys with domain-specific roles by injecting the authorized domain into the request. ShortUrlOptionsPayloadMiddleware populates the request body with default short URL configuration options (such as short code length and slug settings) from the application configuration before the request reaches the handler.
module/Rest/src/Middleware/ShortUrl · high confidence
Optimized tag listing with visit statistics and native query performance
The tag list view now displays detailed visit statistics, including total visits, non-bot visits, and the count of associated short URLs, by leveraging the new short\_url\_visits\_counts table. To ensure this data loads efficiently, the underlying repository has been rewritten to use native SQL sub-queries instead of the ORM, which prevents the entire dataset from being loaded into memory during pagination. This change also improves ordering reliability across different database engines, such as PostgreSQL, and respects API key restrictions to filter tags based on domain or authorship permissions.
module/Core/src/Tag/Repository · high confidence
Prevents API key creation with domain-only roles on the default domain
The CLI now validates API key configurations and throws an error if a user attempts to create an API key using a domain-specific role (DOMAIN\_SPECIFIC) on the default domain. This change ensures that domain-only roles are restricted to non-default domains, preventing invalid configurations that would otherwise be accepted.
module/CLI/src/Exception · high confidence
Prevents duplicate tag and domain creation during short URL creation
The short URL creation process now uses a new PersistenceShortUrlRelationResolver to handle tags and domains, ensuring that duplicate entries are not created when multiple short URLs are persisted simultaneously. This resolver implements locking mechanisms to prevent race conditions during the creation of new tags and domains, and it memoizes new entities to avoid redundant database operations. A simpler resolver is also provided for cases where persistence logic is not required.
module/Core/src/ShortUrl/Resolver · high confidence
REST API middleware migrated to PSR-15 with Laminas and enhanced CORS handling
The REST module's middleware stack has been rewritten to implement the PSR-15 standard, replacing previous implementations with new classes for authentication, body parsing, and cross-origin resource sharing (CORS). Authentication is now handled by a dedicated middleware that validates API keys via headers or query parameters, while body parsing has been updated to robustly decode JSON payloads and throw specific exceptions for malformed data. CORS behavior has been refined to dynamically resolve allowed HTTP methods from route definitions and ensure OPTIONS requests return empty 204 responses. Additionally, the infrastructure has been migrated from Zend to Laminas, and an implicit options middleware factory has been added to standardize preflight response handling.
module/Rest/src/Middleware · high confidence
REST API visit endpoints restructured with new actions and pagination
The REST API for visits has been reorganized into specific action classes (ShortUrlVisitsAction, TagVisitsAction, DomainVisitsAction, OrphanVisitsAction, NonOrphanVisitsAction, GlobalVisitsAction) that share a common AbstractListVisitsAction base. This change introduces Pagerfanta-based pagination for listing visits across all scopes (short URLs, tags, domains, orphan/non-orphan) and adds a new DELETE endpoint (/visits/orphan) to remove orphan visits. The GlobalVisitsAction now returns aggregated stats rather than a paginated list, and all list endpoints now support domain filtering where applicable.
module/Rest/src/Action/Visit · high confidence
REST exceptions now return RFC 7807 Problem Details responses
The REST module's exception classes (including VerifyAuthenticationException, MissingAuthenticationException, MercureException, ApiKeyConflictException, and ApiKeyNotFoundException) have been refactored to implement ProblemDetailsExceptionInterface. This change ensures that API errors now return structured RFC 7807 Problem Details responses with standardized titles, error codes, and HTTP status codes, replacing the previous generic error format.
module/Rest/src/Exception · high confidence
REST module configuration migrated to Laminas ConfigAbstractFactory
The REST module's configuration files have been rewritten to use Laminas's ConfigAbstractFactory for dependency injection, replacing previous factory patterns. This change centralizes the wiring of REST actions (such as Health, ShortUrl, Visit, Tag, and Domain handlers) and middleware (including Authentication, BodyParser, and CORS) into explicit configuration arrays. It also introduces specific configuration for access logs (ignoring health check paths), authentication rules (defining routes that bypass API key checks or allow query-string keys), and entity mapping paths, ensuring the module is fully compatible with the Laminas service manager.
module/Rest/config · high confidence
RabbitMQ listeners now respect individual real-time updates configuration
The \NotifyNewShortUrlToRabbitMq\ and \NotifyVisitToRabbitMq\ listeners have been refactored to explicitly check the \RabbitMqOptions::enabled\ flag via the new \isEnabled()\ method. This change ensures that RabbitMQ publishing for short URL creation and visit tracking events is individually controllable through the real-time updates configuration, rather than being implicitly enabled or disabled by broader system settings.
module/Core/src/EventDispatcher/RabbitMq · high confidence
Redis ACL configuration for credentials
Added a Redis ACL configuration file (redis-acl.conf) that defines a user 'foo' with access to all commands and keys, enabled with the password 'bar', and sets a requirepass directive.
data/infra/redis · high confidence
Refactor CLI short URL input handling with new input classes
The CLI short URL commands now use dedicated input classes (ShortUrlCreationInput, ShortUrlDataInput, ShortUrlsParamsInput) to handle argument parsing and mapping. This change introduces Symfony Console attributes for defining options and arguments, replacing previous manual parsing logic. Users will see no functional change in command behavior, but the underlying structure for processing short URL creation, editing, and listing parameters has been standardized.
module/CLI/src/Command/ShortUrl/Input · high confidence
Refactored 404 handling into domain-specific redirect and tracking middlewares
The 404 error handling logic has been split into distinct middlewares to support per-domain redirect configurations and improved visit tracking. The new NotFoundRedirectHandler now attempts to resolve redirects specific to the current domain before falling back to default settings, while the NotFoundTrackerMiddleware ensures that all not-found visits (including those resulting in redirects) are properly recorded in the analytics.
module/Core/src/ErrorHandler · high confidence
Refactored REST short URL actions to use Valinor DTOs and Laminas
The REST actions for managing short URLs (create, edit, list, resolve, delete, and single-step create) have been refactored to use Valinor for validating and mapping request payloads into domain DTOs (ShortUrlCreation, ShortUrlEdition, ShortUrlsParams) instead of manual parsing. The actions now rely on Laminas Diactoros for HTTP responses and explicitly pass the API key from the authentication middleware to the underlying services. Additionally, the edit action now uses the PATCH method, and the single-step creation endpoint supports an optional domain override.
module/Rest/src/Action/ShortUrl · high confidence
Refactored database initialization and migration commands
The database setup workflow has been restructured to improve reliability and separation of concerns. The \db:create\ command now explicitly checks for existing tables before attempting creation, and automatically creates the underlying database if it is missing, preventing errors when the database does not yet exist. The \db:migrate\ command remains available for updating the schema. Both commands are now hidden internal utilities that utilize a locking mechanism to prevent concurrent execution, and they rely on a dedicated connection without a database name for initial setup tasks.
module/CLI/src/Command/Db · high confidence
Refactored short URL filtering logic into dedicated persistence DTOs
The short URL list and count filtering logic has been refactored to use new dedicated classes, ShortUrlsListFiltering and ShortUrlsCountFiltering, which wrap query parameters into Data Transfer Objects. This change introduces support for filtering short URLs by API key name (restricted to admin keys or matching keys) and enables searching by the default domain. It also standardizes how filtering parameters such as tags, date ranges, and exclusion modes are passed to the persistence layer, improving code structure and maintainability.
module/Core/src/ShortUrl/Persistence · high confidence
Refactored short URL helpers into dedicated services
The short URL helper logic has been extracted into new, dedicated classes in the ShortUrl\\Helper namespace. ShortUrlRedirectionBuilder now handles redirect construction using a ServerRequest object and respects the forwardQuery setting to preserve query parameters. ShortUrlStringifier manages URL stringification, ensuring the base path and custom domains are honored while preventing URL-encoding of the short code. ShortUrlTitleResolutionHelper automates title fetching with streaming, charset detection, and UTF-8 conversion. ShortCodeUniquenessHelper centralizes short code collision resolution, and TitleResolutionModelInterface standardizes title data handling.
module/Core/src/ShortUrl/Helper · high confidence
Refactored short URL management into dedicated service classes
The short URL handling logic in the Core module has been reorganized into distinct, dedicated service classes to improve separation of concerns. A new \DeleteShortUrlService\ now manages the deletion of individual short URLs (including threshold checks) and the bulk deletion of expired short URLs. Short URL creation and existence checks are handled by \UrlShortener\, while \ShortUrlService\ is responsible for updating existing short URLs. Additionally, \ShortUrlResolver\ centralizes the logic for resolving short URLs by identifier, and \ShortUrlVisitsDeleter\ provides a specific capability to delete visits associated with a short URL. This refactoring isolates these specific behaviors from the previous monolithic implementation.
module/Core/src/ShortUrl · high confidence
Refactored short URL models to use readonly classes and new validation enums
The short URL models in the Core module have been refactored to use PHP readonly classes (ShortUrlCreation, ShortUrlEdition, ShortUrlIdentifier, ShortUrlWithDeps, ShortUrlsParams, UrlShorteningResult, ExpiredShortUrlsConditions) and new enums (ShortUrlMode, OrderableField, TagsMode). This change introduces a strict/loose mode for short URLs, allows ordering the short URL list by non-bot visits, and adds filtering capabilities by domain authority and API key name. The models now handle validation and mapping internally using converters, replacing previous external validation logic.
module/Core/src/ShortUrl/Model · high confidence
Refactored short URL repository logic and added expired URL deletion support
The short URL repository layer has been restructured to improve performance and maintainability. A new \ShortUrlListRepository\ now handles listing and filtering short URLs, utilizing sub-queries to load visit counts and avoiding N+1 database problems by joining domains. A new \ExpiredShortUrlsRepository\ has been introduced to support the deletion of expired short URLs based on conditions like past validity dates or reached visit limits. Additionally, the \ShortUrlRepository\ now includes logic to search by long URL hash when checking for existing short URLs, and the \CrawlableShortCodesQuery\ extracts crawlable short codes into a dedicated, memory-efficient iterator.
module/Core/src/ShortUrl/Repository · high confidence
Refactored tracking actions and introduced dynamic robots.txt generation
The core tracking logic has been restructured by introducing an AbstractTrackingAction that centralizes short URL resolution and request tracking, with specific implementations for RedirectAction (handling HTTP redirects) and PixelAction (returning a tracking pixel). Additionally, a new RobotsAction has been added to dynamically generate the robots.txt file, allowing users to configure whether all short URLs are crawlable and to customize user agents via the RobotsOptions.
module/Core/src/Action · high confidence
Refactored visit data access into specialized repositories
The monolithic VisitRepository has been split into several focused repositories to improve performance and maintainability. A new VisitIterationRepository provides memory-efficient, block-based iteration for large visit datasets, supporting date-range filtering. Dedicated count repositories (OrphanVisitsCountRepository and ShortUrlVisitsCountRepository) now handle aggregated visit counts, while a new VisitDeleterRepository manages the deletion of visits for specific short URLs or all orphan visits. The main VisitRepository now exposes refined filtering capabilities, including domain-based filtering for tags and orphan visits, and type-based filtering for orphan visits.
module/Core/src/Visit/Repository · high confidence
Refactored visit geolocation logic into dedicated service classes
The geolocation logic for visits has been reorganized into the new Visit\\Geolocation namespace, introducing specific classes to handle different aspects of the process. VisitLocator now manages the iteration and persistence of visit locations, while VisitToLocationHelper is responsible for resolving IP addresses to geographic locations, including explicit handling for localhost and empty addresses. This separation isolates the geolocation concerns from the broader visit management code.
module/Core/src/Visit/Geolocation · high confidence
Refactored visit tracking and listing into a modular Visit namespace
Visit tracking and listing logic has been reorganized into the new Shlinkio\\Shlink\\Core\\Visit namespace to improve code structure and maintainability. This change introduces dedicated services for tracking requests (RequestTracker) and managing visit deletion (VisitsDeleter), alongside a centralized helper (VisitsStatsHelper) that coordinates pagination adapters for short URLs, tags, domains, and orphan visits. The refactoring also standardizes filtering and persistence models (e.g., VisitsCountFiltering, OrphanVisitsListFiltering) and ensures that visit persistence is wrapped in database transactions for atomicity.
module/Core/src/Visit · high confidence
Replaced Laminas Paginator with Pagerfanta
The pagination system has been migrated from Laminas Paginator to Pagerfanta. This change introduces a new abstract adapter class, AbstractCacheableCountPaginatorAdapter, which implements the Pagerfanta AdapterInterface and includes internal caching for result counts to optimize performance during pagination operations.
module/Core/src/Paginator · high confidence
Repository interface exposes count method
The EntityRepositoryInterface now includes a count method, allowing callers to retrieve the number of entities matching specific criteria without needing to fetch the full result set. This change standardizes the repository contract to align with Doctrine's ObjectRepository capabilities, ensuring consistent counting behavior across implementations.
module/Core/src/Repository · high confidence
ShortUrl entity refactored with calculated hash, mode support, and import tracking
The ShortUrl entity has been significantly modernized: it now includes a calculated and indexed \longUrlHash\ for efficient lookups, supports distinct short URL modes (including path prefix handling for custom slugs), and tracks import source and original short code for migrated URLs. The entity also exposes redirect rules and utilizes a pre-calculated visits count collection to optimize listing performance, while removing legacy device-specific long URL support and enforcing stricter validation during creation and edition.
module/Core/src/ShortUrl/Entity · high confidence
Standardized short URL data transformation via new transformer service
The system now uses a dedicated ShortUrlDataTransformer to convert ShortUrl entities and ShortUrlWithDeps models into a consistent array format for API responses. This change ensures that the short URL string is explicitly included in the output alongside the entity's data properties, providing a uniform structure for consumers of the short URL data.
module/Core/src/ShortUrl/Transformer · high confidence
Tag management now supports renaming, pagination, and API key restrictions
The tag module has been refactored to introduce a dedicated TagService and Tag entity, enabling new capabilities and stricter security. Users can now rename tags via a dedicated endpoint, with the system preventing conflicts if the new name already exists. Tag listing endpoints now support pagination for better performance with large datasets. Additionally, API keys restricted to short-url operations are now explicitly blocked from deleting or renaming tags, enforcing role-based access control for these destructive actions.
module/Core/src/Tag · high confidence
Track geolocation database update status and reasons
The system now records the reason for each geolocation database download attempt and tracks its outcome (in-progress, success, or error) via new entity classes. This allows users to understand why a download was triggered and whether it completed successfully or failed, improving visibility into geolocation data maintenance.
module/Core/src/Geolocation/Entity · high confidence
Test coverage
Added API tests for REST middleware behavior; Added API tests for device-specific redirects and robots.txt behavior; Added CLI end-to-end tests for short URL and API key commands; Added database tests for DomainRepository API key permissions; Added database tests for TagsPaginatorAdapter; Added database tests for short URL repository operations; Added database tests for the API key repository; Added database tests for visit count tracking listeners; Added database tests for visit deletion and iteration repositories; Added integration tests for MatomoSendVisitsCommand; Added shell scripts to standardize API and CLI test execution; Added specification classes for short URL filtering by API key and domain; Added specification for counting tags by name; Added test coverage for API key short-URL restriction logic; Added test specification for domain filtering; Added tests for CLI ApplicationFactory; Added tests for Core ConfigProvider and test environment credentials; Added tests for Core EventDispatcher components; Added tests for EnabledListenerChecker and RequestIdProvider; Added tests for ObjectMapper validation middleware and cache delegator factory; Added tests for REST ConfigProvider route prefixing; Added tests for ReadEnvVarCommand; Added tests for ShortUrlDataTransformer metadata and tag handling; Added tests for Tag repository filtering and statistics; Added tests for config post-processors; Added tests for custom slug handling in short URL creation; Added tests for geolocation and role configuration exceptions; Added tests for short URL relation resolvers; Added tests for the NotConfiguredMercureErrorHandler middleware; Added tests for the SendVisitToMatomo event listener; Added tests for visit geolocation logic; Added unit tests for API key management CLI commands; Added unit tests for API key role specifications and metadata handling; Added unit tests for ApiKeyMeta and RoleDefinition models; Added unit tests for ApiKeyService; Added unit tests for CLI ConfigProvider; Added unit tests for CORS and Real-Time Updates configuration options; Added unit tests for Core exception classes; Added unit tests for CrawlingHelper; Added unit tests for DomainService operations; Added unit tests for GeolocationDbUpdater; Added unit tests for Health and MercureInfo REST actions; Added unit tests for ImportedLinksProcessor; Added unit tests for ManageRedirectRulesCommand; Added unit tests for Matomo integration components; Added unit tests for Mercure event listeners; Added unit tests for REST middleware components; Added unit tests for REST redirect rule actions; Added unit tests for REST short URL actions; Added unit tests for REST visit actions; Added unit tests for RedirectCondition and ShortUrlRedirectRule entities; Added unit tests for RedirectConditionType validation; Added unit tests for Redis Pub/Sub event listeners; Added unit tests for ShortUrl entity behavior; Added unit tests for ShortUrlCreated and UrlVisited events; Added unit tests for ShortUrlRepositoryAdapter; Added unit tests for Tag entity and TagService; Added unit tests for Visit CLI commands; Added unit tests for Visit and VisitLocation entities; Added unit tests for configuration and redirect resolution components; Added unit tests for core ShortUrl services; Added unit tests for core tracking and crawling actions; Added unit tests for core utility classes; Added unit tests for database CLI commands; Added unit tests for domain redirect and listing actions; Added unit tests for domain-related CLI commands; Added unit tests for not-found error handling middleware; Added unit tests for short URL CLI commands; Added unit tests for short URL REST middleware; Added unit tests for short URL helper services; Added unit tests for short URL redirect middleware behaviors; Added unit tests for short URL redirect rule management and resolution; Added unit tests for tag management CLI commands; Added unit tests for tag management REST actions; Added unit tests for the API key role resolver; Added unit tests for the CLI RedirectRuleHandler; Added unit tests for the Visitor model; Added unit tests for the enumValues helper function; Added unit tests for visit paginator adapters; Added unit tests for visit tracking and deletion services; Expanded API test coverage for short URL and visit management; New API test fixtures for comprehensive short URL and redirect rule testing; New centralized test configuration and bootstrap files; New test utility classes for API data providers and URL construction.
Dependencies
Initial dependency manifest for Shlink v10.1
The project now defines its dependencies in composer.json, establishing a baseline for the application. This includes PHP 8.4, Mezzio 3.28, Doctrine ORM 3.7, Symfony 8.1 components, and Shlink-specific libraries such as shlink-common 9.0.2, shlink-installer 10.1, and shlink-importer 5.8. Development tooling is also specified, including PHPUnit 13.0 and PHPStan via the Mago static analysis tool.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 58.5 → 61.0 (+2.5)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 64.6 → 64.1 (-0.5)
- Architecture 77.7 → 80.0 (+2.3)
- Maturity 67.5 → 79.9 (+12.4)
- Readiness 51.6 → 51.6 (0.0)
- Security 66.0 → 66.0 (0.0)
- Domain Modelling 100.0 → 100.0 (0.0)
- Accessibility 59.8 → 75.0 (+15.2)
Resolved (12)
- Classify ADR enforcement: Build latest docker image only for actual releases (docs/adr/2023-07-09-build-latest-docker-image-only-for-actual-releases.md)
- Classify ADR enforcement: Handle dev and tests config via env vars instead of local config files (docs/adr/2024-10-24-handle-dev-and-tests-config-via-env-vars-instead-of-local-config-files.md)
- Classify ADR enforcement: Map requests using Valinor (docs/adr/2026-05-14-map-requests-using-valinor.md)
- Classify ADR enforcement: Migrate to a new caching library (docs/adr/2021-08-05-migrate-to-a-new-caching-library.md)
- Classify ADR enforcement: Support any HTTP method in short URLs (docs/adr/2023-01-06-support-any-http-method-in-short-urls.md)
- Classify ADR enforcement: Support multi-segment custom slugs (docs/adr/2022-08-05-support-multi-segment-custom-slugs.md)
- Classify ADR enforcement: Support restrictions and permissions in API keys (docs/adr/2021-01-17-support-restrictions-and-permissions-in-api-keys.md)
- Classify ADR enforcement: Track visits to 'base_url', 'invalid_short_url' and 'regular_404' (docs/adr/2021-02-07-track-visits-to-base-url-invalid-short-url-and-regular-404.md)
- Classify ADR enforcement: Update env vars behavior to have precedence over installer options (docs/adr/2022-01-15-update-env-vars-behavior-to-have-precedence-over-installer-options.md)
- Duplicated block (8 lines × 2) (module/Rest/test-api/Fixtures/VisitsFixture.php)
- Duplicated block (9 lines × 2) (module/Rest/test-api/Fixtures/VisitsFixture.php)
- Projects may be oversized for their cohesion
New (23)
- Change coupling: ApiKeyRepository.php ↔ ApiKeyService.php (module/Rest/src/ApiKey/Repository/ApiKeyRepository.php)
- Circular dependency (config/autoload/cache.global.php)
- Edited copies of one member (3 members, 14+ corresponding lines) (module/Core/src/Exception/DeleteShortUrlException.php)
- Edited copies of one member (3 members, 25+ corresponding lines) (module/Core/migrations/Version20240227080629.php)
- Edited copies of one member (3 members, 7+ corresponding lines) (module/CLI/src/Command/Tag/GetTagVisitsCommand.php)
- Edited copies of one member (3 members, 9+ corresponding lines) (module/Core/src/Exception/TagConflictException.php)
- Edited copies of one member (3 members, 9+ corresponding lines) (module/Core/src/Visit/VisitsStatsHelper.php)
- Edited copy of a member (10 corresponding lines) (module/Core/src/Visit/Paginator/Adapter/DomainVisitsPaginatorAdapter.php)
- Edited copy of a member (11 corresponding lines) (module/CLI/src/Command/Api/DeleteKeyCommand.php)
- Edited copy of a member (13 corresponding lines) (module/CLI/src/Command/Api/DeleteKeyCommand.php)
- Edited copy of a member (13 corresponding lines) (module/Core/src/Tag/Paginator/Adapter/AbstractTagsPaginatorAdapter.php)
- Edited copy of a member (14 corresponding lines) (module/Core/src/ShortUrl/Persistence/ShortUrlsCountFiltering.php)
- Edited copy of a member (15 corresponding lines) (module/Core/src/Visit/Listener/OrphanVisitsCountTracker.php)
- Edited copy of a member (16 corresponding lines) (module/Core/migrations/Version20240318084804.php)
- Edited copy of a member (26 corresponding lines) (module/Core/src/EventDispatcher/Async/AbstractNotifyNewShortUrlListener.php)
- Edited copy of a member (3 corresponding lines) (module/Core/migrations/Version20241124112257.php)
- Edited copy of a member (39 corresponding lines) (module/Core/src/Visit/Listener/OrphanVisitsCountTracker.php)
- Edited copy of a member (4 corresponding lines) (module/Core/migrations/Version20230211171904.php)
- Edited copy of a member (4 corresponding lines) (module/Core/src/Domain/Repository/DomainRepository.php)
- Edited copy of a member (6 corresponding lines) (module/Core/src/Visit/Paginator/Adapter/NonOrphanVisitsPaginatorAdapter.php)
- …and 3 more
Changes since last survey
- 12 commits — 9 feature/other, 3 fixes
By area
- (repo) — 4 commits
- (root) — 4 commits
- module/CLI — 2 commits
- data/migrations_template.txt — 1 commit
- module/Core — 1 commit
Notable commits
- fix: Fix for escape spreadsheet formulas when exporting visits as CSV
- fix: Merge pull request #2666 from matheuszcabral/fix/csv-formula-injection
- fix: fix the pr number
- change: Add Override attribute to migrations template
- change: Enfirce the usage of Override attribute when extending classes or implementing interfaces
- change: Merge pull request #2695 from acelaya-forks/cloudflare-location-resolver
- change: Merge pull request #2698 from acelaya-forks/update-valinor
- change: Merge pull request #2700 from acelaya-forks/override-attribute
- change: Move changelog entry to latest version
- change: Remove no-longer relevant todo
- change: Remove unused parameter from VisitsCommandutils::renderOutput
- change: Update to latest valinor patch
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
shlinkio/shlink was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 2aae1740043c3ab9c53f76467273883ac1a32be8 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.