# Short.bg URL Shortener

WordPress extension for shortening post URLs via Short.bg API.

## Features

- Settings page: `Settings > Short.bg URL Shortener`
- API key configuration
- Checkboxes for all public post types to control where the widget appears
- Editor widget (metabox):
  - source URL field (auto-filled with current post permalink)
  - button `Съкрати този линк`
  - optional `Password`
  - optional `Valid until` date
  - result short URL + copy button

## API behavior

- Endpoint: `POST https://short.bg/api/v1/links`
- Always sends:
  - `url` 
- Sends optional fields when provided:
  - `redirect_password`
  - `active_period_start_at`
  - `active_period_end_at`

## Installation

1. Copy folder `short-bg-url-shortener` into `wp-content/plugins/`.
2. Activate plugin from `Plugins` screen.
3. Open `Settings > Short.bg URL Shortener`.
4. Set API key and choose post types where the widget should be shown.

## Notes

- Requires valid Short.bg account and API key:
  - `https://short.bg/register`
  - `https://short.bg/account/api`
  - `https://short.bg/developers/links`

## License

This plugin is licensed under GPL-2.0-or-later.

- License: GNU General Public License v2.0 or later
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
