=== Dailymotion Pro ===
Contributors: dmproservices
Tags: video player, dailymotion, video, embed, media
Requires at least: 6.4
Tested up to: 6.9
Stable tag: 2.3.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The official Dailymotion Pro WordPress plugin that seamlessly integrates Dailymotion videos into your WordPress site.

== Description ==

The Dailymotion Pro WordPress plugin supports your editorial workflow by facilitating the embedding of Dailymotion videos. You can import playback settings from your Dailymotion account and easily manage video content across your WordPress site.

**Features**

- Seamless integration with the WordPress Block Editor (Gutenberg)
- Classic Editor integration
- Shortcode support for embedding videos
- Per-post video settings
- Dailymotion account integration
- Support for both public and private videos
- Playlist embedding
- Customizable player settings

**Requirements**

- WordPress 6.4 or higher
- PHP 7.4 or higher
- Active Dailymotion account (for accessing your videos)

= Usage =

**Block Editor (Gutenberg)**

1. Create or edit a post/page using the Block Editor
2. Click the "+" button to add a new block
3. Search for "Dailymotion" and select the Dailymotion block
4. Click the "Search Videos" button in the block
5. Search for a video by title, or browse your videos/playlists
6. Select the video you want to embed
7. Adjust video settings as needed in the block settings panel
8. Save or publish your post/page

**Classic Editor**

1. Create or edit a post/page using the Classic Editor
2. Click the "Dailymotion" button in the editor toolbar
3. Search for a video by title, or browse your videos/playlists
4. Select the video you want to embed
5. Click "Insert" to add the video to your post/page
6. Save or publish your post/page

**Using Shortcodes**

You can manually embed Dailymotion videos using the `[dm-player]` shortcode:

```
[dm-player videoid="VIDEO_ID" videotitle="Video Title"]
```

Shortcode attributes:
- `videoid`: The ID of the public Dailymotion video
- `privatevideoid`: The ID of a private Dailymotion video
- `playlistid`: The ID of a Dailymotion playlist
- `videotitle`: The title of the video (displayed as caption)

Example:
```
[dm-player videoid="x7zxy9p" videotitle="My Awesome Video"]
```

= Configuration =

**Per-post Video Settings**

You can customize video settings on a per-post basis:

1. Edit a post/page that contains a Dailymotion video
2. Click the "Video Settings" button in the sidebar of the Gutenberg editor
3. Adjust settings like Player ID, Mute, Video Heading, and Video Title

**Global Plugin Settings**

To configure global plugin settings:

1. Go to Dailymotion Pro > Plugin Settings in your WordPress admin
2. Adjust default settings for Player ID, mute, video heading, and video title display


= Auth Key =

**What is the Auth Key?**

The Auth Key is a security feature in the Dailymotion Pro plugin that protects your Dailymotion account credentials. Think of it as a special password that encrypts your sensitive information when it's stored in your WordPress database.

**Why is it Important?**

When you connect your WordPress site to Dailymotion, you need to store API credentials (similar to a username and password). The Auth Key ensures this information is securely encrypted, preventing unauthorized access to your Dailymotion account.

**How it Works for Users**

Automatic Protection

By default, the Dailymotion Pro plugin uses WordPress's built-in security keys to protect your information. This means:

- You don't need to do anything special to enable basic protection
- Your credentials are automatically encrypted when saved
- The plugin handles all the security details behind the scenes

Enhanced Security (Optional)

For users who want extra security, you can set up custom security keys:

1. **Generate secure random keys**: Use an online secure key generator
2. **Add the keys to your wp-config.php file**: Add the following lines near the other WordPress security keys:

```php
define('DM_PRO__AUTH_KEY', 'your-custom-random-key-here');
define('DM_PRO__NONCE_KEY', 'another-custom-random-key-here');
```

3. **Save the file**: Make sure to keep a backup of these keys in a secure location

**Best Practices**

- **Use unique keys**: Don't reuse passwords or keys from other services
- **Keep your wp-config.php secure**: Restrict access to this file on your server
- **Update keys periodically**: Consider changing your custom keys every few months for maximum security
- **Backup before making changes**: Always backup your site before editing configuration files


= User roles =

We follow the <a href="https://wordpress.org/documentation/article/roles-and-capabilities/">roles and capabilities documentation</a> provided by the WordPress team.

**Super admin**
As a `Super Admin`, you can see and use the dailymotion plugin (all options: log in, credentials, settings) and search box/embed options

**Administrator**
As an `Admin`, you can see and use the dailymotion plugin (all options: log in, credentials, settings) and search box/embed options

**Editor**
As an `Editor`, you can see and use the dailymotion plugin (all options: log in, credentials, settings) and search box/embed options

**Author**
As an `Author`, you can see and use the dailymotion plugin (limited options: log in, manual embed settings access) and search box/embed options

**Contributor**
As a `Contributor`, you can see and use the dailymotion plugin (limited options: log in, manual embed settings access) and search box/embed options

== Installation ==

1. Download Dailymotion Pro plugin ZIP file
2. In your WordPress admin panel, go to Plugins > Add New
3. Click the "Upload Plugin" button at the top of page
4. Click "Choose File" and select the downloaded ZIP file
5. Click "Install Now"
6. After installation, click "Activate Plugin"

Once activated, you'll see a "Dailymotion Pro" menu item in your WordPress admin sidebar.

= Store Your Dailymotion Private API Key and Secret =

To access your Dailymotion videos and playlists:

1. Go to Dailymotion Pro > Connection in your WordPress admin Dashboard
2. Go to <a href="https://www.dailymotion.com/partner/api-keys/">Dailymotion Studio</a> to generate a new private API key and API secret
3. Click "Create API Key" and choose Private API Key.
4. Permissions needed by the plugin:
	- Upload videos
	- Read videos
	- Read players
	- Read playlists
	- Read Channels
5. Find your channel name by visit [profiles page](https://www.dailymotion.com/partner/account/profiles) in Dailymotion Studio. You should see `@username`. Use it without `@`. E.g. `@myusername` > `myusername`
6. Once a private API key and API secret are stored, you'll be able to access your videos and playlists directly from the WordPress editor

== Screenshots ==

1. Dailymotion Pro block in the WordPress Block Editor
2. Video search interface
3. Video settings panel
4. Plugin settings page
5. Setup Wizard

== Changelog ==

= 2.3.0 =
**Enhancements**
- New Setup Wizard Experience — A refreshed, step-by-step setup that’s easier to follow from start to finish.
- Live Player Preview — Instantly see how your video player looks while you adjust settings.
- Default Video Settings — Set your preferred video display options right from the start.
- Improved Video Search — Find videos faster with new filters like Channel, Language, and Sort.
- Per-Post Player Customization — Adjust video titles and headings to match your style on each post.
- Smarter Dashboard — The dashboard now shows helpful information based on your connection status.
- Easier Editor Controls — Quickly select videos and manage settings directly in the editor.
- Better Contextual Matching Setup — A smoother experience when setting up automatic video suggestions.
- New Feedback Option — Share your thoughts easily through a new feedback banner.
- Updated Admin Design — A cleaner, more modern look across the admin interface.

**Bug fixes**
- Improved overall stability for a more reliable experience.
- Smoother navigation in the setup wizard.
- More consistent video player loading.
- Better keyboard navigation and focus visibility for accessibility.

**Security**
- General security improvements to keep your experience safe and reliable.

**Compatibility**
- Fully compatible with WordPress 6.4.

= 2.2.3 =
**Bug fixes**
- Supported performance optimizer (script optimizers, caching tools, CloudFront optimizers) to be working with Dailymotion Player.

= 2.2.2 =
**Bug fixes**
- Fixed the issue with the plugin not working on sites in Gutenberg-only mode in WordPress 6.4

= 2.2.1 =
**Bug fixes**
- Fixed the issue with the plugin not load the player ID from the settings

= 2.2.0 =
**Security**
- Improved security by strengthening input validation and restricting direct access to sensitive files

**Enhancements**
- Added the uncompiled JavaScript and CSS source files to ensure the plugin remains open, human-readable, and compliant with WordPress.org guidelines.

= 2.1.0 =
**Enhancements**
- Improved Setup Wizard: The setup process now features smooth animations and a more intuitive interface
- Better Connection Setup: The connection setup process is more robust with improved validation of API credentials and channel ID
- Visual Feedback: New feedback banners provide immediate visual confirmation when saving settings or making changes
- Dashboard Improvements: Updated dashboard view with a new "Contact Us" button and improved messaging based on setup progress
- Improved Security: Enhanced security measures throughout the plugin
- Faster Script Loading: Improved JavaScript loading for better performance
- Enhanced Shortcode Functionality: Improved Dailymotion player shortcode with fixed JavaScript loading and proper parameters

**Bug fixes**
- API Secret Handling: Fixed issues with API secrets containing special characters
- Contextual Embedding: Fixed script loading for contextual player embedding


== Source Code and Development ==

This plugin includes minified JavaScript files that are built from TypeScript source code. In accordance with WordPress plugin guidelines, the source code is included in the plugin package in the `src` directory.

**Build Tools**

The plugin uses the following build tools:
- npm: For JavaScript dependency management and build scripts
- webpack: For bundling and minifying JavaScript files
- TypeScript: For type-safe JavaScript development

To build the plugin from source:
1. Install dependencies: `npm install`
2. Build the JavaScript files: `npm run build`

For more information about the development process, please visit our [GitHub repository](https://github.com/Dailymotion-Pro-Services/Dailymotion-Pro-WP-Docs).


== External Service ==

This plugin connects to the **Dailymotion API** as an external service. The API is used for:

- **Searching videos**: Search for both public and private content hosted on Dailymotion.
- **Private content access**: To access private videos, the plugin requires storing an API Key and API Secret securely in your WordPress installation.
- **Video information retrieval**: The API also provides video metadata (title, thumbnail, etc.) which is used to embed videos seamlessly into the WordPress editor.

By using this plugin, you acknowledge that interactions with the Dailymotion API are subject to Dailymotion's own policies and service conditions.

- [Terms of Use](https://legal.dailymotion.com/en/terms-of-use/)
- [Privacy Policy](https://legal.dailymotion.com/en/privacy-policy/)


== Support ==

For support, please contact the plugin developers through the official support channels or visit the plugin's documentation website at [Dailymotion Pro GitHub Issue](https://github.com/Dailymotion-Pro-Services/Dailymotion-Pro-WP-Docs/issues).

== Frequently Asked Questions ==

= Can I embed private videos? =

Yes, you can embed private videos from your Dailymotion account by connecting your account and using the `privatevideoid` attribute in the shortcode or selecting the video through the editor interface.

= Can I customize the player appearance? =

Yes, you can use different player configurations by specifying a Player ID in the video settings. Player configurations are managed in your Dailymotion account.

= Can I embed playlists? =

Yes, you can embed playlists using the `playlistid` attribute in the shortcode or by selecting a playlist through the editor interface.

= Is the plugin compatible with WordPress multisite? =

The plugin should work with WordPress multisite installations, but some features may require additional configuration.

= How do I get support? =

For support, please contact the plugin developers through the official support channels or visit the plugin's documentation website.

= Troubleshooting =

**Video Not Displaying**

1. Check your internet connection
2. Verify that the video ID is correct
3. Ensure the video is publicly available or that you have proper access to private videos
4. Check if your Dailymotion account is properly connected

**Player Settings Not Working**

1. Make sure you've saved your post/page after changing settings
2. Check if per-post settings are overriding global settings
3. Clear your browser cache and reload the page

**If you experience issues after adding custom keys**

1. **Check for typos**: Make sure the code was added exactly as shown
2. **Verify file permissions**: The wp-config.php file should have proper permissions (typically 644)
3. **Clear cache**: Clear your WordPress cache after making changes
4. **Contact support**: If problems persist, reach out to the plugin support team
