=== Snipwing ===
Contributors: loyaltyoverroyalty
Tags: short links, url shortener, qr code, link management, redirect
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Branded short links on your own domain, each with a QR code, click analytics and a one-tap copy-and-QR workflow. Fast, private, team-ready.

== Description ==

Snipwing turns your own domain into a short-link service. Name a link once and you get a branded URL like `yoursite.com/go/deck`, a QR code, and a one-tap copy button.

It is built for speed and restraint, not feature count. No upsell nags, no "pro" teasers, no dashboard clutter.

**Fast where it matters.** A redirect resolves from an indexed slug lookup and, on a site with a persistent object cache, runs zero database queries. The theme never loads on a redirect, so short links are quick even under load. Clicks are recorded after the visitor has already been sent on their way.

**Private by design.** Snipwing never stores IP addresses, raw or hashed. Click analytics keep only the referring site's domain and a daily count. That keeps the plugin clear of consent-banner territory, and it is a deliberate difference from the incumbents.

**Team-ready.** Every link has an owner. Editors and above manage their own links by default; administrators manage everyone's. A settings screen lets you grant link management to any role, so a marketing team can run links without full admin.

= Features =

* Branded short links under a prefix you choose (default `/go/`).
* Per-link QR code, generated in your browser, downloadable as PNG or SVG. Your URLs are never sent to a third-party QR service.
* One-tap Copy button, with a mobile layout that works one-handed.
* Click analytics: totals, a 30-day chart, and a referrer-domain breakdown. No IP addresses.
* Redirect type per link (302 by default; 301, 307 and 308 available) with a plain-language warning on the permanent ones.
* Optional expiry date and click limit per link.
* Pin the links you share most to the top.
* Campaign tags (UTM) builder on the edit screen.
* CSV import from Snipwing, Pretty Links or Bitly exports, and CSV export.
* Role-to-capability settings, so you decide who can manage links and see stats.

== Installation ==

1. Upload the `snipwing` folder to `/wp-content/plugins/`, or install through Plugins → Add New.
2. Activate the plugin.
3. Open Snipwing in the admin menu and add your first link.
4. Optionally visit Snipwing → Settings to change the URL prefix or grant link management to more roles.

== Frequently Asked Questions ==

= Does Snipwing track visitors or store IP addresses? =

No. It stores a per-day click count and the referring site's domain, nothing else. No IP addresses, no cookies on the redirect, no per-visitor logs.

= Why is 302 the default redirect type? =

Browsers cache 301 (permanent) redirects aggressively, often for good. If you mistype a target and someone has already clicked, a 301 becomes very hard to fix. 302 keeps you free to change the target later. Snipwing warns you when you pick a permanent type.

= Can I use root-level short links, like yoursite.com/deck? =

Not in this version. Links live under a configurable prefix so they can never shadow a real page or post.

= Will the short links slow my site down? =

No. Non-matching requests do a single string comparison and stop. A matched link resolves from the object cache when one is available, and the theme is not loaded for a redirect.

= Can other users manage my links? =

Only administrators, or a role you explicitly grant the "edit and delete anyone's links" capability. Everyone else manages only the links they own.

== Privacy ==

Snipwing stores, per link, a daily click count and the domain of the referring website (for example `t.co`). It does not store IP addresses, full referrer URLs, user agents, or any per-visitor identifier. Statistics older than the retention period you set (12 months by default) are deleted automatically.

== Screenshots ==

1. The links list, with copy and QR buttons on every row.
2. A full-screen QR code, ready to scan or download as PNG or SVG.
3. The add/edit screen with live slug availability and the UTM builder.
4. Per-link statistics: totals, a 30-day chart and a referrer breakdown.
5. Settings: URL prefix, statistics retention and role permissions.

== Third-party libraries ==

Snipwing bundles the QR Code Generator library by Kazuhiko Arase (qrcode-generator 1.4.4), used in the browser to draw QR codes. It is licensed under the MIT License. Source and license: https://github.com/kazuhikoarase/qrcode-generator . The library file and its licence are in `assets/js/vendor/`.

== Changelog ==

= 0.1.0 =
* First release: short links with a QR code, click analytics, copy and QR sharing, per-link expiry and click limits, role-based management, UTM builder, and CSV import/export.
