=== ZD Embed for Zoom Meeting SDK ===
Contributors: zdapps
Tags: zoom, meeting sdk, video conferencing, embed, webinar
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed meetings in WordPress using the Zoom Meeting SDK (Web) with secure server-side signature generation. This plugin is not affiliated with Zoom.

== Description ==
ZD Embed for Zoom Meeting SDK lets you embed a meeting experience inside WordPress pages (not an iframe). It uses the Zoom Meeting SDK (Web) and generates the required signature on your server via a protected REST endpoint.

Features:
* Custom Post Type: **Zoom Rooms** (each room has a public URL like `/zoom/my-room/`)
* Shortcode embedding anywhere
* Server-side signature (JWT HS256) via REST endpoint protected by a temporary token
* Optional “Leave URL”
* Anti-cache headers for embed pages (helps prevent expired-token issues)

Important notes:
* You cannot reliably embed a standard Zoom join link in an iframe due to browser/platform restrictions. The recommended way is the Meeting SDK.
* By default the plugin generates **attendee (role=0)** signatures only. Host role requires additional security and is intentionally blocked.

== Installation ==
1. Upload the plugin ZIP in **Plugins → Add New → Upload Plugin**, then activate it.
2. Go to **Settings → ZD Zoom Embed** and set your SDK Key/Secret.
   Recommended (more secure): add them to `wp-config.php`:
   ```
   define('ZDZE_SDK_KEY', 'YOUR_SDK_KEY_OR_CLIENT_ID');
   define('ZDZE_SDK_SECRET', 'YOUR_SDK_SECRET_OR_CLIENT_SECRET');
   ```
3. Create a **Zoom Room** in the WordPress admin and enter:
   * Meeting Number
   * Passcode
4. Visit the public URL of that Zoom Room, or use the shortcode.

== Zoom App Setup (Meeting SDK) ==
To embed meetings you need a Zoom app with Meeting SDK enabled.

Steps (high-level):
1. Go to the Zoom App Marketplace and choose **Develop → Build App**.
2. Create a **General App**.
3. Open **Embed** and enable **Meeting SDK**.
4. Copy your credentials (Client ID/Secret or SDK Key/Secret) from **App Credentials**.

Official documentation:
* Meeting SDK - Create your app
* Meeting SDK - Authentication / signature

(These links are also included inside the plugin admin screen.)

== Shortcode ==
Use this shortcode in any post/page:
`[zd_zoom_embed meeting_number="123456789" passcode="ABC123" height="700" auto_join="1" user_name="Guest"]`

Arguments:
* `meeting_number` (required)
* `passcode` (optional)
* `height` (default 700)
* `auto_join` (default 1)
* `user_name` (optional)

== Frequently Asked Questions ==
= Why do I get “Invalid or expired token”? =
Usually caused by page caching (serving a stale token). Exclude your Zoom Room URLs from cache and purge all caches (plugin/server/CDN).

= Can I embed webinars? =
This plugin focuses on meetings. Webinar embedding can be added later, but it depends on your Zoom setup and SDK requirements.

== Changelog ==
= 1.1.2 =
* Fix: Remove Plugin URI and Author URI headers to avoid unreachable URL warnings.
* Fix: register_setting uses sanitize_callback + store SDK Secret as raw string (escape on output).
* Fix: Remove DONOTCACHEPAGE constant to avoid global behavior changes.

= 1.0.4 =
* Fix: PHP parse error in settings screen (clean rewrite of class-zdze-settings.php).

= 1.0.3 =
* Fix: PHPCS escape warnings in settings screen (disabled attribute).
* Fix: Remove discouraged manual textdomain loading; add Domain Path for automatic loading.
* Fix: Update readme to English + add short description and update “Tested up to”.

= 1.0.2 =
* Add: Zoom app setup instructions and WordPress.org publication assets.

= 1.0.1 =
* Fix: Token is not invalidated after the first attempt (allows retries).
* Improvement: Prevent duplicate join (auto-join + click).
* Improvement: Add no-cache headers and DONOTCACHEPAGE for embed pages.

= 1.0.0 =
* Initial release.