Skip to content

Commit

Permalink
version 1.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mecanik committed Mar 16, 2024
1 parent 93e64f9 commit c83f84e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

### Assistance
In your are in immediate need of commercial help/advice/assistance, I can offer you my assistance for a small fee.
Please do contact me via my email or if you cannot do so open an issue.
Please do contact me via my the [consultation page](https://mecanik.dev/en/consulting/) or if you cannot do so open an issue.

### Support me
Buy me a coffee to give me more energy and write more code :)
10 changes: 5 additions & 5 deletions cf-image-resizing/cf-image-resizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Cloudflare Image Resizing
* Plugin URI: https://wordpress.org/plugins/cf-image-resizing/
* Description: Optimize images on-the-fly using Cloudflare's Image Resizing service, improving performance and core web vitals.
* Version: 1.5.3
* Version: 1.5.5
* Author: Mecanik
* Author URI: https://mecanik.dev/en/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
* License: GPLv3 or later
Expand All @@ -20,7 +20,7 @@

require_once('config.php');

define('CF_IMAGE_RESIZING_VERSION', '1.5.3');
define('CF_IMAGE_RESIZING_VERSION', '1.5.5');

// Utilities class
class Utils
Expand Down Expand Up @@ -528,7 +528,7 @@ public static function hook_content_filter($content)
return $content;
}

@preg_match_all('/<img [^>]*?src="(https?:\/\/[^"]+?)"[^>]*?>/', $content, $image_tags);
@preg_match_all('/<img [^>]*?(src|data-src|data-src-.*)="(https?:\/\/[^"]+?)"[^>]*?>/', $content, $image_tags);

$img_tags = \array_replace([], $image_tags[0]);
$img_urls = \array_replace([], $image_tags[1]);
Expand Down Expand Up @@ -597,7 +597,7 @@ public static function hook_content_filter($content)
}

// Do the replacement of src="" for this image tag
$img_tags[$index] = @preg_replace('/src\s*=\s*"([^"]*)".*?/', 'src='.$img_urls[$index].'', $img_tags[$index]);
$img_tags[$index] = @preg_replace('/(src|data-src|data-src-.*)\s*=\s*"([^"]*)".*?/', 'src='.$img_urls[$index].'', $img_tags[$index]);

// Add missing width and height if desired and necessary
if(CF_IMAGE_RESIZING_ADD_MISSING_SIZES === TRUE)
Expand Down Expand Up @@ -1143,7 +1143,7 @@ function send_cf_image_resizing_admin_feedback()
'server_type' => Utils::get_server_type(),
'server_version' => Utils::get_server_version(),
'date_created' => current_time('mysql'),
'region' => $region['recommended-storage-region'],
'region' => isset($region['recommended-storage-region']) ? $region['recommended-storage-region'] : "weur",
]),
'method' => 'PUT',
'data_format' => 'body'
Expand Down
14 changes: 12 additions & 2 deletions cf-image-resizing/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: Mecanik
Donate link: https://github.com/sponsors/Mecanik
Tags: image, image-optimization, image-resizing, cloudflare images, optimizer, optimize, cloudflare, cloudflare-image-resizing, resize-images, performance, pagespeed, core web vitals, seo, speed, smush, jpg, png, gif, compression, compress, images, pictures, reduce-image-size, image-optimize
Requires at least: 5.0
Tested up to: 6.3.2
Stable tag: 1.5.3
Tested up to: 6.4.3
Stable tag: 1.5.5
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl.html

Expand Down Expand Up @@ -147,6 +147,16 @@ Yes, you can. However you need to edit manually the config.php as of this writin

== Changelog ==

##### Version 1.5.5

- Tested up to WordPress 6.4.3
- Support more images

##### Version 1.5.4

- Tested up to WordPress 6.4.1
- Fixed bug in plugin deactivation feedback

##### Version 1.5.3

- Added deactivation feedback
Expand Down

0 comments on commit c83f84e

Please sign in to comment.