=== Linkjet ===
Contributors: hafenstudios
Tags: redirect, affiliate, link cloaking, short url, rest api
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Link redirection & affiliate link management with click stats, QR codes, a 404 monitor, CSV/JSON backup and a full REST API.

== Description ==

Linkjet is a lightweight redirection and affiliate-link plugin with a clean, fully documented REST API, so links and redirects can be managed programmatically — great for automation and AI-assisted workflows.

**Features**

* Pretty short links / branded links on your own domain (e.g. `your-site.com/go/product`)
* Affiliate link management: cloaking, `rel="nofollow"` / `rel="sponsored"`, query-parameter forwarding
* Redirect types 301, 302, 307, 308 and 410 (Gone)
* Click statistics with time-series charts, plus device, browser and country breakdowns
* GDPR-friendly IP anonymisation, bot filtering, optional referrer tracking
* Automatic click-log cleanup after a configurable number of days (WP-Cron)
* Categories to organise your links and bulk actions to manage many at once
* QR code per link, generated locally in the browser (optional drop-in library, no external calls)
* Gutenberg block and `[linkjet]` shortcode for clean affiliate anchors in your content
* CSV and full JSON backup (import/export) for migration and backups
* One-click import wizard for existing **Pretty Links** and **Redirection** setups, including click statistics
* Multilingual UI: English, German, French, Spanish, Italian, Dutch + a language override
* Complete REST API under `/wp-json/linkjet/v1/`, authenticated via Application Passwords

**REST API endpoints**

* `GET/POST /wp-json/linkjet/v1/links`
* `GET/PUT/DELETE /wp-json/linkjet/v1/links/<id>`
* `GET /wp-json/linkjet/v1/links/<id>/clicks`
* `GET/POST /wp-json/linkjet/v1/categories`
* `DELETE /wp-json/linkjet/v1/categories/<id>`
* `GET /wp-json/linkjet/v1/stats`
* `GET/PUT /wp-json/linkjet/v1/settings`
* `GET /wp-json/linkjet/v1/404s` and `POST /wp-json/linkjet/v1/404s/<id>/redirect`
* `GET /wp-json/linkjet/v1/export`
* `POST /wp-json/linkjet/v1/import` (`?mode=replace` to overwrite)
* `GET /wp-json/linkjet/v1/openapi` (machine-readable API manifest)

Endpoints require the `manage_linkjet` capability, which is granted to administrators automatically and can optionally be granted to editors. A ready-to-use Postman/Insomnia collection ships with the plugin (`linkjet.postman_collection.json`).

== Installation ==

1. Upload the `linkjet` folder to `/wp-content/plugins/`, or install it through the Plugins screen.
2. Activate the plugin.
3. Open the **Linkjet** menu. On first activation the import wizard opens automatically and offers to import existing Pretty Links / Redirection data.
4. Create your first link, or import via CSV/JSON.

== Frequently Asked Questions ==

= Is there a Pro or paid version? =
No. Every feature listed is included; there is no separate paid upgrade.

= Does it send any data to external servers? =
No. Click tracking is first-party and stays in your own database. No external analytics, no CDN calls.

= How do I control Linkjet from outside WordPress (or from an AI/automation)? =
Use the REST API under `/wp-json/linkjet/v1/` with an Application Password (Users → Profile → Application Passwords). The bundled Postman collection contains every endpoint with example requests.

= Can I import my existing Pretty Links or Redirection links? =
Yes. The import wizard (Linkjet → Import wizard) detects both plugins' database tables and imports your links with one click, optionally including click statistics.

= Is it GDPR-compliant? =
IP addresses can be anonymised (last IPv4 octet / last 80 IPv6 bits removed), bots are not counted, country is only read from headers your server/CDN already provides (no external GeoIP database), and click logs can be auto-deleted after a chosen retention period.

= How do I enable the QR code feature? =
Drop an MIT-licensed `qrcode.min.js` (e.g. davidshimjs/qrcodejs) into `admin/assets/`. The plugin makes no external calls; the QR button appears only when the library is present.

= Where do I get support? =
Please use the plugin's support forum on WordPress.org. Linkjet is developed by hafenstudios (https://hafenstudios.com); you can also reach us at info@hafenstudios.com.

== Screenshots ==

1. Dashboard with click chart and top links
2. Link list with copy buttons, bulk actions and QR codes
3. Add/edit link with affiliate options
4. Statistics with device, browser and country breakdowns
5. Tools: CSV/JSON backup and REST API reference
6. Import wizard for Pretty Links and Redirection

== Changelog ==

= 1.3.1 =
* New: case-insensitive redirect fallback – redirects now also catch differently-cased URLs (e.g. /Programm and /PROGRAMM), but only when the URL would otherwise return a 404, so real pages are never hijacked.
* Change: removed promotional wording from the plugin name/description and assets.

= 1.3.0 =
* New: dedicated `manage_linkjet` capability – administrators always keep access; editors can optionally be granted access without full admin rights.

= 1.2.1 =
* Fix: slugs now preserve upper/lower case (e.g. /Programm); exact redirect matching is case-sensitive so an existing lower-case page is not hijacked.

= 1.2.0 =
* New: 404 monitor – logs dead URLs and turns them into redirects, with REST support for AI-assisted maintenance.
* New: REST endpoints for settings (`/settings`) and a machine-readable API manifest (`/openapi`).
* Fix: reliable UI translation loading, independent of the WordPress translation-file parser.

= 1.1.0 =
* New: performance cache for the redirect engine (slug index, avoids DB queries on non-matches).
* New: GDPR auto-cleanup – click logs are deleted automatically after X days via WP-Cron.
* New: device, browser and country statistics (country only from server/CDN headers, no external GeoIP DB).
* New: bulk actions in the link list (activate, deactivate, delete, assign category).
* New: slug collision warning when saving.
* New: QR code per link, generated locally (optional drop-in library, no external calls).
* New: Gutenberg block "Linkjet link".
* New: import wizard for Pretty Links and Redirection (incl. click statistics).
* New: full JSON backup (admin + REST `/export` & `/import`).
* New: multilingual UI (English, German, French, Spanish, Italian, Dutch) + language override.
* Security: protection against PHP object injection in the Redirection importer.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.3.1 =
Redirects now catch differently-cased URLs without hijacking real pages, plus a dedicated capability so editors can manage links without full admin rights.

= 1.1.0 =
Adds a redirect performance cache, GDPR click-log cleanup, device/browser/country stats, bulk actions, QR codes, a Gutenberg block, an import wizard, JSON backups and six UI languages.
