=== PeakURL ===
Contributors: peakurl, iamabdurrehman
Tags: short links, short urls, redirects, marketing, links
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Donate link: https://buymeacoffee.com/PeakURL

Connect WordPress to PeakURL and create, update, and manage short links for published content without leaving the editor.

== Description ==

PeakURL connects a WordPress site to PeakURL with a bearer API key, giving you a fast, modern admin workspace to generate, manage, and monitor short links for all your published content.

With the plugin enabled, editors and admins can:

* manage settings and maintenance in a sleek, responsive React dashboard with full light/dark mode support
* customize short link alias generation formats (auto-generated, post slugs, or dynamic custom templates)
* create or update PeakURL links for posts, pages, and supported custom post types
* copy generated short URLs instantly from the block/classic editor or posts list table
* open the matching PeakURL dashboard screen for an existing short link
* bulk sync all published content or run batch operations from the posts list
* pull remote links from your PeakURL account and map them to local WordPress content
* prune orphaned remote links that point to deleted WordPress content
* optionally delete the remote PeakURL link when content is permanently deleted in WordPress

PeakURL stores the configured API key encrypted in the WordPress options table and uses the PeakURL API with bearer-token authentication.

Learn more and see the setup guide in the [PeakURL for WordPress docs](https://peakurl.org/docs/wordpress-plugin).

== External services ==

This plugin connects to the PeakURL API URL that you configure in the plugin settings. It uses that API to verify the connection from WordPress and to create, update, and optionally delete short links for supported content.

The plugin does not send data to PeakURL until you enter an API URL and API key and then use one of the plugin's connection or sync actions.

Requests are sent when you:

* click `Verify Connection`
* manually sync content from the editor
* bulk sync selected content from the posts list
* save published content while automatic sync is enabled
* permanently delete content while remote deletion is enabled

When the plugin connects, it sends:

* your PeakURL bearer API key in the `Authorization` header
* the WordPress permalink, link title, and optional custom alias when creating or updating a short link
* the stored PeakURL link ID when updating or deleting an existing short link

For the plugin-specific privacy notice, see:

* [PeakURL for WordPress Privacy Policy](https://peakurl.org/privacy-policy/wordpress-plugin)

If you connect the plugin to the managed PeakURL.com service, the same request data is sent to that configured PeakURL API.

If you connect the plugin to a self-hosted PeakURL install, the same data is sent to the API URL you configure for that install. Self-hosted deployments are operated by you or your chosen host, so their own terms and privacy policy apply.

== Installation ==

1. Upload the `peakurl` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the `Plugins` screen in WordPress.
3. Open the `PeakURL` menu item in the WordPress admin.
4. Enter the PeakURL API URL, that you can get from the PeakURL dashboard settings API Keys.
5. Create an API key in your PeakURL dashboard and paste it into the plugin settings.
6. Save the settings and click `Verify Connection` to confirm the site can connect.

== Frequently Asked Questions ==

= Where do I find the base API URL? =

You can find that from the PeakURL dashboard Settings > API Keys.

= Where do I get the API key? =

Create the key in your PeakURL dashboard from `Settings -> API Keys`.

= Which content types are supported? =

PeakURL supports posts, pages, and supported public custom post types that you enable in the plugin settings.

= Where can I learn more about setup and usage? =

Read the full [PeakURL for WordPress documentation](https://peakurl.org/docs/wordpress-plugin).

= Can I update an existing PeakURL link instead of creating duplicates? =

Yes. Once a post already has a connected PeakURL link, the plugin updates that link in place.

== Screenshots ==

1. General Settings - Modern React admin dashboard with light/dark theme support, API connection management, automation sync rules, and alias structure settings.
2. Alias Structure Configuration - Configure short code generation via auto-generated strings, post slugs, or custom tag templates (%post_id%, %postname%, %post_type%) with real-time preview.
3. Secure API Connection Management - Masked bearer token management, staged key replacement, and one-click connection verification with instant status feedback.
4. Maintenance Tools Hub - Centralized tools dashboard for bulk synchronization, remote link discovery, and orphaned short link cleanup.
5. Bulk Sync Local Content - Batch process all published posts and pages to create or update PeakURL links with live progress tracking and failure logging.
6. Pull Links from Server - Fetch remote short links from PeakURL and automatically map them to matching local published content.
7. Prune Orphaned Remote Links - Safety confirmation modal and controls to scan and permanently clean up remote links whose WordPress content no longer exists.
8. Prune Operation in Progress - Live progress bar, percentage indicator, and real-time execution statistics during link cleanup.
9. Post & Page Editor Meta Box - Dedicated editor panel displaying the generated short URL, active alias mode placeholder, and instant sync action.
10. Meta Box Options & Quick Actions - View short link details, open the connected PeakURL dashboard link, or customize the short code for individual posts.
11. One-Click Copy Short URL - Copy the generated short link directly to your clipboard from the WordPress editor with instant feedback.
12. Posts & Pages List Quick Actions - PeakURL short URL column in WordPress list tables with quick copy, dashboard links, and bulk sync actions.

== Upgrade Notice ==

= 1.1.0 =
Features a redesigned modern React admin interface with Light/Dark mode, dedicated Tools tab for bulk synchronization and server cleanup, customizable alias structure patterns, enhanced editor meta boxes, and comprehensive multilingual translations for 10 locales.

= 1.0.0 =
Initial release.

== Changelog ==

= 1.1.0 =

* Complete UI/UX Redesign: Rebuilt the admin interface from a plain WordPress settings screen into a modern, fast, responsive Single Page Application powered by React and Tailwind CSS.
* Light & Dark Mode: Added full light and dark theme support with an instant toggle and persistent theme preference across admin sessions.
* Internationalization & Translations: Added complete translations for 10 languages: Arabic (ar), German (de_DE), English UK (en_GB), Spanish (es_ES), French (fr_FR), Italian (it_IT), Dutch (nl_NL), Portuguese (pt_PT), Urdu (ur), and Simplified Chinese (zh_CN), including Jed JSON compilation for the React frontend.
* Redesigned Settings Dashboard: Modern card layout for API connection management, masked token display with replace/remove workflows, live connection verification, and automation controls.
* Alias Structure Settings: Added options to generate short link aliases automatically, directly from post slugs, or using dynamic custom pattern templates (`%post_id%`, `%postname%`, `%post_type%`) with live preview.
* Maintenance Tools Tab: Added a dedicated tools screen with interactive progress bars, batch processing, and detailed diagnostic logs.
* Bulk Sync Tool: Push all published WordPress posts and pages to PeakURL with real-time percentage progress and error reporting.
* Server Pull Tool: Fetch remote short links from the PeakURL server and automatically map them to matching local published content.
* Orphan Link Pruning: Added safety confirmation modal and scanner to clean up remote links pointing to deleted WordPress content.
* Enhanced Editor Meta Box: Dynamic alias placeholders reflecting global settings, short link status badges, one-click copy, and direct PeakURL dashboard links.
* Posts List Table Enhancements: Added short URL columns, quick copy buttons, PeakURL dashboard links, and bulk sync actions.
* Improved WP-CLI Compatibility: Enhanced automatic sync triggers when creating or updating posts via WP-CLI.

= 1.0.0 =

* Initial release.
