=== OTP Content Protect === Contributors: tehling Donate link: https://die-mainagentur.de Tags: otp, password, content protection, security, one-time password Requires at least: 6.0 Requires PHP: 7.0 Tested up to: 6.8 Stable tag: 1.3.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Protects selected content with one-time passwords (OTPs). == Description == OTP Content Protect allows administrators to create secure one-time passwords for individual posts, pages, and custom post types. Visitors must enter the correct OTP to view the protected content. After a single use, an OTP can optionally be reset for reuse. == Features == * Generates alphanumeric OTPs (8–10 characters) * Protects posts, pages, or any custom post type * AJAX-powered content list with search and post-type tabs * Stores creation date, expiration date, and usage timestamp * Optionally reset a used OTP for reuse * Fully internationalized (i18n) * Security best practices: nonces, prepared queries, sanitization & escaping * Uninstall script removes the plugin’s database table == Installation == 1. Unzip and upload the `otp-content-protect` folder to your `/wp-content/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. 3. Navigate to Settings → OTP Protect to configure and generate OTPs. == Screenshots == 1. Settings Page – Overview of all one-time passwords with actions. == Usage == 1. On the OTP Protect settings page, generate or enter an OTP and select the content to protect. 2. (Optional) Set an expiration date. 3. Save the OTP. Share it with the intended users. 4. When a visitor accesses the protected content, they will see an OTP input form. 5. Upon valid entry, the original content is displayed. 6. In the admin overview, you can reset or delete used OTPs. == FAQ == = How can I allow an OTP to be used more than once? = Edit the OTP in the settings and check "Allow reuse". This clears the usage timestamp and makes the OTP valid again. = Will plugin data be removed on uninstall? = Yes. The `uninstall.php` file drops the `_otpcp_protect` table when you delete the plugin from the WordPress admin area. == Changelog == **= 1.3.2 =** * **Fix:** Addressed final `WordPress.DB.PreparedSQL.NotPrepared` false-positive errors by adding specific `phpcs:ignore` comments to pass the "Plugin Check" tool cleanly. **= 1.3.1 =** * **Fix:** Resolved several warnings from the "Plugin Check" tool related to direct database queries and input validation. **= 1.3.0 =** * **Security:** Major refactoring to meet official WordPress.org requirements. All functions, classes, hooks, and the database table now use a unique `otpcp_` prefix to prevent conflicts. * **Security:** Standardized and improved all nonce checks for better security. * **Fix:** Corrected various bugs in the admin area, including broken edit links and script loading issues that arose during the refactoring. = 1.2.4 = * Fixed automatic tab activation and selection in edit mode * Improved JS/PHP communication of `selected_id` and `selected_type` = 1.2.3 = * Added `readme.txt` and improved i18n support * Fixed OTP generator and content filter labels = 1.2.2 = * Added backward compatibility for legacy `content_ids` column * Improved AJAX loading and security checks = 1.2.1 = * Fixed JS escaping for delete confirmation = 1.2.0 = * Switched to AJAX-driven dynamic content list * Server-rendered tabs with i18n labels = 1.1.0 = * Changed to single-select content field * Added search input and tabs = 1.0.0 = * Initial release with basic OTP protection functionality == Upgrade Notice == **### 1.3.0 ###** **This is a major security and stability update to meet WordPress.org requirements. All plugin functions and database entries are now prefixed to prevent conflicts.** ### 1.2.0 ### Dynamic AJAX list and improved UX. Tabs now show human-readable post type names. ### 1.1.0 ### Single-select dropdown replaced multi-select; search and tabs added.