=== Unlock-To-View ===
Contributors: zzraz
Donate link: https://www.paypal.com/donate/?hosted_button_id=4SMV5H3BFFJKQ
Tags: rent video, unlock to view, pay per view, monetize, code to unlock
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Unlock-To-View lets you lock videos using shortcodes. Perfect for monetizing and securing content.

== Description ==

Unlock-To-View is a lightweight plugin for WordPress that lets you restrict access to videos using an unlock code. No registration needed, the viewer simply adds their email, gets a code and unlock. Pay afterwards (optional)! Supports YouTube, Vimeo, Presto Player, and direct video URLs.

== Demo ==

https://www.youtube.com/watch?v=ccbgOlbsec8

Watch on YouTube:

[https://www.youtube.com/watch?v=ccbgOlbsec8](https://www.youtube.com/watch?v=ccbgOlbsec8)

**Key Features:**
* Lock any video with a simple shortcode.
* Fixed price and duration for all rentals
* Supports multiple video players (YouTube, Vimeo, Presto Player, or direct URLs).
* Easy-to-use shortcode generator in the admin panel.
* All shortcodes are stored in a log
* Full rental log with email, slug, media, expiration and IP.
* Easily send email reminders for expired payments 
* A mark as paid button to show if a rental is paid.
* CSV export of all shortcodes and rentals.
* Customizable unlock button text.
* No third party integration

**PRO Features:**
* Full customization of the unlock/rental button.
* Fixed or individual price and duration for rentals
* Support for additional video players.
* Styling options directly in the admin panel.

**How it works:**
1. Embed a video on any page or post.
2. Use the Unlock-To-View shortcode
3. Users unlock the video by adding their email address
4. All rentals are logged using email, slug, expiry date and code  
== External services ==

This plugin may connect to the following external services:

1. **Vimeo (player.vimeo.com)**  
   - **Purpose**: To display embedded videos using Vimeo’s video player.  
   - **What is sent**: When a video is displayed, the visitor’s browser requests the video from Vimeo’s servers. This includes the video ID and standard browser request information (such as IP address and user agent).  
   - **When**: Only when a page containing a Vimeo video shortcode is viewed.  
   - **Terms of Service**: https://vimeo.com/terms  
   - **Privacy Policy**: https://vimeo.com/privacy

2. **theappmill.com**  
   - **Purpose**: The plugin includes a link to the developer’s website to provide documentation and help users build shortcodes. This is for informational purposes only.  
   - **What is sent**: No data is sent automatically. When a user clicks the link, it simply opens in their browser like a regular hyperlink.  
   - **When**: Only if the user manually clicks the link in the plugin interface.  
   - **Terms of Service**: https://theappmill.com/unlocktoview/terms.html  
   - **Privacy Policy**: https://theappmill.com/unlocktoview/privacy.html

== Installation ==

https://www.youtube.com/watch?v=iV8xKcYXRq8

Watch on YouTube:

[https://www.youtube.com/watch?v=iV8xKcYXRq8](https://www.youtube.com/watch?v=iV8xKcYXRq8)

1. Download the zip file
2. Upload the zipped file from the Plugins menu in WordPress.
3. Activate the plugin.
4. Go to the Unlock-To-View settings page to configure pricing, emails, and rental options.
5. Use the shortcode generator to create shortcodes for your videos.

== Frequently Asked Questions ==

= Can I use any video player? =
Not in the free version. You can choose between Presto Player, Vimeo, YouTube, or a direct video URL.

= How do I set the rental duration? =
Go to Settings → General Settings → Duration (hours) to set how long a rental lasts. In the free version there is one duration for all rentals. In the PRO version you can set this individually per shortcode.

= How do I set the rental price? =
Go to Settings → General Settings → Price to set the price for rentals. In the free version there is one price for all rentals. In the PRO version you can set this individually per shortcode.

= Can I customize the unlock button text? =
Yes. In Settings → General Settings → Button Label, you can customize the text users see.

= Can I export my rental log? =
Yes. Use the “Export to CSV” button on the admin page.

== Screenshots ==

1. Shortcode Generator interface.
2. Rentals log with email reminders.
3. Settings page for pricing and email templates.

== Changelog ==

= 1.2.7 =
* Corrected and improved readme documentation.

= 1.2.6 =
* Refreshed plugin design and styling.
* Added shortcode list management.
* Added HTML5 video player support.
* Added unlock button emoji option.
* Updated compatibility for WordPress 7.0.

= 1.2.5 =
- Updated design. Bug fixes.

= 1.2.4 =
- Fixed the unlock flow so videos remain hidden until a valid code is entered, while still rendering supported players correctly after unlock.

= 1.2.3 =
* Updated compatibility metadata to mark the plugin as tested with WordPress 6.9.

= 1.2.2 =
* Updated the admin menu label to “Upgrade to Pro ⭐”.
* Improved top spacing on plugin admin pages.

= 1.2.1 =
* Updated the admin button styling so the Export to CSV button matches the green button theme.

= 1.2 =
* Updated About page content.
* Added refreshed WordPress.org banner assets.
* Improved readme video formatting for WordPress.org plugin pages.
* Fixed frontend and admin AJAX nonce handling.
* Added missing capability checks and export nonce verification.

= 1.0.1 =
* Fixed broken AJAX nonce handling on frontend and admin actions.
* Registered the existing-code AJAX endpoint for guests and logged-in users.
* Added missing capability checks to admin-only AJAX actions.
* Added nonce verification to CSV export.
* Updated the readme video sections with separate Demo and Installation tutorials.
* Switched readme video embeds to the WordPress.org-compatible bare URL format.

= 1.0.0 =
* Initial release.
* Added support for multiple video players.
* Shortcode generator added.
* Rental log with email reminders.
* CSV export for rentals.
* Customizable unlock button text.

== Upgrade Notice ==
= 1.2.7 =
Documentation update for the WordPress.org plugin page.

= 1.2.6 =
Recommended update with refreshed design, HTML5 video support, shortcode list improvements, unlock button emoji support, and WordPress 7.0 compatibility.

= 1.2.3 =
Compatibility metadata update for WordPress 6.9.

= 1.2.2 =
Minor admin UI update with improved menu labeling and page spacing.

= 1.2.1 =
Minor UI update for improved admin button styling consistency.

= 1.2 =
Recommended update with admin page improvements, documentation updates, banner refreshes, and important AJAX/security fixes.

= 1.0.1 =
Security and functionality update with AJAX fixes, export nonce verification, and refreshed documentation videos.

= 1.0.0 =
Initial release of Unlock-To-View. No upgrade actions needed.

== License ==

This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
