=== Linkkit ===
Contributors: linkkit
Tags: short links, url shortener, link management, analytics
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically create and manage Linkkit short links when you publish WordPress posts and pages.

== Description ==

Linkkit integrates your WordPress site with [Linkkit](https://uselinkkit.com), a link management platform for branded short links, QR codes, and analytics.

**Features:**

* Automatically creates a short link when a post or page is published
* Updates the short link destination when a post's permalink changes
* Edit the short link slug directly from the WordPress post editor
* Copy short links to clipboard with one click
* Works with any public post type (posts, pages, custom post types)
* Secure OAuth 2.0 connection — no API keys to copy/paste

**How it works:**

1. Install the plugin and go to the Linkkit menu in your admin sidebar
2. Click "Connect to Linkkit" and authorize your workspace
3. Publish a post — a short link is automatically created
4. View and edit your short link in the post editor sidebar

== Installation ==

1. Upload the `linkkit` folder to `/wp-content/plugins/`
2. Activate the plugin through the Plugins menu
3. Go to the Linkkit menu in your admin sidebar and click "Connect to Linkkit"
4. Authorize the plugin and select your workspace

== Frequently Asked Questions ==

= Do I need a Linkkit account? =

Yes. Sign up for free at [uselinkkit.com](https://uselinkkit.com).

= Which post types are supported? =

By default, posts and pages. You can enable other public post types in the Linkkit settings page, or use the `linkkit_post_types` filter.

= Can I change the short link slug? =

Yes. Open any published post and look for the "Linkkit Short Link" box in the sidebar. Edit the slug and click Save.

= What happens if I disconnect? =

Your existing short links in Linkkit will continue to work. The plugin simply stops creating new ones and removes the stored connection token.

== Third-Party Service ==

This plugin connects to the [Linkkit](https://uselinkkit.com) external service to create and manage shortened URLs.

**What data is sent and when:**

* **OAuth connection** — When you click "Connect to Linkkit" in the plugin settings, you are redirected to `app.uselinkkit.com` to authorize the plugin. An authorization code is then exchanged for an access token via `api.uselinkkit.com/oauth/token`.
* **Creating short links** — When a post or page is published, the post's permalink and title are sent to `api.uselinkkit.com/v1/links` to create a short link.
* **Updating short links** — When a published post's permalink changes or the short link slug is edited, the updated data is sent to `api.uselinkkit.com/v1/links/{short_code}`.
* **Connection test** — After connecting, a request is made to `api.uselinkkit.com/v1/auth/test` to verify the connection and retrieve the workspace name.

**Service links:**

* [Linkkit website](https://uselinkkit.com)
* [Terms of Service](https://uselinkkit.com/terms)
* [Privacy Policy](https://uselinkkit.com/privacy)

== Changelog ==

= 1.1.0 =
* Added conversion tracking: inject the Linkkit script on the frontend via Settings → Conversion Tracking
* Publishable key stored and passed as data-publishable-key attribute on the script tag

= 1.0.2 =
* Fixed OAuth redirect URL and token exchange to match menu registration
* Fixed double-encoded redirect_uri in authorization request
* Added post meta cleanup on plugin uninstall
* Use wp_add_inline_style for admin menu icon styles

= 1.0.1 =
* Added third-party service documentation for WordPress.org compliance

= 1.0.0 =
* Initial release
