=== Dadan – Record Video, Screen & Webcam from Your Site ===
Contributors: dadanwp
Tags: screen recorder, video recording, webcam, video feedback, video embed
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a record button to your site. Visitors record their screen or webcam for free, with no account or install, and you get the video.

== Description ==

Some things are easier to show than to type.

**Dadan** adds a record button to your WordPress site. Visitors click it, record their screen, their camera or both, and the video uploads straight to your Dadan workspace. No more back-and-forth emails asking for screenshots: you see exactly what they mean.

Recording is free for your visitors: they don't need a Dadan account and don't install anything. They record in the browser, which asks for camera, microphone or screen access first.

= What you can use it for =

* **Support:** "Record your question" instead of a five-line description of a bug.
* **Client work:** let clients show you the page, the change or the problem.
* **Courses and coaching:** students ask about the exact step they're stuck on.
* **Testimonials:** customers say it on camera, in their own words.
* **Hiring:** candidates send a short video intro with their application.

= How it works =

1. **Connect Dadan.** In your Dadan dashboard, copy your public App ID (it starts with `app_`) and allow your site's address. Paste the App ID into Dadan → Instances.
2. **Add the button.** Use the Dadan Record block, the Elementor widget or the `[dadan-recording]` shortcode. Style it in the builder and check it in the live preview.
3. **Get the videos.** Visitors click, record and finish. The video uploads to your Dadan workspace, ready to watch and share.

= Make it yours =

* **Record button builder:** use the Dadan button or design your own (icon, text button or image) with your label, colours, shape and size, with a live preview in light and dark.
* **Studio theme:** match the recording studio to your site with an accent colour, light or dark appearance, font family and corner radius.
* **Recording options:** screen + camera, camera only or screen only; 720p, 1080p or 2K; a countdown; your own label on the finish button.
* **Who can record:** anyone, logged-in users, or editors and above. Everyone else doesn't see the button.
* **Where recordings go:** set a default video title, folder or team.
* **Instances:** keep several setups (App ID, button, theme) and pick one per block, widget or shortcode.
* **Hide on phones:** screen recording isn't available in mobile browsers, so you can hide the button on small screens.

= Embed your Dadan videos =

Paste a Dadan share link into the editor and it plays. Or use the **Dadan Video** block, the `[dadan]` shortcode or the Elementor widget.

= Works with your editor =

* Gutenberg blocks: **Dadan Record** and **Dadan Video**
* Shortcodes: `[dadan-recording]` and `[dadan]`
* Elementor widgets, when Elementor 3.20 or later is active (optional)

= Get started =

Start with a free Dadan account (no credit card needed). The record button runs on Dadan's Record SDK, included on the Lite, Pro and Business plans. [Try Dadan](https://www.dadan.io/pricing?utm_source=wordpress.org&utm_medium=plugin-directory&utm_campaign=202611_wporg-listing_acquisition&utm_content=readme-cta) and add your first record button in a few minutes.

Dadan is a third-party video recording and hosting service. This plugin requires a Dadan account; see External services below for what is sent and when.

= Security notes =

* Only public App IDs (`app_…`) are accepted.
* Optional front-end gate: anyone / logged-in / editors (withholds the recorder from blocked visitors).
* Administrators control App ID; non-admins fall back to Instances.
* The Record studio JavaScript is loaded from Dadan’s servers (not bundled in this plugin for WordPress.org).

= Share URLs =

Preferred: `https://app.dadan.io/video/share/{code}`

Direct `/video/{hexId}` links are not embeddable; use a share URL.

== Installation ==

1. Upload `dadan.zip` via **Plugins → Add New → Upload Plugin**, or copy the `dadan` folder to `/wp-content/plugins/`.
2. Activate **Dadan**.
3. (Optional) Install Elementor 3.20+ for page-builder widgets.
4. Configure a public App ID and Origin allowlist as described above.

The Record studio is lazy-loaded from a versioned CDN URL such as `https://app.dadan.io/sdk/record-2.1.2.js` (see External services). The WordPress glue code ships unminified in `src/recorder-app.js`.

== Frequently Asked Questions ==

= Is Dadan free? =

The plugin is free. You can sign up for a free Dadan account with no credit card. The record button needs a Dadan Lite plan or higher, and your visitors never pay or sign up to record.

= Do my visitors need a Dadan account? =

No. Visitors click your record button and record in their browser. The browser asks for camera, microphone or screen access first, and the finished video uploads to your Dadan workspace.

= Which Dadan plan do I need? =

The record button uses Dadan's Record SDK, which is included on the Lite, Pro and Business plans (Lite starts from $8/month, billed annually). See [Dadan pricing](https://www.dadan.io/pricing?utm_source=wordpress.org&utm_medium=plugin-directory&utm_campaign=202611_wporg-listing_acquisition&utm_content=faq-plan) for the current plans.

= Where are the videos stored? =

In your Dadan workspace, not in your WordPress media library. You can set a default title, folder or team for new recordings. WordPress stores only your public App ID and display settings.

= Can visitors record on their phones? =

Screen recording isn't available in mobile browsers. Use "Hide on phones" to show the button only where it works.

= Do I need Elementor? =

No. The blocks and shortcodes work without it. When Elementor 3.20 or later is active, you also get matching Dadan widgets.

= Do I need the old Dadan Video Embed or Dadan for Elementor plugins? =

No. This unified plugin replaces both. Deactivate and delete the old ones first.

= Why doesn’t recording start? =

Confirm a valid public App ID (`app_…`), allowlist the exact site Origin in Dadan, use HTTPS, and ensure the browser can reach Dadan’s CDN studio (`app.dadan.io/sdk/record-*.js`). Check the browser console for origin/permission/SRI errors.

= What data is sent to Dadan? =

When visitors record or watch embeds, the browser talks to Dadan’s servers for the player, studio script, APIs, and uploads. WordPress stores only your public App ID and display settings — not secret API keys.

= Is Dadan a third-party service? =

Yes. See [dadan.io](https://www.dadan.io/) for product terms and privacy policy.

== Screenshots ==

1. Visitors record their screen, camera or both from a button on your site. They don't need a Dadan account.
2. The record button builder: the Dadan button or your own label, colours, shape and size, with a live preview.
3. The Dadan Record block in the block editor, connected through your default instance.
4. The Dadan Record widget for Elementor, with Content and Style controls.
5. Studio theme and recording options: accent colour, light or dark, font, corner radius, and modes and quality up to 2K.
6. Embed Dadan videos by pasting a share link, or with the Dadan Video block, the [dadan] shortcode or the Elementor widget.

== Changelog ==

= 2.1.4 =
* Clearer plugin name and directory listing copy. No code changes.

= 2.1.3 =
* Redesigned instance settings: status header, Save and copy-shortcode buttons, regrouped tabs, cards with hints, switches, segmented controls and a live button preview. Saving returns to the same tab.
* Dadan admin page: setup checklist for new sites; record button and "add to your site" guide once connected. Fixes the page never loading the recorder.
* Instances list: Ready / Needs App ID status and copy buttons.
* Elementor widget: Content / Style split, icon choices, headings, hints and a connection status notice. Control IDs unchanged.
* Dadan Record block: instance picker for everyone (App ID is an admin override), correct connected state, regrouped panels.
* Clear message when Dadan rejects the App ID or site origin.

= 2.1.2 =
* Harden public localize (no unused Default credentials); Elementor no longer double-localizes.
* Embed height ignores WP portrait default; busy-take guard uses SDK `state`.
* Plugin Check: `wp_json_file_decode`, kses on CTA/iframe output, exclude `package.json` from zip.
* Perf/a11y: tighter SDK host scan, `aria-busy` on open, focus-visible CSS, URL regex caps.

= 2.1.1 =
* Pin Record studio to immutable versioned CDN URLs with SRI (CDN-2).
* Ship GPL WordPress glue locally; load only the generic studio API from the CDN as window.DadanRecord (CDN-3).
* Lazy-load the studio script/CSS (and React on public pages) on first Record click (CDN-6); React via WordPress core (W11).
* Exclude proprietary recorder-sdk build from WP.org packaging (CDN-4).
* Script translations for block/editor JS (W2); .distignore-driven zip + .gitattributes (W7).
* Readme metadata: five tags, short description ≤150 chars; Plugin URI points at integrations (W10).
* Requires at least WordPress 6.6 (react-jsx-runtime for the CDN studio — NEW-5).
* Privacy/perf: strip admin URLs from public localize; single enqueue; unique CTA ids; bare share codes; embed max-width.
* JS: refuse mid-recording reopen; no editor navigation on missing App ID; video-block record panel no longer pretends to insert.

= 2.1.0 =
* Option B / W1: Record studio loads from Dadan CDN with SRI (proprietary SDK not required in the WP.org zip).
* External services section updated (player, SDK APIs, uploads, IndexedDB).
* Security/compliance follow-ups from audit (access gate, Elementor strip, link[] hardening, uninstall multisite, restore-pending default off).
* Requires at least WordPress 6.3; Elementor widgets require Elementor 3.20+.

= 2.0.4 =
* Security: strip privileged Record block attrs after kses; ignore untrusted App ID / access at render (block + Elementor).
* Security: harden embed `link` parsing against array query params (PHP 8).
* Fix: system-audio migration runs once in admin only and preserves explicit settings.
* Uninstall removes the system-audio migration option.

= 2.0.3 =
* Theme colors: normalize Elementor alpha/rgba so Primary and CTA colors apply on the front end.
* Package slug `dadan` / `dadan.zip`.
* Maintainer docs: security checklist + WordPress.org submission guide.

= 2.0.0 =
* Unified plugin: Gutenberg + shortcodes + optional Elementor widgets.
* Shared Instances and Record SDK bundle.
* Security: public App ID allowlist, record access gate, privileged attr strip, local iframes, privacy suggestion.

== Upgrade Notice ==

= 2.1.4 =
Listing and naming update only; safe to update.

= 2.1.3 =
Polished settings, Elementor and block editor UI; fixes the Dadan admin page record button. No settings migration needed.

= 2.1.2 =
Low/Info hardening: embed height, busy-take guard, public localize, Elementor enqueue, Plugin Check cleanups. CDN studio remains record-2.1.1.* (no reupload).

= 2.1.1 =
Requires WordPress 6.6+. Record studio URL is pinned to a versioned CDN file. Upload record-2.1.1.js/.css to app.dadan.io/sdk/ before upgrading CDN-mode sites.

= 2.1.0 =
WordPress.org / CDN mode loads the Record studio from app.dadan.io. Ensure that host is reachable, or use a private zip that still includes the local bundle.

= 2.0.3 =
Delete older Dadan / dadan-u2 / dadan-elementor folders before uploading to avoid “destination folder already exists”.

== External services ==

This plugin connects to Dadan (https://www.dadan.io/), a third-party video hosting and recording service operated by Link Solutions Ltd. Embedding and recording do not work without it. The plugin itself makes no server-side requests to Dadan: every connection below is made by the visitor's (or editor's) browser.

1. Dadan video player (embeds)
* What: an iframe loaded from https://app.dadan.io/video/embed.html
* When: each time a page containing a Dadan Video block, [dadan] shortcode, Dadan URL embed or Dadan Video Elementor widget is viewed.
* Data sent: the video share code and standard browser request data (IP address, user agent, page origin as referrer).

2. Dadan Record studio script (Option B)
* What: versioned files such as https://app.dadan.io/sdk/record-2.1.2.js and .css (integrity pinned via SRI in the plugin). WordPress glue stays in the plugin.
* When: after someone clicks a Dadan Record button (lazy-loaded). Admin/editor screens that open the recorder may load earlier when a local SDK is present.
* Data sent: standard browser request data for the script/style download.

3. Dadan Record SDK API (recording)
* What: https://app.dadan.io/api/sdk/session, https://app.dadan.io/api/Transcoder/records and https://app.dadan.io/api/video/download/…
* When: only after someone clicks a Dadan Record button and starts a recording.
* Data sent: the site's public App ID (app_…), the site origin, optional Folder ID / Team ID and video title configured by the site admin, plus IP address and user agent.

4. Dadan upload service (recorded media)
* What: https://upload-direct.dadan.io
* When: when a recording is finished and uploaded.
* Data sent: the recorded video and audio, which may include the visitor's camera image, microphone audio and/or screen contents, and an upload token issued by Dadan.

While recording, if “restore pending take” is enabled, the browser may temporarily keep an unfinished recording in IndexedDB (up to 24 hours) and upload-resume keys in localStorage. WordPress stores only the public App ID and display settings.

Dadan Terms of Service: https://www.dadan.io/terms-of-service
Dadan Privacy Policy: https://www.dadan.io/privacy-policy

== Privacy ==

This plugin does not implement its own analytics. When you configure recording or embeds, visitors interact with Dadan’s service under Dadan’s privacy policy. Site admins should mention Dadan embeds/recording in their site privacy policy if required by local law. The plugin also suggests privacy policy text under **Settings → Privacy**.
