=== Disable Right Click and Text Selection ===
Contributors: sarusadgac
Tags: security, right click, text selection, copy protection, content protection
Requires at least: 5.8
Tested up to: 6.8
Stable tag: 2.4.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Secure your WordPress content by disabling right-click and text selection with advanced role-based controls and per-post settings.

== Description ==

Disable Right Click and Text Selection deters casual copying by disabling the context menu (right‑click) and text selection. It’s lightweight, cache‑friendly, and flexible with per‑post/per‑type and role‑based controls.

= Core Features =

* Disable right‑click globally or per post
* Disable text selection globally or per post
* Role‑based access control (includes Guest); administrators excluded by default
* Post type filters and per‑post overrides
* Customizable warning messages per post
* Protection status column in post/page lists
* Quick Edit and Bulk Edit support
* Complete multilingual support (5 translations included)

= Security =

* Nonces, sanitization, and XSS‑safe output
* Secured AJAX endpoints
* Role‑based restrictions and per‑post settings

= Performance =

* Conditional asset loading (only when protection is active)
* Cache compatibility
* Minimal database queries
* No external dependencies
* Optimized, modular code structure

= Limitations =

This is a deterrent, not DRM. Determined users can still view source or use developer tools to copy content.

= Multilingual Support =

The plugin comes with complete translations for:
* English (en_US) - Default
* Turkish (tr_TR)
* Russian (ru_RU)
* Spanish (es_ES)
* German (de_DE)
* Azerbaijani (az_AZ)

== Installation ==

1. Upload `disable-right-click-and-select` to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings > Disable Right Click and Text Selection to configure global settings
4. Configure per-post settings in the post/page editor sidebar

== Frequently Asked Questions ==

= Is this plugin compatible with caching plugins? =

Yes, the plugin is compatible with popular caching plugins including WP Super Cache, W3 Total Cache, LiteSpeed Cache, and Cloudflare.

= Will this affect administrators? =

No, administrators are automatically excluded from restrictions by default.

= Can I customize the warning message? =

Yes, you can set custom messages both globally and per individual post/page.

= Does this work with custom post types? =

Yes, the plugin supports all public custom post types with individual protection settings.

= Can I protect specific posts differently? =

Yes, each post and page can have its own protection settings, including custom warning messages.

= Does this work with page builders? =

Yes, the plugin is compatible with major page builders including Elementor, Divi Builder, WPBakery, and Gutenberg.

= How does it handle mobile devices? =

The plugin works seamlessly on both desktop and mobile devices.

= Can I bulk edit protection settings? =

Yes, you can use the bulk edit feature in the posts/pages list to modify protection settings for multiple items at once.

== Changelog ==

= 2.4.1 =
* Maintenance: Updated plugin header metadata domain references

= 2.4.0 =
* Changed: Full modular architecture (Core / Admin / Frontend) – main file slimmed
* Added: JSON formatted bulk edit AJAX responses (standardized)
* Improved: Code organization and future maintainability
* Removed: Duplicate functions (moved from main file into Core)

= 2.3.1 =
* Added: Accessible (ARIA) non‑blocking toast message system
* Added: Message character counter and maxlength enforcement
* Improved: User experience – blocking alert removed
* Fixed: Minor consistency/markup improvements

= 2.3.0 =
* Added: Data model migration – disabled_posts option → post meta (_drc_flags, _drc_message)
* Added: Bitmask structure (1=right click, 2=text selection) for lightweight per‑post state
* Improved: Performance – reduced autoload memory footprint on large sites
* Improved: Asset loading condition logic (role & post type + caching)
* Security: Consolidated sanitization and settings retrieval

= 2.2 =
* Added: Per-post protection settings
* Added: Protection status column in post/page lists
* Added: Quick edit support for protection settings
* Added: Bulk edit support for protection settings
* Added: Individual warning messages per post

= 2.1 =
* Fixed: Missing translations in all language files
* Fixed: Fuzzy translations in language files
* Fixed: Text domain consistency in translations
* Updated: POT template file
* Updated: Translation loading mechanism

= 2.0 =
* Major version update with significant improvements
* Fixed: Text domain consistency issues
* Fixed: Security improvements for input validation and sanitization
* Fixed: Debug logging improvements
* Fixed: WordPress version compatibility issues
* Updated: Code structure and organization
* Updated: Security documentation
* Added: Static sanitization callback for settings
* Added: Improved error handling and logging
* Added: Better cache management

= 1.9 =
* Added: PHP 8.2 compatibility
* Added: WordPress 6.7 support
* Added: Enhanced security measures with nonce validation
* Added: Performance optimizations for asset loading
* Fixed: Cache clearing issues
* Updated: Security documentation

= 1.8 =
* Added: Role-based access control
* Added: Post type specific settings
* Fixed: Minor security issues
* Updated: Performance improvements

= 1.7 =
* Added: Guest user role support
* Added: Custom warning message feature
* Fixed: Text selection issues on mobile devices
* Updated: Code optimization

= 1.6 =
* Added: Cache compatibility improvements
* Added: Support for major page builders
* Fixed: JavaScript loading sequence
* Updated: Asset loading mechanism

= 1.5 =
* Added: AJAX security measures
* Added: XSS protection enhancements
* Fixed: Role permission issues
* Updated: Input sanitization

= 1.4 =
* Added: Deferred script loading
* Added: Conditional asset loading
* Fixed: Mobile device compatibility
* Updated: Performance optimizations

= 1.3 =
* Added: Multi-language support
* Added: Translation files
* Fixed: Admin interface issues
* Updated: Settings page layout

= 1.2 =
* Added: Post type selection feature
* Added: Admin exclusion by default
* Fixed: jQuery compatibility issues
* Updated: Core functionality

= 1.1 =
* Added: Basic settings page
* Added: Right-click disable feature
* Fixed: Initial bug fixes
* Updated: Code structure

= 1.0 =
* Initial release
* Basic right-click disable functionality
* Text selection prevention
* Simple admin interface

== Upgrade Notice ==

= 2.4.0 =
Modular architecture update – code reorganized for future maintenance. No behavior changes.

= 2.3.1 =
New accessible toast system and user‑friendly message length enforcement. Alert removed.

= 2.3.0 =
Important data model migration: per‑post settings moved to post meta. Automatic; no action required.

= 2.2 =
Major feature update: Adds per-post protection settings, quick/bulk edit support, and complete translations for 5 languages. Includes important security improvements.

= 2.1 =
Translation update with complete language support for Turkish, Russian, Spanish, German, and Azerbaijani. Includes fixes for missing and fuzzy translations.

= 2.0 =
Major update with important security improvements, better compatibility, and code structure enhancements. Includes text domain fixes and improved debug logging.

= 1.9 =
Security and performance update. Requires PHP 8.2 and WordPress 6.7 or higher.

= 1.8 =
Important security update with role-based access control.

= 1.7 =
New features including guest user support and mobile improvements.

= 1.6 =
Cache compatibility and page builder support improvements.

= 1.5 =
Critical security enhancements and bug fixes.

= 1.4 =
Performance optimization update.

= 1.3 =
Added multi-language support.

= 1.2 =
Added post type selection and admin exclusion.

= 1.1 =
Added settings page and basic features.

= 1.0 =
Initial release.
