=== Advanced Content Copy ===
Contributors: theavcoach
Tags: copy, content, attribution, clipboard, text
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Modifies copied content with customizable text, link, and snippet options when pasted elsewhere.

== Description ==

Advanced Content Copy is a WordPress plugin that automatically modifies content when users copy text from your website. It adds customizable attribution text and links to help protect your content and drive traffic back to your site. The plugin intelligently detects the page type (single posts, categories, archives, etc.) and provides the appropriate URL for attribution.

**Key Features:**

* **Customizable Attribution**: Add your own prefix and suffix text to copied content
* **Snippet Length Control**: Limit the amount of text that gets copied with customizable character limits
* **Domain Attribution**: Automatically include your site name or custom domain text
* **Page Exclusion**: Exclude specific pages or posts from copy modification
* **Minimum Character Threshold**: Only modify copies that meet a minimum character count
* **Ignore Code Blocks**: Optionally leave `<pre>` and `<code>` content untouched so code snippets and scripts can be copied exactly as written, with no attribution text appended
* **Clean Implementation**: Uses WordPress best practices with proper enqueue functions
* **Smart URL Detection**: Automatically detects page types and provides correct attribution URLs for posts, categories, archives, and more

**How It Works:**

When a user selects and copies text from your website, the plugin automatically:
1. Checks if the copied text meets the minimum character requirement
2. Truncates the text if it exceeds the snippet length limit
3. Adds your custom attribution text and site URL
4. Places the modified content in the user's clipboard

**Example Output:**
```
Original copied text: "This is a long article about WordPress development..."
Modified clipboard content: "This is a long article about WordPress development... (This excerpt was copied from My Website; learn more at: https://mysite.com/post-url)"
```

== Installation ==

1. Upload the `advanced-content-copy` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings > Advanced Copy to configure your preferences

== Frequently Asked Questions ==

= Does this work on all browsers? =

Yes, this plugin uses standard clipboard APIs that are supported by all modern browsers.

= Can I exclude certain pages from copy modification? =

Yes, you can exclude specific pages by entering their page IDs or slugs in the "Exclude Pages" setting, separated by commas.

= Will this affect my site's performance? =

No, the plugin only loads JavaScript when needed and uses WordPress's proper enqueue functions to ensure optimal performance.

= Can I customize the attribution text? =

Yes, you can customize both the prefix and suffix text in the plugin settings.

= Can visitors still copy my code snippets exactly? =

Yes. Enable the "Ignore Code Blocks" setting and any text selected from inside a `<pre>` or `<code>` element will be copied exactly as-is, with no snippet truncation or attribution text added. This is ideal for technical blogs that include code samples readers need to copy and paste precisely. Developers can further customize which elements are exempted using the `advacoco_bypass_selectors` filter.

== Screenshots ==

1. Plugin settings page with all configuration options
2. Example of content being copied
3. Example of copied content pasted with attribution automatically added

== Changelog ==

= 1.2 =
* Added "Ignore Code Blocks" setting to exempt `<pre>` and `<code>` elements from copy modification
* Code and script blocks can now be copied exactly as written, without truncation or attribution text
* Added `advacoco_bypass_selectors` filter for developers to customize which elements are exempted

= 1.1 =
* Fixed URL attribution on category and archive pages
* Added intelligent page type detection
* Now correctly attributes copied content to category/archive URLs instead of first post URLs
* Improved URL detection for tags, authors, date archives, and custom taxonomies

= 1.0 =
* Initial release
* Customizable copy modification
* Page exclusion functionality
* WordPress best practices implementation

== Upgrade Notice ==

= 1.2 =
Adds an "Ignore Code Blocks" setting so code and script snippets in `<pre>`/`<code>` elements can be copied exactly, unmodified. Recommended for technical/developer-focused websites.

= 1.1 =
Important update that fixes URL attribution on category and archive pages. Recommended for all users.

= 1.0 =
Initial release of Advanced Content Copy plugin. 