DAM
The MediaPress DAM is a WordPress plugin that integrates with Digital Asset Management (DAM) systems like Cloudinary. It allows assets to be automatically imported into the WordPress media library when tagged appropriately in the DAM system.
Features
Section titled “Features”- Admin Settings Page to configure DAM API credentials.
- Webhook Handling to listen for asset tag changes.
- Asset Importing when a valid target tag is added in the DAM.
- Support for Multiple DAMs (Cloudinary and Bynder with extensibility for more integrations).
Installation
Section titled “Installation”1. Install the Plugin
Section titled “1. Install the Plugin”- Clone repo.
- Run
npm i - Run
composer install - Add this folder to plugin directory or use wp-env
- Activate the plugin in the WordPress admin panel.
2. Connect to DAMs
Section titled “2. Connect to DAMs”- Navigate to Settings > DAM Connections in the WordPress Admin.
- Enter the API credentials.
Webhook Setup
Section titled “Webhook Setup”When successfully connecting to a DAM, a webhook connection will be created.
- The Webhook Endpoint will be the following:
https://yourwordpresssite.com/wp-json/mediapress-dam/v1/webhook/{dam}
{dam}replaced with dam name.
Local Webhook Setup
Section titled “Local Webhook Setup”You can define MEDIAPRESS_CLOUDINARY_WEBHOOK_URIto override this.
The local webhook endpoint would be:
/index.php?rest_route=/mediapress-dam/v1/webhook/{dam}
Cloudinary Setup
Section titled “Cloudinary Setup”To find your Cloudinary URL, follow these steps:
- Go to the Cloudinary console and navigate to API Keys.
- Copy your URL. It will look like this:
cloudinary://<your_api_key>:<your_api_secret>@<cloud_name>
- Save this URL in the Cloudinary url field.
Bynder Setup
Section titled “Bynder Setup”- Go to your Bynder portal and navigate to Advanced settings > Portal settings > OAuth Apps
- Click Add new app and configure:
- Application name: MediaPress WordPress Integration
- Integration: WordPress
- Grant Type: Client Credentials
- Assigned user: Select a user with administrator profile
- Scopes: Select the following:
asset:read- Fetches assets from Byndercurrent.user:read- Verifies connectionwebhooks.config:read- Webhook managementwebhooks.config:write- Webhook management
- Copy your Client ID and Client Secret.
- Construct the connection URL in the following format:
bynder://<client_id>:<client_secret>@<your-portal-domain>
For example: bynder://abc123:xyz789@your-company.getbynder.com
- Save this URL in the Bynder url field which is located in the admin panel Mediapress > Settings > DAM.
How It Works
Section titled “How It Works”The plugin registers a mediapress_dam_tags meta field on posts.
When tags are added to this field, the plugin automatically fetches assets from the connected DAMs that match those tags. The assets are then imported into the WordPress media library and attached to the corresponding post.
Additionally, the plugin listens for asset tagging events in the DAMs via webhooks. When an asset is tagged in the DAM, it is automatically imported into the media library and linked to the appropriate post.
Extending the Plugin
Section titled “Extending the Plugin”Adding More DAMs
Section titled “Adding More DAMs”To add support for another DAM system:
- Implement a new DAM handler class with
DAMHandlerInterface. - Register the handler in
DAMManager. - Define methods for fetching assets and handling webhooks.
- Implement a new DAM connection class with
DAMConnectorInterface - Register the connection class in the admin class.