Plugin Directory

Changeset 2809781


Ignore:
Timestamp:
11/02/2022 10:39:11 AM (3 years ago)
Author:
resmushit
Message:

release 0.4.9 : php 8.1 + WP 6.1

Location:
resmushit-image-optimizer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • resmushit-image-optimizer/trunk/readme.txt

    r2804661 r2809781  
    33Tags: image, optimizer, image optimization, resmush.it, smush, jpg, png, gif, optimization, compression, Compress, Images, Pictures, Reduce Image Size, Smush, Smush.it
    44Requires at least: 4.0.0
    5 Tested up to: 6.0.3
    6 Stable tag: 0.4.8
     5Tested up to: 6.1.0
     6Stable tag: 0.4.9
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515
    1616This plugin includes a bulk operation to optimize all your pictures in 2 clicks ! Change your image optimization level to fit your needs !
    17 This service is used by more than **400,000** websites on different CMS (Wordpress, Drupal, Joomla, Magento, Prestashop...).
     17This service is used by more than **400,000*php* websites on different CMS (Wordpress, Drupal, Joomla, Magento, Prestashop...).
    1818
    1919The plugin includes an option to exclude some pictures of the optimizer.
     
    7575== Changelog ==
    7676
     77
     78= 0.4.9 =
     79* Compatibility with WP 6.1.0
     80* Compatible with PHP 8.1.X
     81* Fixed issue on Undefined array key "file" in .../resmushit.php on line 114
    7782
    7883= 0.4.8 =
  • resmushit-image-optimizer/trunk/resmushit.php

    r2804661 r2809781  
    1111 * Plugin URI:        https://wordpress.org/plugins/resmushit-image-optimizer/
    1212 * Description:       Image Optimization API. Provides image size optimization
    13  * Version:           0.4.8
    14  * Timestamp:         2022.10.26
     13 * Version:           0.4.9
     14 * Timestamp:         2022.11.02
    1515 * Author:            reSmush.it
    1616 * Author URI:        https://resmush.it
     
    108108
    109109    $fileInfo = pathinfo(get_attached_file( $attachment_id ));
     110    if(!isset($fileInfo['dirname'])) {
     111        rlog("Error! Incorrect file provided." . print_r($fileInfo), 'WARNING');
     112        return $attachments;
     113    }
    110114    $basepath = $fileInfo['dirname'] . '/';
    111115    $extension = isset($fileInfo['extension']) ? $fileInfo['extension'] : NULL;
     116   
     117    if(!isset($attachments[ 'file' ])) {
     118        rlog("Error! Incorrect attachment." . print_r($attachments), 'WARNING');
     119        return $attachments;
     120    }
    112121    $basefile = basename($attachments[ 'file' ]);
    113122
     
    119128    $statistics[] = reSmushit::optimize($basepath . $basefile, $force_keep_original );
    120129
    121     foreach($attachments['sizes'] as $image_style)
     130    if(!isset($attachments[ 'sizes' ])) {
     131        rlog("Error! Unable to find attachments sizes." . print_r($attachments), 'WARNING');
     132        return $attachments;
     133    }
     134    foreach($attachments['sizes'] as $image_style) {
    122135        $statistics[] = reSmushit::optimize($basepath . $image_style['file'], FALSE );
     136    }
    123137   
    124138    $count = 0;
     
    128142            $cumulated_optimized_sizes += $stat->dest_size;
    129143            $count++;
    130         } else
     144        } else {
    131145            $error = TRUE;
     146        }
    132147    }
    133148    if(!$error) {
  • resmushit-image-optimizer/trunk/resmushit.settings.php

    r2804661 r2809781  
    22
    33define('RESMUSHIT_ENDPOINT', 'http://api.resmush.it/');
    4 define('RESMUSHIT_VERSION', '0.4.8');
     4define('RESMUSHIT_VERSION', '0.4.9');
    55define('RESMUSHIT_DEFAULT_QLTY', '92');
    66define('RESMUSHIT_TIMEOUT', '10');
Note: See TracChangeset for help on using the changeset viewer.