Changeset 3286295
- Timestamp:
- 05/02/2025 01:38:02 PM (11 months ago)
- Location:
- image-protection
- Files:
-
- 6 added
- 5 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/CHANGELOG.md (added)
-
tags/1.0.2/README.md (added)
-
tags/1.0.2/image-protection.php (added)
-
tags/1.0.2/protection.js (added)
-
tags/1.0.2/readme.txt (added)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.md (modified) (1 diff)
-
trunk/image-protection.php (modified) (4 diffs)
-
trunk/protection.js (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
image-protection/trunk/CHANGELOG.md
r3265158 r3286295 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 7 8 ## [1.0.2] - 2025-05-02 9 10 ### Added 11 - Added settings page under Settings menu 12 - Added option to disable image protection for admin users 8 13 9 14 ## [1.0.1] - 2025-04-01 -
image-protection/trunk/README.md
r3265158 r3286295 4 4 **Tags:** image, protection, security 5 5 **Requires at least:** 5.0 6 **Tested up to:** 6. 77 **Stable tag:** 1.0. 16 **Tested up to:** 6.8 7 **Stable tag:** 1.0.2 8 8 **Requires PHP:** 7.4 9 9 **License:** GPLv2 or later -
image-protection/trunk/image-protection.php
r3265158 r3286295 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. 16 * Version: 1.0.2 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. 1' );26 define( 'IMAGE_PROTECTION_VERSION', '1.0.2' ); 27 27 define( 'IMAGE_PROTECTION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 28 28 define( 'IMAGE_PROTECTION_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 29 30 /** 31 * Register plugin settings. 32 * 33 * @return void 34 */ 35 function image_protection_register_settings() { 36 register_setting( 37 'image_protection_options', 38 'image_protection_disable_for_admin', 39 array( 40 'type' => 'boolean', 41 'default' => false, 42 ) 43 ); 44 } 45 add_action( 'admin_init', 'image_protection_register_settings' ); 46 47 /** 48 * Add settings page to the admin menu. 49 * 50 * @return void 51 */ 52 function image_protection_add_settings_page() { 53 add_options_page( 54 __( 'Image Protection Settings', 'image-protection' ), 55 __( 'Image Protection', 'image-protection' ), 56 'manage_options', 57 'image-protection', 58 'image_protection_settings_page' 59 ); 60 } 61 add_action( 'admin_menu', 'image_protection_add_settings_page' ); 62 63 /** 64 * Render the settings page. 65 * 66 * @return void 67 */ 68 function image_protection_settings_page() { 69 ?> 70 <div class="wrap"> 71 <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> 72 <form method="post" action="options.php"> 73 <?php 74 settings_fields( 'image_protection_options' ); 75 do_settings_sections( 'image-protection' ); 76 ?> 77 <table class="form-table"> 78 <tr valign="top"> 79 <th scope="row"><?php esc_html_e( 'Disable for admin users', 'image-protection' ); ?></th> 80 <td> 81 <label for="image_protection_disable_for_admin"> 82 <input type="checkbox" id="image_protection_disable_for_admin" name="image_protection_disable_for_admin" value="1" <?php checked( get_option( 'image_protection_disable_for_admin' ), 1 ); ?> /> 83 <?php esc_html_e( 'Disable image protection for logged-in admin users', 'image-protection' ); ?> 84 </label> 85 <p class="description"><?php esc_html_e( 'When enabled, administrators will not see the image protection effects.', 'image-protection' ); ?></p> 86 </td> 87 </tr> 88 </table> 89 <?php submit_button(); ?> 90 </form> 91 </div> 92 <?php 93 } 29 94 30 95 /** … … 34 99 */ 35 100 function image_protection_enqueue_scripts() { 36 wp_enqueue_script( 37 'image-protection', 38 IMAGE_PROTECTION_PLUGIN_URL . 'protection.js', 39 array(), 40 IMAGE_PROTECTION_VERSION, 41 true 42 ); 101 // Skip loading the script for admin users if the option is enabled 102 if ( get_option( 'image_protection_disable_for_admin' ) && current_user_can( 'manage_options' ) ) { 103 return; 104 } 105 106 wp_enqueue_script( 107 'image-protection', 108 IMAGE_PROTECTION_PLUGIN_URL . 'protection.js', 109 array(), 110 IMAGE_PROTECTION_VERSION, 111 true 112 ); 43 113 } 44 114 add_action( 'wp_enqueue_scripts', 'image_protection_enqueue_scripts' ); … … 57 127 } 58 128 add_action( 'plugins_loaded', 'image_protection_load_textdomain' ); 129 -
image-protection/trunk/protection.js
r3265158 r3286295 160 160 e.key === "4" 161 161 ) { 162 setTimeout(() => this.unblurImages(), 1000);162 setTimeout(() => this.unblurImages(), 2000); 163 163 } 164 164 } -
image-protection/trunk/readme.txt
r3265158 r3286295 3 3 Tags: image, protection, security 4 4 Requires at least: 5.0 5 Tested up to: 6. 76 Stable tag: 1.0. 15 Tested up to: 6.8 6 Stable tag: 1.0.2 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.