Changeset 3340527
- Timestamp:
- 08/06/2025 05:19:09 PM (8 months ago)
- Location:
- imsanity
- Files:
-
- 14 edited
- 1 copied
-
tags/2.8.7 (copied) (copied from imsanity/trunk)
-
tags/2.8.7/.travis.yml (modified) (1 diff)
-
tags/2.8.7/ajax.php (modified) (4 diffs)
-
tags/2.8.7/changelog.txt (modified) (3 diffs)
-
tags/2.8.7/imsanity.php (modified) (2 diffs)
-
tags/2.8.7/media.php (modified) (2 diffs)
-
tags/2.8.7/phpcs.ruleset.xml (modified) (1 diff)
-
tags/2.8.7/readme.txt (modified) (2 diffs)
-
trunk/.travis.yml (modified) (1 diff)
-
trunk/ajax.php (modified) (4 diffs)
-
trunk/changelog.txt (modified) (3 diffs)
-
trunk/imsanity.php (modified) (2 diffs)
-
trunk/media.php (modified) (2 diffs)
-
trunk/phpcs.ruleset.xml (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
imsanity/tags/2.8.7/.travis.yml
r3076045 r3340527 16 16 php: 17 17 - 7.4 18 - 8. 218 - 8.3 19 19 20 20 env: -
imsanity/tags/2.8.7/ajax.php
r3186675 r3340527 13 13 /** 14 14 * Searches for up to 250 images that are candidates for resize and renders them 15 * to the browser as a json array, then dies 15 * to the browser as a json array, then dies. 16 16 */ 17 17 function imsanity_get_images() { 18 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 18 $permissions = apply_filters( 'imsanity_admin_permissions', 'manage_options' ); 19 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 19 20 wp_send_json( 20 21 array( … … 43 44 /** 44 45 * Resizes the image with the given id according to the configured max width and height settings 45 * renders a json response indicating success/failure and dies 46 * renders a json response indicating success/failure and dies. 46 47 */ 47 48 function imsanity_ajax_resize() { 48 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 49 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 50 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 49 51 wp_send_json( 50 52 array( 51 53 'success' => false, 52 'message' => esc_html__( ' Administrator permission is required', 'imsanity' ),54 'message' => esc_html__( 'Editor permission is required', 'imsanity' ), 53 55 ) 54 56 ); … … 82 84 83 85 /** 84 * Resizes the image with the given id according to the configured max width and height settings 85 * renders a json response indicating success/failure and dies 86 * Removes the original image with the given id and renders a json response indicating success/failure and dies. 86 87 */ 87 88 function imsanity_ajax_remove_original() { 88 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 89 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 90 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 89 91 wp_send_json( 90 92 array( 91 93 'success' => false, 92 'message' => esc_html__( ' Administrator permission is required', 'imsanity' ),94 'message' => esc_html__( 'Editor permission is required', 'imsanity' ), 93 95 ) 94 96 ); … … 125 127 */ 126 128 function imsanity_ajax_finish() { 127 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 129 $permissions = apply_filters( 'imsanity_admin_permissions', 'manage_options' ); 130 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 128 131 wp_send_json( 129 132 array( -
imsanity/tags/2.8.7/changelog.txt
r3197618 r3340527 1 = 2.8.7 = 2 *Release Date = August 6, 2024* 3 4 * added: change default permissions via imsanity_editor_permissions and imsanity_admin_permissions filters 5 * changed: default permission to resize individual images changed to editor role 6 1 7 = 2.8.6 = 2 8 *Release Date - November 26, 2024* … … 5 11 6 12 = 2.8.5 = 13 *Release Date – November 26, 2024* 14 7 15 * bumped WP tested version 8 16 * changed: improve JSON handling/efficiency 9 17 10 18 = 2.8.4 = 19 *Release Date – April 29, 2024* 20 11 21 * bumped WP tested version and PHP minimum 12 22 13 23 = 2.8.3 = 24 *Release Date – April 23, 2024* 25 14 26 * changed: use updated WP coding standards 15 27 * fixed: PHP 8 error trying to do math with string values 16 28 17 29 = 2.8.2 = 30 *Release Date – October 5, 2022* 31 18 32 * fixed: mime type error when filename in attachment metadata is incorrect 19 33 20 34 = 2.8.1 = 35 *Release Date – June 16, 2022* 36 21 37 * changed: escape and sanitize more things 22 38 * changed: tighten PHPCS rules used for pre-release testing 23 39 24 40 = 2.8.0 = 41 *Release Date – May 18, 2022* 42 25 43 * added: support for resizing WebP images via ImageMagick 26 44 * changed: update attachment file size to keep WP 6.0 metadata in sync … … 29 47 30 48 = 2.7.2 = 49 *Release Date – June 3, 2021* 50 31 51 * fixed: delete originals might remove full-size version in rare cases 32 52 * fixed: error thrown for image that is 1 pixel larger than max dimensions 33 53 34 54 = 2.7.1 = 55 *Release Date – November 24, 2020* 56 35 57 * changed: clarify text for queue reset button 36 58 * changed: Delete Originals function in bulk/selective resizer will clean metadata if original image is already gone 37 59 38 60 = 2.7.0 = 61 *Release Date – November 18, 2020* 62 39 63 * changed: bulk resizer will resize all images with no limits, use list mode for selective resizing 40 64 * added: see current dimensions and resize individual images in Media Library list mode -
imsanity/tags/2.8.7/imsanity.php
r3197618 r3340527 15 15 Author: Exactly WWW 16 16 Domain Path: /languages 17 Version: 2.8. 618 Requires at least: 6. 417 Version: 2.8.7 18 Requires at least: 6.5 19 19 Requires PHP: 7.4 20 20 Author URI: https://ewww.io/about/ … … 26 26 } 27 27 28 define( 'IMSANITY_VERSION', '2.8. 6' );28 define( 'IMSANITY_VERSION', '2.8.7' ); 29 29 define( 'IMSANITY_SCHEMA_VERSION', '1.1' ); 30 30 -
imsanity/tags/2.8.7/media.php
r2743190 r3340527 97 97 echo '<div>' . (int) $imagew . 'w x ' . (int) $imageh . 'h</div>'; 98 98 99 $maxw = imsanity_get_option( 'imsanity_max_width', IMSANITY_DEFAULT_MAX_WIDTH ); 100 $maxh = imsanity_get_option( 'imsanity_max_height', IMSANITY_DEFAULT_MAX_HEIGHT ); 99 $maxw = imsanity_get_option( 'imsanity_max_width', IMSANITY_DEFAULT_MAX_WIDTH ); 100 $maxh = imsanity_get_option( 'imsanity_max_height', IMSANITY_DEFAULT_MAX_HEIGHT ); 101 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 101 102 if ( $imagew > $maxw || $imageh > $maxh ) { 102 if ( current_user_can( 'activate_plugins') ) {103 if ( current_user_can( $permissions ) ) { 103 104 $manual_nonce = wp_create_nonce( 'imsanity-manual-resize' ); 104 105 // Give the user the option to optimize the image right now. … … 110 111 ); 111 112 } 112 } elseif ( current_user_can( 'activate_plugins') && imsanity_get_option( 'imsanity_delete_originals', false ) && ! empty( $meta['original_image'] ) && function_exists( 'wp_get_original_image_path' ) ) {113 } elseif ( current_user_can( $permissions ) && imsanity_get_option( 'imsanity_delete_originals', false ) && ! empty( $meta['original_image'] ) && function_exists( 'wp_get_original_image_path' ) ) { 113 114 $original_image = wp_get_original_image_path( $id ); 114 115 if ( empty( $original_image ) || ! is_file( $original_image ) ) { -
imsanity/tags/2.8.7/phpcs.ruleset.xml
r3076045 r3340527 10 10 <rule ref="WordPress.PHP.NoSilencedErrors"> 11 11 <properties> 12 <property name="customAllowedFunctionsList" type="array" value="exif_read_data"/> 12 <property name="customAllowedFunctionsList" type="array"> 13 <element value="exif_read_data"/> 14 </property> 13 15 </properties> 14 16 </rule> -
imsanity/tags/2.8.7/readme.txt
r3197618 r3340527 3 3 Donate link: https://ewww.io/donate/ 4 4 Tags: image, scale, resize, space saver, quality 5 Requires at least: 6.4 6 Tested up to: 6.7 7 Requires PHP: 7.4 8 Stable tag: 2.8.6 5 Tested up to: 6.8 6 Stable tag: 2.8.7 9 7 License: GPLv3 10 8 … … 109 107 == Changelog == 110 108 109 = 2.8.7 = 110 *Release Date = August 6, 2024* 111 112 * added: change default permissions via imsanity_editor_permissions and imsanity_admin_permissions filters 113 * changed: default permission to resize individual images changed to editor role 114 111 115 = 2.8.6 = 112 116 *Release Date - November 26, 2024* -
imsanity/trunk/.travis.yml
r3076045 r3340527 16 16 php: 17 17 - 7.4 18 - 8. 218 - 8.3 19 19 20 20 env: -
imsanity/trunk/ajax.php
r3186675 r3340527 13 13 /** 14 14 * Searches for up to 250 images that are candidates for resize and renders them 15 * to the browser as a json array, then dies 15 * to the browser as a json array, then dies. 16 16 */ 17 17 function imsanity_get_images() { 18 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 18 $permissions = apply_filters( 'imsanity_admin_permissions', 'manage_options' ); 19 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 19 20 wp_send_json( 20 21 array( … … 43 44 /** 44 45 * Resizes the image with the given id according to the configured max width and height settings 45 * renders a json response indicating success/failure and dies 46 * renders a json response indicating success/failure and dies. 46 47 */ 47 48 function imsanity_ajax_resize() { 48 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 49 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 50 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 49 51 wp_send_json( 50 52 array( 51 53 'success' => false, 52 'message' => esc_html__( ' Administrator permission is required', 'imsanity' ),54 'message' => esc_html__( 'Editor permission is required', 'imsanity' ), 53 55 ) 54 56 ); … … 82 84 83 85 /** 84 * Resizes the image with the given id according to the configured max width and height settings 85 * renders a json response indicating success/failure and dies 86 * Removes the original image with the given id and renders a json response indicating success/failure and dies. 86 87 */ 87 88 function imsanity_ajax_remove_original() { 88 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 89 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 90 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 89 91 wp_send_json( 90 92 array( 91 93 'success' => false, 92 'message' => esc_html__( ' Administrator permission is required', 'imsanity' ),94 'message' => esc_html__( 'Editor permission is required', 'imsanity' ), 93 95 ) 94 96 ); … … 125 127 */ 126 128 function imsanity_ajax_finish() { 127 if ( ! current_user_can( 'activate_plugins' ) || empty( $_REQUEST['_wpnonce'] ) ) { 129 $permissions = apply_filters( 'imsanity_admin_permissions', 'manage_options' ); 130 if ( ! current_user_can( $permissions ) || empty( $_REQUEST['_wpnonce'] ) ) { 128 131 wp_send_json( 129 132 array( -
imsanity/trunk/changelog.txt
r3197618 r3340527 1 = 2.8.7 = 2 *Release Date = August 6, 2024* 3 4 * added: change default permissions via imsanity_editor_permissions and imsanity_admin_permissions filters 5 * changed: default permission to resize individual images changed to editor role 6 1 7 = 2.8.6 = 2 8 *Release Date - November 26, 2024* … … 5 11 6 12 = 2.8.5 = 13 *Release Date – November 26, 2024* 14 7 15 * bumped WP tested version 8 16 * changed: improve JSON handling/efficiency 9 17 10 18 = 2.8.4 = 19 *Release Date – April 29, 2024* 20 11 21 * bumped WP tested version and PHP minimum 12 22 13 23 = 2.8.3 = 24 *Release Date – April 23, 2024* 25 14 26 * changed: use updated WP coding standards 15 27 * fixed: PHP 8 error trying to do math with string values 16 28 17 29 = 2.8.2 = 30 *Release Date – October 5, 2022* 31 18 32 * fixed: mime type error when filename in attachment metadata is incorrect 19 33 20 34 = 2.8.1 = 35 *Release Date – June 16, 2022* 36 21 37 * changed: escape and sanitize more things 22 38 * changed: tighten PHPCS rules used for pre-release testing 23 39 24 40 = 2.8.0 = 41 *Release Date – May 18, 2022* 42 25 43 * added: support for resizing WebP images via ImageMagick 26 44 * changed: update attachment file size to keep WP 6.0 metadata in sync … … 29 47 30 48 = 2.7.2 = 49 *Release Date – June 3, 2021* 50 31 51 * fixed: delete originals might remove full-size version in rare cases 32 52 * fixed: error thrown for image that is 1 pixel larger than max dimensions 33 53 34 54 = 2.7.1 = 55 *Release Date – November 24, 2020* 56 35 57 * changed: clarify text for queue reset button 36 58 * changed: Delete Originals function in bulk/selective resizer will clean metadata if original image is already gone 37 59 38 60 = 2.7.0 = 61 *Release Date – November 18, 2020* 62 39 63 * changed: bulk resizer will resize all images with no limits, use list mode for selective resizing 40 64 * added: see current dimensions and resize individual images in Media Library list mode -
imsanity/trunk/imsanity.php
r3197618 r3340527 15 15 Author: Exactly WWW 16 16 Domain Path: /languages 17 Version: 2.8. 618 Requires at least: 6. 417 Version: 2.8.7 18 Requires at least: 6.5 19 19 Requires PHP: 7.4 20 20 Author URI: https://ewww.io/about/ … … 26 26 } 27 27 28 define( 'IMSANITY_VERSION', '2.8. 6' );28 define( 'IMSANITY_VERSION', '2.8.7' ); 29 29 define( 'IMSANITY_SCHEMA_VERSION', '1.1' ); 30 30 -
imsanity/trunk/media.php
r2743190 r3340527 97 97 echo '<div>' . (int) $imagew . 'w x ' . (int) $imageh . 'h</div>'; 98 98 99 $maxw = imsanity_get_option( 'imsanity_max_width', IMSANITY_DEFAULT_MAX_WIDTH ); 100 $maxh = imsanity_get_option( 'imsanity_max_height', IMSANITY_DEFAULT_MAX_HEIGHT ); 99 $maxw = imsanity_get_option( 'imsanity_max_width', IMSANITY_DEFAULT_MAX_WIDTH ); 100 $maxh = imsanity_get_option( 'imsanity_max_height', IMSANITY_DEFAULT_MAX_HEIGHT ); 101 $permissions = apply_filters( 'imsanity_editor_permissions', 'edit_others_posts' ); 101 102 if ( $imagew > $maxw || $imageh > $maxh ) { 102 if ( current_user_can( 'activate_plugins') ) {103 if ( current_user_can( $permissions ) ) { 103 104 $manual_nonce = wp_create_nonce( 'imsanity-manual-resize' ); 104 105 // Give the user the option to optimize the image right now. … … 110 111 ); 111 112 } 112 } elseif ( current_user_can( 'activate_plugins') && imsanity_get_option( 'imsanity_delete_originals', false ) && ! empty( $meta['original_image'] ) && function_exists( 'wp_get_original_image_path' ) ) {113 } elseif ( current_user_can( $permissions ) && imsanity_get_option( 'imsanity_delete_originals', false ) && ! empty( $meta['original_image'] ) && function_exists( 'wp_get_original_image_path' ) ) { 113 114 $original_image = wp_get_original_image_path( $id ); 114 115 if ( empty( $original_image ) || ! is_file( $original_image ) ) { -
imsanity/trunk/phpcs.ruleset.xml
r3076045 r3340527 10 10 <rule ref="WordPress.PHP.NoSilencedErrors"> 11 11 <properties> 12 <property name="customAllowedFunctionsList" type="array" value="exif_read_data"/> 12 <property name="customAllowedFunctionsList" type="array"> 13 <element value="exif_read_data"/> 14 </property> 13 15 </properties> 14 16 </rule> -
imsanity/trunk/readme.txt
r3197618 r3340527 3 3 Donate link: https://ewww.io/donate/ 4 4 Tags: image, scale, resize, space saver, quality 5 Requires at least: 6.4 6 Tested up to: 6.7 7 Requires PHP: 7.4 8 Stable tag: 2.8.6 5 Tested up to: 6.8 6 Stable tag: 2.8.7 9 7 License: GPLv3 10 8 … … 109 107 == Changelog == 110 108 109 = 2.8.7 = 110 *Release Date = August 6, 2024* 111 112 * added: change default permissions via imsanity_editor_permissions and imsanity_admin_permissions filters 113 * changed: default permission to resize individual images changed to editor role 114 111 115 = 2.8.6 = 112 116 *Release Date - November 26, 2024*
Note: See TracChangeset
for help on using the changeset viewer.