Plugin Directory

Changeset 3404954


Ignore:
Timestamp:
11/28/2025 09:13:35 AM (4 months ago)
Author:
twkmedia
Message:

### Added

  • Option to control the amount of blur applied to images.
  • Uninstall cleanup to remove plugin options.
Location:
image-protection
Files:
8 added
5 edited

Legend:

Unmodified
Added
Removed
  • image-protection/trunk/CHANGELOG.md

    r3307138 r3404954  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## [1.0.7] - 2025-11-28
     9
     10### Added
     11- Option to control the amount of blur applied to images.
     12- Uninstall cleanup to remove plugin options.
     13
    714
    815## [1.0.6] - 2025-06-05
  • image-protection/trunk/README.md

    r3307138 r3404954  
    55**Requires at least:** 5.0 
    66**Tested up to:** 6.8
    7 **Stable tag:** 1.0.6
     7**Stable tag:** 1.0.7
    88**Requires PHP:** 7.4 
    99**License:** GPLv2 or later 
     
    7676### How can I uninstall the plugin?
    7777To 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

    r3307138 r3404954  
    44 * Plugin URI: https://wordpress.org/plugins/image-protection
    55 * Description: Protects images from being copied, saved, or screenshot.
    6  * Version: 1.0.6
     6 * Version: 1.0.7
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
     
    2424 * Define plugin constants.
    2525 */
    26 define( 'IMAGE_PROTECTION_VERSION', '1.0.6' );
     26define( 'IMAGE_PROTECTION_VERSION', '1.0.7' );
    2727define( 'IMAGE_PROTECTION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2828define( 'IMAGE_PROTECTION_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     
    5959            'type'    => 'boolean',
    6060            'default' => true,
     61        )
     62    );
     63
     64    register_setting(
     65        'image_protection_options',
     66        'image_protection_blur_amount',
     67        array(
     68            'type'              => 'integer',
     69            'default'           => 10,
     70            'sanitize_callback' => 'absint',
    6171        )
    6272    );
     
    8898    // Set default message if not already set
    8999    if ( get_option( 'image_protection_message' ) === false ) {
    90         update_option( 'image_protection_message', __('Image protected', 'image-protection') );
     100        update_option( 'image_protection_message', __('Images protected', 'image-protection') );
    91101    }
    92102    ?>
     
    126136                    </td>
    127137                </tr>
     138                <tr valign="top">
     139                    <th scope="row"><?php esc_html_e( 'Blur amount (px)', 'image-protection' ); ?></th>
     140                    <td>
     141                        <input type="number" id="image_protection_blur_amount" name="image_protection_blur_amount" value="<?php echo esc_attr( get_option( 'image_protection_blur_amount', 10 ) ); ?>" class="small-text" min="0" step="1" />
     142                        <p class="description"><?php esc_html_e( 'The amount of blur to apply to images (in pixels). Default is 10.', 'image-protection' ); ?></p>
     143                    </td>
     144                </tr>
    128145            </table>
    129146            <?php submit_button(); ?>
     
    155172    $message = get_option( 'image_protection_message', __('Image protected', 'image-protection') );
    156173    $show_credit = get_option( 'image_protection_show_credit', true );
     174    $blur_amount = get_option( 'image_protection_blur_amount', 10 );
    157175   
    158176    wp_localize_script(
     
    162180            'message' => esc_js( $message ),
    163181            'showCredit' => (bool) $show_credit,
     182            'blurAmount' => absint( $blur_amount ),
    164183        )
    165184    );
  • image-protection/trunk/protection.js

    r3307138 r3404954  
    1010            this.message = typeof imageProtectionVars !== 'undefined' && imageProtectionVars.message ? imageProtectionVars.message : '';
    1111            this.showCredit = typeof imageProtectionVars !== 'undefined' && imageProtectionVars.showCredit;
     12            this.blurAmount = typeof imageProtectionVars !== 'undefined' && imageProtectionVars.blurAmount ? parseInt(imageProtectionVars.blurAmount) : 10;
    1213            this.messageHovered = false;
    1314            this.init();
     
    240241            this.filteredImages.forEach(img => {
    241242                img.style.transition = "none";
    242                 img.style.filter = 'blur(10px)';
     243                img.style.filter = `blur(${this.blurAmount}px)`;
    243244               
    244245                // Display message if available
  • image-protection/trunk/readme.txt

    r3307138 r3404954  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.0.6
     6Stable tag: 1.0.7
    77Requires PHP: 7.4
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.