Plugin Directory

Changeset 3463651


Ignore:
Timestamp:
02/17/2026 03:52:41 PM (6 weeks ago)
Author:
nosilver4u
Message:

tagging and releasing 2.3.0

Location:
force-regenerate-thumbnails
Files:
2 added
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • force-regenerate-thumbnails/tags/2.3.0/changelog.txt

    r3305989 r3463651  
     1= 2.3.0 =
     2*Release Date - February 17, 2026*
     3
     4* added: WP_CLI command: force-regenerate-thumbnails props @realmranshuman
     5* fixed: PHP 8.5 compatibility
     6
    17= 2.2.2 =
    28*Release Date - June 3, 2025*
  • force-regenerate-thumbnails/tags/2.3.0/class-forceregeneratethumbnails.php

    r3305989 r3463651  
    151151                    array_walk( $images, 'intval' );
    152152                }
    153                 $ids = implode( ',', $images );
    154153                delete_option( 'frt_last_regenerated' );
    155154            } else {
    156 
    157155                $resume_position = get_option( 'frt_last_regenerated' );
    158156                if ( empty( $resume_position ) ) {
     
    184182                    return;
    185183                }
    186 
    187                 $ids = implode( ',', $images );
    188184            }
    189185
     
    285281                    array(
    286282                        'page'   => 'force-regenerate-thumbnails',
    287                         'goback' => add_query_arg( null, null ),
     283                        'goback' => add_query_arg( '', '' ),
    288284                        'ids'    => (int) $post->ID,
    289285                    ),
     
    620616            $image = get_post( $id );
    621617
    622             if ( is_null( $image ) ) {
    623                 /* translators: %d: attachment ID number */
    624                 throw new Exception( sprintf( esc_html__( 'Failed: %d is an invalid media ID.', 'force-regenerate-thumbnails' ), (int) $id ) );
    625             }
    626 
    627             if ( 'attachment' !== $image->post_type || ( 'image/' !== substr( $image->post_mime_type, 0, 6 ) && 'application/pdf' !== $image->post_mime_type ) ) {
     618            if ( is_null( $image ) || 'attachment' !== $image->post_type || ( ! str_starts_with( $image->post_mime_type, 'image/' ) && 'application/pdf' !== $image->post_mime_type ) ) {
    628619                /* translators: %d: attachment ID number */
    629620                throw new Exception( sprintf( esc_html__( 'Failed: %d is an invalid media ID.', 'force-regenerate-thumbnails' ), (int) $id ) );
     
    698689            }
    699690
    700             // Hack to find thumbnail.
     691            // Workaround to find thumbnails not in metadata.
    701692            $file_stem = $this->remove_from_end( $file_info['filename'], '-scaled' ) . '-';
    702693
     
    707698                $thumb = readdir( $path );
    708699                while ( false !== $thumb ) {
    709                     if ( 0 === strpos( $thumb, $file_stem ) && str_ends_with( $thumb, $file_info['extension'] ) ) {
     700                    if ( str_starts_with( $thumb, $file_stem ) && str_ends_with( $thumb, $file_info['extension'] ) ) {
    710701                        $files[] = $thumb;
    711702                    }
     
    724715                $thumb_info  = pathinfo( $thumb_fullpath );
    725716                $valid_thumb = explode( $file_stem, $thumb_info['filename'] );
     717                // This ensures we only target files that start with the original filename, but are also longer than the original.
     718                // Otherwise, we might delete the original image, since the while() does not preclude the original.
    726719                if ( '' === $valid_thumb[0] && ! empty( $valid_thumb[1] ) ) {
     720                    // Further, if the thumbnail name appendage has 'scaled-' in it, we need to remove it for the dimension check coming up.
    727721                    if ( 0 === strpos( $valid_thumb[1], 'scaled-' ) ) {
    728722                        $valid_thumb[1] = str_replace( 'scaled-', '', $valid_thumb[1] );
     
    730724                    $dimension_thumb = explode( 'x', $valid_thumb[1] );
    731725                    if ( 2 === count( $dimension_thumb ) ) {
     726                        // Thus we only remove files with an appendage like '-150x150' or '-150x150-scaled'.
    732727                        if ( is_numeric( $dimension_thumb[0] ) && is_numeric( $dimension_thumb[1] ) ) {
    733728                            do_action( 'regenerate_thumbs_pre_delete', $thumb_fullpath );
     
    847842                '</strong>';
    848843            $message .= '<br><br>';
    849             // The Upload dir/URL are suppressed, just extra noise that we don't need.
    850             /* translators: %s: the path to the uploads directory */
    851             $old_message = '<code>' . sprintf( esc_html__( 'Upload Directory: %s', 'force-regenerate-thumbnails' ), esc_html( $upload_dir['basedir'] ) ) . '</code><br>';
    852             /* translators: %s: the base URL of the uploads directory */
    853             $old_message = '<code>' . sprintf( esc_html__( 'Upload URL: %s', 'force-regenerate-thumbnails' ), esc_html( $upload_dir['baseurl'] ) ) . '</code><br>';
    854844            /* translators: %s: the full path of the image */
    855845            $message .= '<code>' . sprintf( esc_html__( 'Image: %s', 'force-regenerate-thumbnails' ), esc_html( $debug_1 ) ) . '</code><br>';
  • force-regenerate-thumbnails/tags/2.3.0/force-regenerate-thumbnails.php

    r3305989 r3463651  
    1111Plugin URI: https://wordpress.org/plugins/force-regenerate-thumbnails/
    1212Description: Delete and REALLY force the regeneration of thumbnails.
    13 Version: 2.2.2
    14 Requires at least: 6.5
     13Version: 2.3.0
     14Requires at least: 6.6
    1515Requires PHP: 7.4
    1616Author: Exactly WWW
     
    7777}
    7878add_action( 'init', 'force_regenerate_thumbnails' );
     79
     80// Register WP-CLI command if WP_CLI is present.
     81if ( defined( 'WP_CLI' ) && WP_CLI ) {
     82    require_once trailingslashit( __DIR__ ) . 'class-force-regenerate-thumbnails-cli.php';
     83}
  • force-regenerate-thumbnails/tags/2.3.0/readme.txt

    r3305989 r3463651  
    11=== Force Regenerate Thumbnails ===
    22Contributors: pedro-elsner, nosilver4u
    3 Requires at least: 6.5
    4 Tested up to: 6.8
     3Requires at least: 6.6
     4Tested up to: 6.9
    55Requires PHP: 7.4
    6 Stable tag: 2.2.2
     6Stable tag: 2.3.0
    77License: GPLv2
    88Tags: force, regenerate thumbnails, thumbnail, thumbnails
     
    3434
    3535== ChangeLog ==
     36
     37= 2.3.0 =
     38*Release Date - February 17, 2026*
     39
     40* added: WP_CLI command: force-regenerate-thumbnails props @realmranshuman
     41* fixed: PHP 8.5 compatibility
    3642
    3743= 2.2.2 =
  • force-regenerate-thumbnails/trunk/changelog.txt

    r3305989 r3463651  
     1= 2.3.0 =
     2*Release Date - February 17, 2026*
     3
     4* added: WP_CLI command: force-regenerate-thumbnails props @realmranshuman
     5* fixed: PHP 8.5 compatibility
     6
    17= 2.2.2 =
    28*Release Date - June 3, 2025*
  • force-regenerate-thumbnails/trunk/class-forceregeneratethumbnails.php

    r3305989 r3463651  
    151151                    array_walk( $images, 'intval' );
    152152                }
    153                 $ids = implode( ',', $images );
    154153                delete_option( 'frt_last_regenerated' );
    155154            } else {
    156 
    157155                $resume_position = get_option( 'frt_last_regenerated' );
    158156                if ( empty( $resume_position ) ) {
     
    184182                    return;
    185183                }
    186 
    187                 $ids = implode( ',', $images );
    188184            }
    189185
     
    285281                    array(
    286282                        'page'   => 'force-regenerate-thumbnails',
    287                         'goback' => add_query_arg( null, null ),
     283                        'goback' => add_query_arg( '', '' ),
    288284                        'ids'    => (int) $post->ID,
    289285                    ),
     
    620616            $image = get_post( $id );
    621617
    622             if ( is_null( $image ) ) {
    623                 /* translators: %d: attachment ID number */
    624                 throw new Exception( sprintf( esc_html__( 'Failed: %d is an invalid media ID.', 'force-regenerate-thumbnails' ), (int) $id ) );
    625             }
    626 
    627             if ( 'attachment' !== $image->post_type || ( 'image/' !== substr( $image->post_mime_type, 0, 6 ) && 'application/pdf' !== $image->post_mime_type ) ) {
     618            if ( is_null( $image ) || 'attachment' !== $image->post_type || ( ! str_starts_with( $image->post_mime_type, 'image/' ) && 'application/pdf' !== $image->post_mime_type ) ) {
    628619                /* translators: %d: attachment ID number */
    629620                throw new Exception( sprintf( esc_html__( 'Failed: %d is an invalid media ID.', 'force-regenerate-thumbnails' ), (int) $id ) );
     
    698689            }
    699690
    700             // Hack to find thumbnail.
     691            // Workaround to find thumbnails not in metadata.
    701692            $file_stem = $this->remove_from_end( $file_info['filename'], '-scaled' ) . '-';
    702693
     
    707698                $thumb = readdir( $path );
    708699                while ( false !== $thumb ) {
    709                     if ( 0 === strpos( $thumb, $file_stem ) && str_ends_with( $thumb, $file_info['extension'] ) ) {
     700                    if ( str_starts_with( $thumb, $file_stem ) && str_ends_with( $thumb, $file_info['extension'] ) ) {
    710701                        $files[] = $thumb;
    711702                    }
     
    724715                $thumb_info  = pathinfo( $thumb_fullpath );
    725716                $valid_thumb = explode( $file_stem, $thumb_info['filename'] );
     717                // This ensures we only target files that start with the original filename, but are also longer than the original.
     718                // Otherwise, we might delete the original image, since the while() does not preclude the original.
    726719                if ( '' === $valid_thumb[0] && ! empty( $valid_thumb[1] ) ) {
     720                    // Further, if the thumbnail name appendage has 'scaled-' in it, we need to remove it for the dimension check coming up.
    727721                    if ( 0 === strpos( $valid_thumb[1], 'scaled-' ) ) {
    728722                        $valid_thumb[1] = str_replace( 'scaled-', '', $valid_thumb[1] );
     
    730724                    $dimension_thumb = explode( 'x', $valid_thumb[1] );
    731725                    if ( 2 === count( $dimension_thumb ) ) {
     726                        // Thus we only remove files with an appendage like '-150x150' or '-150x150-scaled'.
    732727                        if ( is_numeric( $dimension_thumb[0] ) && is_numeric( $dimension_thumb[1] ) ) {
    733728                            do_action( 'regenerate_thumbs_pre_delete', $thumb_fullpath );
     
    847842                '</strong>';
    848843            $message .= '<br><br>';
    849             // The Upload dir/URL are suppressed, just extra noise that we don't need.
    850             /* translators: %s: the path to the uploads directory */
    851             $old_message = '<code>' . sprintf( esc_html__( 'Upload Directory: %s', 'force-regenerate-thumbnails' ), esc_html( $upload_dir['basedir'] ) ) . '</code><br>';
    852             /* translators: %s: the base URL of the uploads directory */
    853             $old_message = '<code>' . sprintf( esc_html__( 'Upload URL: %s', 'force-regenerate-thumbnails' ), esc_html( $upload_dir['baseurl'] ) ) . '</code><br>';
    854844            /* translators: %s: the full path of the image */
    855845            $message .= '<code>' . sprintf( esc_html__( 'Image: %s', 'force-regenerate-thumbnails' ), esc_html( $debug_1 ) ) . '</code><br>';
  • force-regenerate-thumbnails/trunk/force-regenerate-thumbnails.php

    r3305989 r3463651  
    1111Plugin URI: https://wordpress.org/plugins/force-regenerate-thumbnails/
    1212Description: Delete and REALLY force the regeneration of thumbnails.
    13 Version: 2.2.2
    14 Requires at least: 6.5
     13Version: 2.3.0
     14Requires at least: 6.6
    1515Requires PHP: 7.4
    1616Author: Exactly WWW
     
    7777}
    7878add_action( 'init', 'force_regenerate_thumbnails' );
     79
     80// Register WP-CLI command if WP_CLI is present.
     81if ( defined( 'WP_CLI' ) && WP_CLI ) {
     82    require_once trailingslashit( __DIR__ ) . 'class-force-regenerate-thumbnails-cli.php';
     83}
  • force-regenerate-thumbnails/trunk/readme.txt

    r3305989 r3463651  
    11=== Force Regenerate Thumbnails ===
    22Contributors: pedro-elsner, nosilver4u
    3 Requires at least: 6.5
    4 Tested up to: 6.8
     3Requires at least: 6.6
     4Tested up to: 6.9
    55Requires PHP: 7.4
    6 Stable tag: 2.2.2
     6Stable tag: 2.3.0
    77License: GPLv2
    88Tags: force, regenerate thumbnails, thumbnail, thumbnails
     
    3434
    3535== ChangeLog ==
     36
     37= 2.3.0 =
     38*Release Date - February 17, 2026*
     39
     40* added: WP_CLI command: force-regenerate-thumbnails props @realmranshuman
     41* fixed: PHP 8.5 compatibility
    3642
    3743= 2.2.2 =
Note: See TracChangeset for help on using the changeset viewer.