Plugin Directory

Changeset 2966661

Timestamp:
09/13/2023 05:20:03 PM (11 months ago)
Author:
nosilver4u
Message:

tagging and releasing 2.1.3

Location:
force-regenerate-thumbnails
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • force-regenerate-thumbnails/tags/2.1.3/.travis.yml

    r2850735 r2966661  
    1515
    1616php:
    17   - 7.2
    18   - 7.4
     17  - 7.
     18  -
    1919
    2020env:
     
    2525  - phpenv config-rm xdebug.ini
    2626  - composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
    27   - composer global require wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer phpcompatibility/phpcompatibility-wp
     27  - composer global require phpcompatibility/phpcompatibility-wp
    2828
    2929script:
  • force-regenerate-thumbnails/tags/2.1.3/changelog.txt

    r2884433 r2966661  
     1
     2
     3
     4
    15= 2.1.2 =
    26* changed: improved i18n for page headings and menu entries, props @alexclassroom
  • force-regenerate-thumbnails/tags/2.1.3/class-forceregeneratethumbnails.php

    r2884433 r2966661  
    3333
    3434    /**
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
    3553     * Version of the plugin.
    3654     *
     
    3957     * @since 2.1.0
    4058     */
    41     const VERSION = 212;
     59    const VERSION = 21;
    4260
    4361    /**
     
    4765     * @since 1.0
    4866     */
    49     function __construct() {
     67    function __construct() {
    5068
    5169        add_action( 'admin_menu', array( &$this, 'add_admin_menu' ) );
     
    6684     * @since 1.0
    6785     */
    68     function add_admin_menu() {
     86    function add_admin_menu() {
    6987        $this->menu_id = add_management_page(
    7088            _x( 'Force Regenerate Thumbnails', 'Admin menu page title tag', 'force-regenerate-thumbnails' ),
     
    83101     * @since 1.0
    84102     */
    85     function admin_enqueues( $hook_suffix ) {
     103    function admin_enqueues( $hook_suffix ) {
    86104
    87105        if ( $hook_suffix !== $this->menu_id ) {
     
    160178     * @global array $_wp_admin_css_colors An array of available admin color/theme objects.
    161179     */
    162     function get_admin_colors() {
     180    function get_admin_colors() {
    163181        if ( ! empty( $this->admin_color ) && preg_match( '/^\#([0-9a-fA-F]){3,6}$/', $this->admin_color ) ) {
    164182            return;
     
    219237     * @since 1.0
    220238     */
    221     function add_media_row_action( $actions, $post ) {
     239    function add_media_row_action( $actions, $post ) {
    222240        if ( 'application/pdf' === $post->post_mime_type && ! extension_loaded( 'imagick' ) ) {
    223241            return $actions;
     
    256274     * @since 1.0
    257275     */
    258     function add_bulk_actions( $actions ) {
     276    function add_bulk_actions( $actions ) {
    259277
    260278        $delete = false;
     
    284302     * @return string The URL to go back to when we are done handling the action.
    285303     */
    286     function bulk_action_handler( $redirect_to, $doaction, $post_ids ) {
     304    function bulk_action_handler( $redirect_to, $doaction, $post_ids ) {
    287305        if ( empty( $doaction ) || 'bulk_force_regenerate_thumbnails' !== $doaction ) {
    288306            return $redirect_to;
     
    314332     * @since 1.0
    315333     */
    316     function force_regenerate_interface() {
     334    function force_regenerate_interface() {
    317335        $retry_url = wp_nonce_url(
    318336            admin_url( 'tools.php?page=force-regenerate-thumbnails' ),
     
    435453     * @throws Exception Any time we find an image we can't handle: permissions, corruption, doesn't exist, etc.
    436454     */
    437     function ajax_process_image() {
     455    function ajax_process_image() {
    438456        if ( empty( $_REQUEST['id'] ) ) {
    439457            $this->ob_clean();
     
    604622            }
    605623            if ( empty( $original_path ) || ! is_file( $original_path ) ) {
     624
    606625                $original_path = $image_fullpath;
    607             }
    608 
    609             $metadata = wp_generate_attachment_metadata( $image->ID, $original_path );
     626            } elseif ( preg_match( '/e\d{10,}\./', $image_fullpath ) ) {
     627                $regen_path = $image_fullpath;
     628            } else {
     629                $regen_path = $original_path;
     630            }
     631            $debug_1 = $regen_path;
     632
     633            $metadata = wp_generate_attachment_metadata( $image->ID, $regen_path );
    610634            if ( is_wp_error( $metadata ) ) {
    611635                throw new Exception( esc_html( $metadata->get_error_message() ) );
     
    614638                throw new Exception( esc_html__( 'Unknown failure.', 'force-regenerate-thumbnails' ) );
    615639            }
     640
     641
     642
    616643            wp_update_attachment_metadata( $image->ID, $metadata );
    617             do_action( 'regenerate_thumbs_post_update', $image->ID, $original_path );
     644            do_action( 'regenerate_thumbs_post_update', $image->ID, $_path );
    618645
    619646            /**
     
    748775     * @return string The full path to the image.
    749776     */
    750     function get_attachment_path( $id, $meta ) {
     777    function get_attachment_path( $id, $meta ) {
    751778
    752779        // Retrieve the location of the WordPress upload folder.
     
    802829     * @return bool True if a supported stream wrapper is found, false otherwise.
    803830     */
    804     function stream_wrapper_exists() {
     831    function stream_wrapper_exists() {
    805832        $wrappers = stream_get_wrappers();
    806833        if ( ! is_iterable( $wrappers ) ) {
     
    824851     * @return bool True if a stream wrapper is found, false otherwise.
    825852     */
    826     function stream_wrapped( $filename ) {
     853    function stream_wrapped( $filename ) {
    827854        if ( false !== strpos( $filename, '://' ) ) {
    828855            if ( strpos( $filename, 's3' ) === 0 ) {
     
    843870     * @return string The haystack with needle removed from the end.
    844871     */
    845     function remove_from_end( $haystack, $needle ) {
     872    function remove_from_end( $haystack, $needle ) {
    846873        $needle_length = strlen( $needle );
    847874        if ( substr( $haystack, -$needle_length ) === $needle ) {
     
    854881     * Checks if a function is disabled or does not exist.
    855882     *
    856      * @param string $function The name of a function to test.
     883     * @param string $function The name of a function to test.
    857884     * @param bool   $debug Whether to output debugging.
    858885     * @return bool True if the function is available, False if not.
    859886     */
    860     function function_exists( $function, $debug = false ) {
     887    , $debug = false ) {
    861888        if ( extension_loaded( 'suhosin' ) && function_exists( 'ini_get' ) ) {
    862889            // phpcs:ignore WordPress.PHP.NoSilencedErrors
     
    866893                $suhosin_disabled = array_map( 'trim', $suhosin_disabled );
    867894                $suhosin_disabled = array_map( 'strtolower', $suhosin_disabled );
    868                 if ( function_exists( $function ) && ! in_array( $function, $suhosin_disabled, true ) ) {
     895                if ( function_exists( $function, $suhosin_disabled, true ) ) {
    869896                    return true;
    870897                }
     
    872899            }
    873900        }
    874         return \function_exists( $function );
     901        return \function_exists( $function );
    875902    }
    876903
     
    878905     * Find out if set_time_limit() is allowed.
    879906     */
    880     function stl_check() {
     907    function stl_check() {
    881908        if ( defined( 'FTR_DISABLE_STL' ) && FTR_DISABLE_STL ) {
    882909            // set_time_limit() disabled by user.
     
    893920     * Clear output buffers without throwing a fit.
    894921     */
    895     function ob_clean() {
     922    function ob_clean() {
    896923        if ( ob_get_length() ) {
    897924            ob_end_clean();
     
    907934     * @since 1.8
    908935     */
    909     function die_json_failure_msg( $id, $message ) {
     936    function die_json_failure_msg( $id, $message ) {
    910937        $this->ob_clean();
    911938        die(
  • force-regenerate-thumbnails/tags/2.1.3/force-regenerate-thumbnails.php

    r2884433 r2966661  
    1010Plugin Name: Force Regenerate Thumbnails
    1111Plugin URI: https://wordpress.org/plugins/force-regenerate-thumbnails/
    12 Description: Delete and REALLY force the regenerate thumbnail.
    13 Version: 2.1.2
    14 Requires at least: 4.9
    15 Requires PHP: 7.2
     12Description: Delete and REALLY force the regenerat.
     13Version: 2.1.
     14Requires at least:
     15Requires PHP: 7.
    1616Author: Exactly WWW
    1717Author URI: http://ewww.io/about/
    1818License: GPLv2
    19 */
    20 
    21 /*
    22 Debug URL
    23 wp-admin/admin-ajax.php?action=regeneratethumbnail&id=
    2419*/
    2520
     
    6762}
    6863
    69 require_once( trailingslashit( __DIR__ ) . 'class-forceregeneratethumbnails.php' );
     64require_once;
    7065
    7166/**
  • force-regenerate-thumbnails/tags/2.1.3/readme.txt

    r2884433 r2966661  
    11=== Force Regenerate Thumbnails ===
    22Contributors: pedro-elsner, nosilver4u
    3 Requires at least: 4.9
    4 Tested up to: 6.2
    5 Requires PHP: 7.2
    6 Stable tag: 2.1.2
     3Requires at least:
     4Tested up to: 6.
     5Requires PHP: 7.
     6Stable tag: 2.1.
    77License: GPLv2
    88Tags: force, regenerate thumbnails, thumbnail, thumbnails
     
    1717
    1818Several filters exist for advanced usage. See more via [this gist](https://gist.github.com/nosilver4u/eb858df10521aece2044a3a15ccdd17b).
     19
     20
    1921
    2022== Installation ==
     
    3234
    3335== ChangeLog ==
     36
     37
     38
     39
    3440
    3541= 2.1.2 =
  • force-regenerate-thumbnails/trunk/.travis.yml

    r2850735 r2966661  
    1515
    1616php:
    17   - 7.2
    18   - 7.4
     17  - 7.
     18  -
    1919
    2020env:
     
    2525  - phpenv config-rm xdebug.ini
    2626  - composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
    27   - composer global require wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer phpcompatibility/phpcompatibility-wp
     27  - composer global require phpcompatibility/phpcompatibility-wp
    2828
    2929script:
  • force-regenerate-thumbnails/trunk/changelog.txt

    r2884433 r2966661  
     1
     2
     3
     4
    15= 2.1.2 =
    26* changed: improved i18n for page headings and menu entries, props @alexclassroom
  • force-regenerate-thumbnails/trunk/class-forceregeneratethumbnails.php

    r2884433 r2966661  
    3333
    3434    /**
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
    3553     * Version of the plugin.
    3654     *
     
    3957     * @since 2.1.0
    4058     */
    41     const VERSION = 212;
     59    const VERSION = 21;
    4260
    4361    /**
     
    4765     * @since 1.0
    4866     */
    49     function __construct() {
     67    function __construct() {
    5068
    5169        add_action( 'admin_menu', array( &$this, 'add_admin_menu' ) );
     
    6684     * @since 1.0
    6785     */
    68     function add_admin_menu() {
     86    function add_admin_menu() {
    6987        $this->menu_id = add_management_page(
    7088            _x( 'Force Regenerate Thumbnails', 'Admin menu page title tag', 'force-regenerate-thumbnails' ),
     
    83101     * @since 1.0
    84102     */
    85     function admin_enqueues( $hook_suffix ) {
     103    function admin_enqueues( $hook_suffix ) {
    86104
    87105        if ( $hook_suffix !== $this->menu_id ) {
     
    160178     * @global array $_wp_admin_css_colors An array of available admin color/theme objects.
    161179     */
    162     function get_admin_colors() {
     180    function get_admin_colors() {
    163181        if ( ! empty( $this->admin_color ) && preg_match( '/^\#([0-9a-fA-F]){3,6}$/', $this->admin_color ) ) {
    164182            return;
     
    219237     * @since 1.0
    220238     */
    221     function add_media_row_action( $actions, $post ) {
     239    function add_media_row_action( $actions, $post ) {
    222240        if ( 'application/pdf' === $post->post_mime_type && ! extension_loaded( 'imagick' ) ) {
    223241            return $actions;
     
    256274     * @since 1.0
    257275     */
    258     function add_bulk_actions( $actions ) {
     276    function add_bulk_actions( $actions ) {
    259277
    260278        $delete = false;
     
    284302     * @return string The URL to go back to when we are done handling the action.
    285303     */
    286     function bulk_action_handler( $redirect_to, $doaction, $post_ids ) {
     304    function bulk_action_handler( $redirect_to, $doaction, $post_ids ) {
    287305        if ( empty( $doaction ) || 'bulk_force_regenerate_thumbnails' !== $doaction ) {
    288306            return $redirect_to;
     
    314332     * @since 1.0
    315333     */
    316     function force_regenerate_interface() {
     334    function force_regenerate_interface() {
    317335        $retry_url = wp_nonce_url(
    318336            admin_url( 'tools.php?page=force-regenerate-thumbnails' ),
     
    435453     * @throws Exception Any time we find an image we can't handle: permissions, corruption, doesn't exist, etc.
    436454     */
    437     function ajax_process_image() {
     455    function ajax_process_image() {
    438456        if ( empty( $_REQUEST['id'] ) ) {
    439457            $this->ob_clean();
     
    604622            }
    605623            if ( empty( $original_path ) || ! is_file( $original_path ) ) {
     624
    606625                $original_path = $image_fullpath;
    607             }
    608 
    609             $metadata = wp_generate_attachment_metadata( $image->ID, $original_path );
     626            } elseif ( preg_match( '/e\d{10,}\./', $image_fullpath ) ) {
     627                $regen_path = $image_fullpath;
     628            } else {
     629                $regen_path = $original_path;
     630            }
     631            $debug_1 = $regen_path;
     632
     633            $metadata = wp_generate_attachment_metadata( $image->ID, $regen_path );
    610634            if ( is_wp_error( $metadata ) ) {
    611635                throw new Exception( esc_html( $metadata->get_error_message() ) );
     
    614638                throw new Exception( esc_html__( 'Unknown failure.', 'force-regenerate-thumbnails' ) );
    615639            }
     640
     641
     642
    616643            wp_update_attachment_metadata( $image->ID, $metadata );
    617             do_action( 'regenerate_thumbs_post_update', $image->ID, $original_path );
     644            do_action( 'regenerate_thumbs_post_update', $image->ID, $_path );
    618645
    619646            /**
     
    748775     * @return string The full path to the image.
    749776     */
    750     function get_attachment_path( $id, $meta ) {
     777    function get_attachment_path( $id, $meta ) {
    751778
    752779        // Retrieve the location of the WordPress upload folder.
     
    802829     * @return bool True if a supported stream wrapper is found, false otherwise.
    803830     */
    804     function stream_wrapper_exists() {
     831    function stream_wrapper_exists() {
    805832        $wrappers = stream_get_wrappers();
    806833        if ( ! is_iterable( $wrappers ) ) {
     
    824851     * @return bool True if a stream wrapper is found, false otherwise.
    825852     */
    826     function stream_wrapped( $filename ) {
     853    function stream_wrapped( $filename ) {
    827854        if ( false !== strpos( $filename, '://' ) ) {
    828855            if ( strpos( $filename, 's3' ) === 0 ) {
     
    843870     * @return string The haystack with needle removed from the end.
    844871     */
    845     function remove_from_end( $haystack, $needle ) {
     872    function remove_from_end( $haystack, $needle ) {
    846873        $needle_length = strlen( $needle );
    847874        if ( substr( $haystack, -$needle_length ) === $needle ) {
     
    854881     * Checks if a function is disabled or does not exist.
    855882     *
    856      * @param string $function The name of a function to test.
     883     * @param string $function The name of a function to test.
    857884     * @param bool   $debug Whether to output debugging.
    858885     * @return bool True if the function is available, False if not.
    859886     */
    860     function function_exists( $function, $debug = false ) {
     887    , $debug = false ) {
    861888        if ( extension_loaded( 'suhosin' ) && function_exists( 'ini_get' ) ) {
    862889            // phpcs:ignore WordPress.PHP.NoSilencedErrors
     
    866893                $suhosin_disabled = array_map( 'trim', $suhosin_disabled );
    867894                $suhosin_disabled = array_map( 'strtolower', $suhosin_disabled );
    868                 if ( function_exists( $function ) && ! in_array( $function, $suhosin_disabled, true ) ) {
     895                if ( function_exists( $function, $suhosin_disabled, true ) ) {
    869896                    return true;
    870897                }
     
    872899            }
    873900        }
    874         return \function_exists( $function );
     901        return \function_exists( $function );
    875902    }
    876903
     
    878905     * Find out if set_time_limit() is allowed.
    879906     */
    880     function stl_check() {
     907    function stl_check() {
    881908        if ( defined( 'FTR_DISABLE_STL' ) && FTR_DISABLE_STL ) {
    882909            // set_time_limit() disabled by user.
     
    893920     * Clear output buffers without throwing a fit.
    894921     */
    895     function ob_clean() {
     922    function ob_clean() {
    896923        if ( ob_get_length() ) {
    897924            ob_end_clean();
     
    907934     * @since 1.8
    908935     */
    909     function die_json_failure_msg( $id, $message ) {
     936    function die_json_failure_msg( $id, $message ) {
    910937        $this->ob_clean();
    911938        die(
  • force-regenerate-thumbnails/trunk/force-regenerate-thumbnails.php

    r2884433 r2966661  
    1010Plugin Name: Force Regenerate Thumbnails
    1111Plugin URI: https://wordpress.org/plugins/force-regenerate-thumbnails/
    12 Description: Delete and REALLY force the regenerate thumbnail.
    13 Version: 2.1.2
    14 Requires at least: 4.9
    15 Requires PHP: 7.2
     12Description: Delete and REALLY force the regenerat.
     13Version: 2.1.
     14Requires at least:
     15Requires PHP: 7.
    1616Author: Exactly WWW
    1717Author URI: http://ewww.io/about/
    1818License: GPLv2
    19 */
    20 
    21 /*
    22 Debug URL
    23 wp-admin/admin-ajax.php?action=regeneratethumbnail&id=
    2419*/
    2520
     
    6762}
    6863
    69 require_once( trailingslashit( __DIR__ ) . 'class-forceregeneratethumbnails.php' );
     64require_once;
    7065
    7166/**
  • force-regenerate-thumbnails/trunk/readme.txt

    r2884433 r2966661  
    11=== Force Regenerate Thumbnails ===
    22Contributors: pedro-elsner, nosilver4u
    3 Requires at least: 4.9
    4 Tested up to: 6.2
    5 Requires PHP: 7.2
    6 Stable tag: 2.1.2
     3Requires at least:
     4Tested up to: 6.
     5Requires PHP: 7.
     6Stable tag: 2.1.
    77License: GPLv2
    88Tags: force, regenerate thumbnails, thumbnail, thumbnails
     
    1717
    1818Several filters exist for advanced usage. See more via [this gist](https://gist.github.com/nosilver4u/eb858df10521aece2044a3a15ccdd17b).
     19
     20
    1921
    2022== Installation ==
     
    3234
    3335== ChangeLog ==
     36
     37
     38
     39
    3440
    3541= 2.1.2 =
Note: See TracChangeset for help on using the changeset viewer.