=== MediaValet - Your Digital Asset Management (DAM) Plugin ===
Contributors: mediavalet
Tags: digital asset management, dam, media, cdn, mediavalet
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your MediaValet DAM to WordPress. Browse your entire asset library, insert images and files into pages and posts, and serve assets dynamically via CDN — without ever leaving WordPress.

== Description ==

The MediaValet for WordPress plugin connects your WordPress site directly to your MediaValet DAM (digital asset management). Built on the modern Unify platform, it enables content teams to search, browse, and insert approved assets from MediaValet without ever leaving the WordPress editor. The plugin streamlines your content workflow with instant access to your full media library, rich metadata, and CDN-powered dynamic asset transformations.

= Key Features =

* **MediaValet Asset Picker embedded in WordPress** - Search, filter, preview, and select assets from your full MediaValet library without leaving the WordPress editor.
* **CDN delivery with dynamic image transformations** - Insert CDN-optimised image links with on-the-fly transformations: resize, automatic format selection, and freeform cropping.
* **CDN delivery with video transformations** - Embed videos with full playback control: autoplay, mute, loop, hide controls, and background playback.
* **Automatic metadata transfer** - Alt text, title, and expiry dates are automatically pushed to WordPress on asset insertion, keeping your content accessible and compliant.
* **Built on Unify** - Powered by MediaValet’s modern Unify integration platform for improved reliability, maintainability, and a consistent experience.

= Benefits =

* Eliminate constant tab switching — work directly inside WordPress.
* Easily access the approved digital assets instantly from MediaValet.
* Transform and optimize assets on the fly before publishing.
* Reduce manual errors by using only approved, centralized assets.
* Maintain consistent branding across every page and post.
* Empower content teams with a seamless DAM-to-CMS experience.
* Built on MediaValet’s Unify platform for a modern, reliable integration.

= Requirements =

* A MediaValet account
* WordPress account with any of the Contributors, Authors, Editors or Administrators Role
* WordPress 5.0 or higher
* PHP 7.4 or higher

= External Service =

This plugin connects to the MediaValet platform ([mediavalet.com](https://www.mediavalet.com)) to provide asset browsing, CDN link generation, and media synchronization. When using the plugin, the following data is sent to MediaValet servers:

* Your WordPress user ID and email address (for authentication with your MediaValet account)
* Your WordPress site URL (to establish the connection)
* Asset metadata when inserting or syncing media

This data is transmitted over HTTPS. By using this plugin, you agree to the [MediaValet Terms of Service](https://www.mediavalet.com/terms-and-condition) and [Privacy Policy](https://www.mediavalet.com/privacy-policy).

== Installation ==

= Method 1: Install directly from WordPress Admin (Recommended) =

1. Log in to your WordPress admin panel at `https://yourdomain.com/wp-admin`
2. Navigate to **Plugins** → **Add New**
3. In the search bar (top right), type **MediaValet**
4. Locate the **MediaValet – Digital Asset Management for WordPress** plugin and click **Install Now**
5. Once installed, click **Activate**

= Method 2: Manual Upload =

1. Download the plugin zip from the [WordPress Plugin Directory](https://wordpress.org/plugins/mediavalet/advanced/)
2. In your WordPress admin, navigate to **Plugins** → **Add New**
3. Click **Upload Plugin** at the top of the page
4. Click **Choose File**, select the downloaded `.zip` file, and click **Install Now**
5. Once installed, click **Activate Plugin**

= After Activation =

1. Navigate to **Media** → **MediaValet CDN** in the admin sidebar
2. Click **Select Asset from MediaValet** and log in with your **MediaValet account**
3. Browse your library, select an asset, and click **Add to Media Library**

**Note:** No API keys or OAuth credentials are required. Authentication is handled automatically via your MediaValet account.

== Configuration ==

After activating the plugin, no API keys or OAuth credentials are required.

== How to Use ==

= 1. Add a CDN asset without downloading =

Use this when you want the asset to be served directly from the MediaValet CDN without storing a local copy.

1. Go to **Media > MediaValet CDN** in the admin sidebar
2. Click **Select Asset from MediaValet** and login with MediaValet account
3. Browse Your Library — To select an asset, navigate through your library and hover over the desired file. Click on the [+] icon (labeled "Insert as CDN Link"). This will open the **Get CDN Link** popup. From there, choose the required format and select the appropriate size. Finally, click on "Insert CDN Link" to complete the process.
4. The CDN URL, title, alt text, and expiry date are filled in automatically
5. Optionally edit the title and alt text
6. Click **Add to Media Library** — the asset is added to Library in WordPress and served via CDN

= 2. Insert assets in the Editor =

1. Open or create a post/page using the Editor 
2. Choose the file from MediaLibrary which was uploaded from MediaValet to WordPress.
3. The asset is inserted into your post

= 3. Manage CDN assets in Media Library =

After inserting a CDN asset you can manage it from **Media > Library**:

* **Use CDN URL toggle** — switch between serving the file from MediaValet CDN (dynamic) or a local WordPress copy (static)
* **CDN URL field** — view or edit the CDN URL directly
* **Re-sync from CDN** — re-download the latest version of the asset from MediaValet

== Frequently Asked Questions ==

= Do I need a MediaValet account? =

Yes. You need an active MediaValet account to browse and insert assets.

= How does CDN serving work? =

When "Use CDN URL" is enabled for an asset, images are served directly from the MediaValet CDN. Any updates to the asset in MediaValet are automatically reflected in WordPress without re-uploading.

= Can I switch between CDN and local serving? =

Yes. Each asset has a "Use CDN URL" toggle in the Media Library attachment editor. You can switch at any time.

= How do I re-sync an asset from CDN? =

In Media Library, click on the asset and use the "Re-sync from CDN" button to download the latest version from MediaValet.

== Support ==

For help with installation or configuration, visit our support resources:

* **Support Page:** [MediaValet WordPress Plugin Guide](https://support.mediavalet.com/hc/en-us/articles/48236046772756-How-to-Install-the-MediaValet-Wordpress-Plugin)
* **Email:** [support@mediavalet.com](mailto:support@mediavalet.com)
* **WordPress.org Forum:** [Plugin Support Forum](https://wordpress.org/support/plugin/mediavalet/)
 

== Screenshots ==

1. MediaValet assets appear directly in the standard WordPress Media Library — once added via CDN, your entire team can select and reuse them just like any locally uploaded file.
2. Browse your full MediaValet library inside WordPress and get a CDN link in seconds — choose format (JPEG, PNG, WebP) and size, then click "Insert CDN Link" to add the asset without downloading or re-uploading.
3. The dedicated "Add MediaValet CDN Link" page under Media — select an asset from your DAM, fill in optional title and alt text, and add it straight to your WordPress Media Library with one click.
4. Full CDN control in the Attachment details panel — view the MediaValet CDN URL and enable "Serve dynamically from CDN" so any asset update in MediaValet reflects on your site immediately, with no manual syncing.

== Changelog ==

= 1.0.2 =
* Fix: picker spinner now appears immediately on click in all browsers including incognito/private mode
* Fix: iframe loads after modal renders — spinner is always visible before network activity starts
* Fix: re-opening picker after first load is instant with no redundant reload

= 1.0.1 =
* Performance: removed unnecessary CDN HEAD request on asset insert, significantly reducing insert time
* Fix: spinner now appears immediately when adding asset to Media Library

= 1.0.0 =
* Initial release
* MediaValet asset browser in WordPress editor
* Basic asset insertion into posts and pages

== Upgrade Notice ==