=== Freedam Picker ===
Contributors: freedam
Tags: dam, media library, digital asset management, images, video
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Choose assets from a Freedam workspace and use them in WordPress. The files stay in Freedam and are served by its publication channel.

== Description ==

Freedam Picker connects a WordPress site to a Freedam workspace. People who can upload files open the Freedam Picker from a Freedam tab of the media library, choose images and documents, and use them like any other media. The files are not copied to WordPress: Freedam serves them from its publication channel, on the workspace's address.

* **Freedam tab** wherever WordPress opens the media library: the Image, Cover, Gallery, Media & Text and File blocks, the featured image, image fields of themes and the classic editor. Media > Library has an Add from Freedam button.
* **The picker opens in a new browser tab.** People sign in with their Freedam account and see the assets their access rights allow. With the optional public key, people without a Freedam account can insert the assets of the integration's profile.
* **Media library items without a local file.** Title, alternative text, description and credit come from Freedam. Choosing the same asset again updates the existing item.
* **Images served by the channel.** Image sizes and srcset use the widths of the channel, the channel's named formats appear in the Resolution list, and an Image block with a fixed aspect ratio gets an image cropped around the focus point.
* **Freedam video or document block.** A video in the player of the channel, or a document as a link, a thumbnail or in the viewer.
* **Usages.** Freedam records the media library item and each post that shows the asset, with its address and title.
* **Unavailable assets.** When an asset's rights expire or it is unpublished, the plugin hides it from visitors and shows notices in the media library, the post editor and the dashboard.

The plugin needs a Freedam workspace with the Freedam Picker (Business and Tailored plans). Guide: https://freedam.io/docs/admin-wordpress

== Installation ==

1. In WordPress, go to Plugins > Add New Plugin > Upload Plugin, upload the plugin zip and activate it.
2. In Freedam, create an integration of type CMS with a website publication channel and a profile, and copy its key.
3. In WordPress, go to Settings > Freedam and enter the host of the workspace and the integration key.
4. Add the origin shown on the settings page to the allowed origins of the integration in Freedam.
5. Click Test connection.

To update the plugin, upload the zip of the newer version the same way: WordPress offers to replace the installed version.

== Frequently Asked Questions ==

= What does Freedam need for the plugin to work? =

The Freedam Picker feature on the workspace, an active integration of type CMS with the origin of the WordPress administration, a website publication channel that accepts the asset types you want to use, and a profile that sends at least the title, alternative text and credit fields.

= Are the files copied to WordPress? =

No. A Freedam item of the media library has no local file: every address of the item, including its sizes and srcset, is an address of the Freedam publication channel.

= The picker says that the page that opened it is no longer reachable. =

The administration pages send the header "Cross-Origin-Opener-Policy: same-origin", usually set by a security plugin or the web server. Set it to "same-origin-allow-popups".

= What happens when I delete the plugin? =

Its settings are deleted. Media library items, posts and the usages recorded in Freedam are kept.

== External services ==

The plugin connects to the Freedam workspace whose host is set in Settings > Freedam, and to no other service. Freedam is the digital asset management service that stores and serves the assets.

* **Picker.** When a person clicks Open Freedam or Test connection, their browser opens a page of the workspace with the integration key, the optional public key, the origin of the WordPress administration, the language of the person's WordPress profile and the asset types the window accepts. The person signs in to Freedam on that page, under Freedam's terms.
* **Usages.** When a post that shows a Freedam asset is saved, trashed, restored or deleted, and when a Freedam item is deleted from the media library, the WordPress server sends to the workspace's usage endpoints (/api/v1/usages) the address of the post when it is published, its title and status, and a reference made of the site's host and the post's ID. The requests carry the usage token Freedam issued for the asset.
* **Availability.** Every hour, and when someone edits a post that shows a Freedam asset, the WordPress server sends HEAD requests to the published addresses of the assets, at most 100 an hour, to learn whether they are still available.
* **Display.** The browsers of the site's visitors and editors load the images, video player and document viewer from the workspace's address, as for any image hosted on another domain.

Freedam terms of service: https://freedam.io/terms. Privacy policy: https://freedam.io/privacy.

== Changelog ==

= 1.0.0 =
* First release: Freedam tab of the media library, images served by the publication channel, Freedam video or document block, usages and unavailable assets. Bundles the Freedam Picker SDK 1.2.0.
