Skip to content
/ awesome Public

Add Frontend Links plugin#227

Merged
ozh merged 1 commit intoYOURLS:mainfrom
nyerou:patch-1
Feb 16, 2026
Merged

Add Frontend Links plugin#227
ozh merged 1 commit intoYOURLS:mainfrom
nyerou:patch-1

Conversation

@nyerou
Copy link
Contributor

@nyerou nyerou commented Feb 16, 2026

Add Frontend Links

A link-in-bio page plugin that runs entirely within YOURLS.

Features:

  • Manage sections, links, profile (name, bio, avatar) and custom icons from the YOURLS admin
  • Auto mode: generates index.php + .htaccess at the document root — zero external setup
  • Branded redirect interstitial with Open Graph / Twitter Card metadata for social previews
  • Branded 404 page (both can be disabled via admin toggles)
  • Full subdirectory support (short URLs resolve at root domain)
  • CSP compliant (YOURLS 1.10+), all JS/CSS externalized
  • i18n ready (French included)

Repository: https://github.com/nyerou/yourls.frontend-links


Why this is a true YOURLS plugin (and not a standalone frontend)

This is a fair question: why manage a link page from a URL shortener? The answer is integration.

It lives inside the YOURLS ecosystem

  • Installed like any YOURLS plugin: dropped into user/plugins/, activated from "Manage Plugins", tables created automatically on activation via yourls_add_action('activated_*')
  • Uses native hooks: plugins_loaded, loader_failed, redirect_shorturl, filters shorturl, yourls_link, action html_head — no hacks, only official extension points
  • Shares the YOURLS database: uses yourls_get_db() (Aura.SQL/PDO), reads YOURLS_DB_TABLE_URL to resolve keywords, and creates its own tables with the standard prefix
  • Respects YOURLS authentication: the admin panel is registered via yourls_register_plugin_page(), the AJAX endpoint verifies nonces with yourls_verify_nonce()
  • Supports YOURLS translations: yourls_load_custom_textdomain(), all strings go through yourls__() / yourls_e()

It builds on what YOURLS already does

The plugin doesn't reinvent the wheel — it extends YOURLS:

  • Page links are YOURLS short URLs: entering git in the URL field creates a link to example.com/git that goes through YOURLS resolution. Clicks are tracked, stats work out of the box
  • Short URL resolution is intercepted (not replaced) via the redirect_shorturl hook to add a branded interstitial with OG metadata — the YOURLS redirect remains the underlying mechanism
  • Auto mode generates a root index.php that loads YOURLS (load-yourls.php) and uses YOURLS functions to resolve keywords. It's not a separate server — it's YOURLS running from the document root
  • The generated .htaccess lets YOURLS handle its own subdirectory (RewriteRule ^-/ - [L]) while routing everything else to the plugin handler

Why not a separate frontend?

A standalone frontend (Next.js, static site, etc.) consuming the YOURLS API would be:

  • Decoupled: separate install, separate config, separate deployment, separate auth
  • Limited: no access to YOURLS hooks, no redirect interception, no branded 404, no click tracking
  • Redundant: YOURLS already serves PHP pages, already manages a database, already has an admin system with auth — why duplicate all of that?

The plugin uses YOURLS as a platform, not just an API. The link page, the redirect, the 404, the admin — everything runs through the same PHP process, the same session, the same database. One system to maintain.

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty neat. The PR description reads like LLM output, so I skipped that and went to look at the repo instead.

Your live demo of the visitor-facing bits works fine, but it's always nice if a project's readme includes screenshots. A random visitor can't get a sense of how the plugin's admin area works before installing it themselves.

@nyerou
Copy link
Contributor Author

nyerou commented Feb 16, 2026

It's okay, they've been added.

image

@ozh ozh merged commit 28e1e65 into YOURLS:main Feb 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments