$ show Upstatement/routes
Routes is a WordPress plugin that provides simple custom routing functionality using the AltoRouter library. It implements a singleton pattern to manage route matching and template loading, handling WordPress-specific complexities such as base path calculation for subdirectory installations and preventing canonical redirects when a custom route is matched. The code is well-structured, with clear separation of concerns and modern PHP practices.
The LLM identified 1 files worth highlighting for reuse:
The Routes class provides a singleton wrapper around AltoRouter for WordPress, enabling custom route mapping with automatic handling of trailing slashes, subdirectory base paths, and prevention of canonical redirects when a route is matched. It demonstrates non-obvious WordPress integration by solving common issues like base path calculation and avoiding interference with WordPress's template loading and redirect systems.