=== Onveo Video ===
Contributors: onveo
Tags: video, courses, woocommerce, private video, lms
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
WC requires at least: 9.0
WC tested up to: 11.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell online courses and private videos hosted on Onveo with WooCommerce. Secure, domain-locked playback with personal links that expire.

== Description ==

Onveo Video connects your WordPress + WooCommerce store to your Onveo video library.

* **Private, secure playback** — every viewer gets a personal, signed playback link that expires (1–24 h). Copied embed codes stop working and the player only runs on your domain.
* **Courses** — build courses from your Onveo videos: sections, lessons, free preview lessons, drag-and-drop ordering.
* **Sell with WooCommerce** — attach courses and/or single videos to any product. Access is granted when the order is paid and removed automatically on refund or cancellation. Optional access duration (e.g. 365 days).
* **Student experience** — course player with curriculum sidebar, progress tracking, resume where you left off, "My Courses" in My Account, "Start watching" links in the order e-mail and thank-you page.
* **Optional watermark** — show the buyer's e-mail over the video to discourage screen recording and account sharing.
* **Access manager** — see who has access, grant access manually (gifts, support), revoke.
* **Blocks and shortcodes** — Onveo video, Onveo course, My Courses.
* **Turkish translation included.**

Works with the WooCommerce block checkout and High-Performance Order Storage (HPOS).

= Shortcodes =

* `[onveo_course id="123"]` — course player with curriculum.
* `[onveo_my_courses]` — the logged-in buyer's courses and videos.
* `[onveo_video id="ABC123"]` — a single video, domain-locked.
* `[onveo_video id="ABC123" product="42"]` — only buyers of product 42.
* `[onveo_video id="ABC123" password="secret"]` — password protected.
* Optional: `ratio="16:9" autoplay="1" muted="1" buy_text="Buy to watch"`.

= wp-config.php constants (optional) =

* `ONVEO_KEY_ID`, `ONVEO_SECRET` — keep the integration key out of the database.
* `ONVEO_HOST` — Onveo URL used by the player (default https://app.onveo.tv).
* `ONVEO_API_HOST`, `ONVEO_SSL_VERIFY` — development only: server-to-server API host and TLS verification.

== Installation ==

1. Upload the plugin and activate it.
2. In Onveo, open **Settings → WordPress**, create an integration key and add your shop's domain (e.g. `example.com`) to the allowed domains.
3. In WordPress, open **Onveo → Settings**, paste the Key ID and Secret, save and click **Test connection**.
4. In **Onveo → Video library**, make the videos you sell **Private**.
5. Create a course in **Onveo → Courses** and add lessons from your library.
6. Create a WooCommerce product, open the **Onveo** tab and select the course. Publish.

== Frequently Asked Questions ==

= Can a buyer share the video link? =
No. Links are personal and expire. Private videos only play with a valid link, and only on your allowed domains.

= What happens on a refund? =
A full refund (order status Refunded), cancellation or failed payment removes access. Partial refunds keep access. You can always revoke manually in **Onveo → Access**.

= Guests at checkout? =
By default, buying a course requires an account (WooCommerce asks the buyer to create one). If a guest order still comes through, an account is created automatically from the billing e-mail.

= Does it work without WooCommerce? =
Yes for embeds and password-protected videos. Selling requires WooCommerce.

== Changelog ==

= 2.0.0 =
* New: secure playback with per-viewer signed tokens and domain lock (requires Onveo private hosting).
* New: courses with sections, lessons, free previews, progress and resume.
* New: WooCommerce "Onveo" product tab — sell courses and videos, access duration, automatic grant/revoke.
* New: My Account → My Courses, order e-mail and thank-you page links.
* New: video library with privacy control, access manager, blocks, Turkish translation.
* New: HPOS and Cart/Checkout blocks compatibility.
* Kept: v1 `[onveo_video]` shortcode (product and password gates). Orders placed with v1 keep access.

= 1.0.0 =
* Initial release: shortcode embed with WooCommerce purchase or password gate.

== Upgrade Notice ==

= 2.0.0 =
Adds secure private playback, courses and WooCommerce access control. After updating, add your Onveo integration key under Onveo → Settings.
