Changeset 3265158
- Timestamp:
- 04/01/2025 01:06:29 PM (10 months ago)
- Location:
- image-protection
- Files:
-
- 6 added
- 5 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/CHANGELOG.md (added)
-
tags/1.0.1/README.md (added)
-
tags/1.0.1/image-protection.php (added)
-
tags/1.0.1/protection.js (added)
-
tags/1.0.1/readme.txt (added)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.md (modified) (2 diffs)
-
trunk/image-protection.php (modified) (2 diffs)
-
trunk/protection.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
image-protection/trunk/CHANGELOG.md
r3260696 r3265158 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 9 ## [1.0.1] - 2025-04-01 10 11 ### Added 12 - Added support for forcing protection on specific images or elements (like canvas) 7 13 8 14 ## [1.0.0] - 2025-03-13 -
image-protection/trunk/README.md
r3260696 r3265158 5 5 **Requires at least:** 5.0 6 6 **Tested up to:** 6.7 7 **Stable tag:** 1.0. 07 **Stable tag:** 1.0.1 8 8 **Requires PHP:** 7.4 9 9 **License:** GPLv2 or later … … 62 62 ``` 63 63 64 ### Can I force protection on specific images or elements (like canvas)? 65 Yes, you can force protection on specific images or elements in two ways: 66 1. Add the class `force-image-protection` to the image: 67 ```html 68 <img src="image.jpg" class="force-image-protection"> 69 ``` 70 2. Add the data attribute `data-image-protection="true"`: 71 ```html 72 <img src="image.jpg" data-image-protection="true"> 73 ``` 74 This will ensure the image or element is protected even if it would normally be excluded (like SVG images). 75 64 76 ### How can I uninstall the plugin? 65 77 To uninstall, go to the Plugins page in your WordPress admin, find the Image Protection plugin, and click "Deactivate." You can then delete it if desired. 78 -
image-protection/trunk/image-protection.php
r3260696 r3265158 4 4 * Plugin URI: https://wordpress.org/plugins/image-protection 5 5 * Description: Protects images from being copied, saved, or screenshot. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 24 24 * Define plugin constants. 25 25 */ 26 define( 'IMAGE_PROTECTION_VERSION', '1.0. 0' );26 define( 'IMAGE_PROTECTION_VERSION', '1.0.1' ); 27 27 define( 'IMAGE_PROTECTION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 28 28 define( 'IMAGE_PROTECTION_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
image-protection/trunk/protection.js
r3260696 r3265158 68 68 69 69 getImages() { 70 // Get all images except SVGs 70 71 const images = document.querySelectorAll("img:not([src$='.svg'])"); 71 72 this.bgImages = Array.from(document.querySelectorAll('*')).filter(element => { … … 74 75 }); 75 76 77 // Combine and filter images 76 78 const allImages = [...images, ...this.bgImages]; 77 79 this.filteredImages = allImages.filter((img) => { 78 80 return !img.classList.contains('no-image-protection') && img.getAttribute('data-image-protection') !== 'false'; 79 81 }); 82 83 // Add elements with data-image-protection="true" or class 'force-image-protection' 84 const forcedProtectionElements = document.querySelectorAll('[data-image-protection="true"], .force-image-protection'); 85 this.filteredImages = [...this.filteredImages, ...forcedProtectionElements]; 80 86 } 81 87 -
image-protection/trunk/readme.txt
r3260696 r3265158 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 60 60 <img src="image.jpg" data-image-protection="false"> 61 61 ``` 62 You can also force protection on an image by using `data-image-protection="true"`, which will override any protection-disabling class. 62 63 = Can I force protection on specific images or elements (like canvas)? = 64 Yes, you can force protection on specific images or elements in two ways: 65 1. Add the class `force-image-protection` to the image: 66 ```html 67 <img src="image.jpg" class="force-image-protection"> 68 ``` 69 2. Add the data attribute `data-image-protection="true"`: 70 ```html 71 <img src="image.jpg" data-image-protection="true"> 72 ``` 73 This will ensure the image or element is protected even if it would normally be excluded (like SVG images). 63 74 64 75 = How can I uninstall the plugin? =
Note: See TracChangeset
for help on using the changeset viewer.