Plugin Directory

Changeset 2595353


Ignore:
Timestamp:
09/07/2021 10:13:07 PM (5 years ago)
Author:
megaoptim
Message:

Version 1.4.17

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

Legend:

Unmodified
Added
Removed
  • megaoptim-image-optimizer/trunk/includes/functions/webp.php

    r2432752 r2595353  
    288288 * Returns the image dir if it's local. Otherwise it returns false.
    289289 *
    290  * @param $src - Url of the image
     290 * @param $src  - Url of the image
    291291 *
    292292 * @return bool|mixed|string
     
    350350
    351351        if ( $src_host[0] === $base_url_host[0] && $src_host[1] === $base_url_host[1] && ( strlen( $src_host[1] ) > 3 || isset( $src_host[2] ) && $src_host[2] == $base_url_host[2] ) ) {
    352             $baseurl      = str_replace( $base_parsed['scheme'] . '://' . $base_parsed['host'], $url_parsed['scheme'] . '://' . $url_parsed['host'], $base_url );
     352            $baseurl      = str_replace( $base_parsed['scheme'] . '://' . $base_parsed['host'],
     353                $url_parsed['scheme'] . '://' . $url_parsed['host'], $base_url );
    353354            $base_img_src = str_replace( $baseurl, $base_dir, $src );
    354355        }
     
    367368 * Returns the parameter needed out of array of parameters for specific html img tag.
    368369 *
    369  * @param array $attribute_array
     370 * @param  array $attribute_array
    370371 * @param $type
    371372 *
     
    431432    } else {
    432433        $dom = new \DOMDocument;
    433         $dom->loadHTML( $content );
    434         foreach ( $dom->getElementsByTagName( $element ) as $tag ) {
     434        @$dom->loadHTML( $content );
     435        $items = $dom->getElementsByTagName( $element );
     436        foreach ( $items as $tag ) {
     437            if ( ! is_object( $tag ) ) {
     438                continue;
     439            }
    435440            foreach ( $tag->attributes as $attribName => $attribNodeVal ) {
    436441                $attr[ $attribName ] = $tag->getAttribute( $attribName );
     
    474479        include( $htaccess_path );
    475480        $htaccess_contents = ob_get_clean();
    476         $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', $htaccess_contents ) );
     481        $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO',
     482            $htaccess_contents ) );
    477483    }
    478484
     
    499505    <IfModule mod_mime.c>
    500506        AddType image/webp .webp
    501     </IfModule>
    502     # END MegaOptimIO
     507    </IfModule># END MegaOptimIO
    503508
    504509    <?php
     
    527532    include( $htaccess_path );
    528533    $htaccess_contents = ob_get_clean();
    529     $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', $htaccess_contents ) );
     534    $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO',
     535        $htaccess_contents ) );
    530536    megaoptim_write( $htaccess_path, $htaccess_contents, 'w' );
    531537
  • megaoptim-image-optimizer/trunk/megaoptim.php

    r2552367 r2595353  
    66Author: MegaOptim
    77Author URI: https://megaoptim.com
    8 Version: 1.4.16
     8Version: 1.4.17
    99Text Domain: megaoptim-image-optimizer
    1010Domain Path: /languages
     
    1515}
    1616
    17 define( 'WP_MEGAOPTIM_VER', '1.4.16' );
     17define( 'WP_MEGAOPTIM_VER', '1.4.17' );
    1818define( 'WP_MEGAOPTIM_PATH', plugin_dir_path( __FILE__ ) );
    1919define( 'WP_MEGAOPTIM_URL', plugin_dir_url( __FILE__ ) );
  • megaoptim-image-optimizer/trunk/readme.txt

    r2552367 r2595353  
    33Tags: convert webp, webp, optimize images, optimize, images, compress
    44Requires at least: 3.6
    5 Tested up to: 5.7
     5Tested up to: 5.8
    66Requires PHP: 5.3
    7 Stable tag: 1.4.16
     7Stable tag: 1.4.17
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 1.4.17 =
     141- Fix PHP warnings related to the WebP features
     142
    140143= 1.4.16 =
    141144- Fix url encoding for attachments that contain weird characters
Note: See TracChangeset for help on using the changeset viewer.