=== Xiaochen Content Copy Controls ===
Contributors: tsxcc
Donate link: https://www.kqwq.com/wordpress/plugins/1881.html
Tags: anti-copy, copy-protection, disable-right-click, f12, security
Requires at least: 4.7
Tested up to: 7.1
Requires PHP: 7.0
Stable tag: 1.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Disable right-click, F12 (DevTools) and copy on your site, with an optional custom copy reminder.

== Description ==

Xiaochen Content Copy Controls is a lightweight content-protection plugin that prevents visitors from copying your page content via right-click, F12 (DevTools) or the copy action.

= Main features =

* **Block F12 / DevTools**: blocks visitors who press F12 or open DevTools, with an optional custom redirect URL.
* **Block right-click (copy & select)**: disables the context menu, text selection and copying.
* **Copy reminder**: shows a custom reminder popup when visitors copy, with three popup styles (native alert, SweetAlert, layer).
* **Customizable reminder text**: set your own popup message. Default: "Successfully copied! Feel free to repost - your repost is my greatest recognition!"
* **Zero configuration**: works immediately after saving the settings; no external services are used.

= Important notes =

* "Block right-click" and "Copy reminder" are mutually exclusive - only one of them can be enabled at a time (the plugin handles this automatically on save).
* This plugin only stops ordinary users from copying. It cannot prevent advanced methods such as viewing page source or disabling JavaScript. Do not treat it as absolute content protection.

= Credits =

Xiaochen Content Copy Controls was originally created and is maintained by ts小陈 (www.kqwq.com). The DevTools blocker is based on the open-source ConsoleBan (console-ban v2.1.0, MIT License).

== Installation ==

= How to install =

1. Upload the plugin zip via "Plugins > Add New > Upload Plugin" in your WordPress admin, then activate it. Alternatively, extract the zip to the `wp-content/plugins/` directory and activate it from the "Plugins" menu.
2. After activation, find the "Right-click Settings" menu item in the admin sidebar and open the settings page.

= Settings guide =

1. **Block Modes**:
   * Enable "Block F12 / DevTools": blocks visitors who press F12 or open DevTools, with an optional redirect URL.
   * Enable "Block right-click (copy & select)": disables the context menu, text selection and copying.
2. **DevTools Redirect URL** (shown when F12 blocking is enabled): the URL visitors are redirected to when they open DevTools. Leave empty to disable the redirect.
3. **Copy reminder**: enable it to show a reminder popup when visitors copy.
4. **Popup Style**: choose one of three styles (Style 1: native alert; Style 2: SweetAlert; Style 3: layer).
5. **Copy Reminder Text**: customize the popup message.
6. Click "Save Settings" - everything takes effect on the front end immediately.

For more tutorials, visit the plugin homepage: https://www.kqwq.com/wordpress/plugins/1881.html

== Frequently Asked Questions ==

= Can "Block right-click" and "Copy reminder" be enabled at the same time? =

No. They are mutually exclusive because the copy reminder needs to listen to the copy event, while blocking right-click intercepts it. The plugin disables one of them automatically when you save.

= Why does the F12 redirect not happen in some browsers? =

The legacy DevTools detection relies on browser quirks that newer browsers (e.g. Chrome 93+) have patched. The plugin also hooks the keyboard directly, so pressing F12 / Ctrl+Shift+I(J,C) triggers the redirect immediately in modern browsers. Note that a web page cannot fully prevent the browser from opening DevTools.

= Does the plugin affect loading speed or SEO? =

Almost not. It only outputs a small inline script and one JS file (console-ban.js, about 3KB) on the front end, with no external CDN or remote requests.

= Is it compatible with mobile devices? =

Yes. Long-press selection and copying are also intercepted on mobile (depending on the enabled mode).

= Can administrators be exempted? =

The current version does not include a role-based exemption. The plugin only affects the front end for visitors and never interferes with admin actions.

== Screenshots ==

1. The plugin settings page (admin menu "Right-click Settings").
2. An example of the copy reminder popup.

== Changelog ==

= 1.6 =

* Plugin renamed to "Xiaochen Content Copy Controls" (slug: xiaochen-content-copy-controls) to make the name distinctive, per the plugin review guidelines.
* Text domain updated to xiaochen-content-copy-controls.
* Settings page scripts moved into an enqueued admin.js (wp_enqueue_script + wp_localize_script); no more inline <script> tags.

= 1.5 =

* All interface strings are now English source strings (required by WordPress.org); Chinese sites display Chinese automatically via the built-in Simplified Chinese language pack.
* Plugin renamed to "Xiaochen Content Copy Controls" with the slug xiaochen-content-copy-controls.
* Main file renamed to xiaochen-content-copy-controls.php (settings page renamed accordingly).
* Fixed the plugin description translation on the plugins list page for Chinese sites.
* Settings page upgraded to "Settings / Help" tabs with a flat colorful design (custom styles, layui removed).
* F12 blocking now uses reliable keyboard-level interception with an optional redirect; the DevTools redirect URL is shown as a matched setting when F12 blocking is enabled.
* The mutual-exclusion notice now uses a custom toast instead of the native alert.

= 1.4 =

* Removed the external plugin update checker (plugin-updates); updates now come from the official WordPress.org repository.
* Removed the obfuscated tracking code (my-tracker.php).
* Added full i18n support with a bundled Simplified Chinese language pack (languages/).
* Hardened the admin area: nonce checks, input sanitization and escaping, manage_options capability.
* Removed external CDN (BootCDN) jQuery and remote ad scripts; the bundled WordPress jQuery is used instead.
* Added a "Usage Help" panel and an admin Help tab to the settings page.
* The version shown on the settings page is now read from the plugin header.

= 1.3 =

* Added copy reminder styles 2 (SweetAlert) and 3 (layer) with customizable reminder text.
* Fixed the mutual-exclusion logic between the copy reminder and right-click blocking.

== Upgrade Notice ==

= 1.6 =

1.6 renames the plugin to "Xiaochen Content Copy Controls" (new slug xiaochen-content-copy-controls) and moves the settings page scripts into an enqueued file. Please deactivate and reactivate the plugin once after updating.

= 1.5 =

1.5 converts the interface strings to English (per WordPress.org requirements) with a built-in Simplified Chinese translation, and renames the main plugin file. After updating, please deactivate and reactivate the plugin once.

= 1.4 =

1.4 removes the external update checker and the tracking code, and adds i18n and security hardening. Please update.
