Version Description
Download this release
Release Info
Developer | optimole |
Plugin | Image optimization & Lazy Load by Optimole |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- CHANGELOG.md +9 -0
- README.md +12 -1
- inc/app_replacer.php +58 -2
- inc/compatibilities/beaver_builder.php +9 -0
- inc/compatibilities/divi_builder.php +41 -0
- inc/compatibilities/elementor_builder.php +35 -0
- inc/compatibilities/master_slider.php +36 -0
- inc/compatibilities/metaslider.php +8 -0
- inc/compatibilities/thrive.php +38 -0
- inc/image_properties/resize.php +18 -0
- inc/lazyload_replacer.php +0 -1
- inc/manager.php +4 -0
- inc/url_replacer.php +5 -2
- optimole-wp.php +2 -2
- readme.txt +12 -1
- themeisle-hash.json +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +1 -1
CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
2 |
|
3 |
* **Bug Fixes**
|
1 |
+
#### [Version 2.2.5](https://github.com/Codeinwp/optimole-wp/compare/v2.2.4...v2.2.5) (2019-11-18)
|
2 |
+
|
3 |
+
* **Bug Fixes**
|
4 |
+
* inherit custom sizes desired cropping, adds enlarge compatibility ([84f7056](https://github.com/Codeinwp/optimole-wp/commit/84f7056))
|
5 |
+
|
6 |
+
* **Features**
|
7 |
+
* adds compatibility with multiple slider plugins ([d78fd1b](https://github.com/Codeinwp/optimole-wp/commit/d78fd1b))
|
8 |
+
* improve compatibility with various page builders: Divi, Thrive, Elementor, Beaver ([a4391b4](https://github.com/Codeinwp/optimole-wp/commit/a4391b4))
|
9 |
+
|
10 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
11 |
|
12 |
* **Bug Fixes**
|
README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
**Contributors:** [optimole](https://profiles.wordpress.org/optimole)
|
3 |
**Tags:** image optimization, convert webp, responsive images, lazy load, images, optimization, performance, photos
|
4 |
**Requires at least:** 4.7
|
5 |
-
**Tested up to:** 5.
|
6 |
**Requires PHP:** 5.4
|
7 |
**License:** GPLv3
|
8 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.en.html
|
@@ -89,6 +89,17 @@ Premium users will be able to optimize images for more than 25k monthly active u
|
|
89 |
|
90 |
## Changelog ##
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
93 |
|
94 |
* **Bug Fixes**
|
2 |
**Contributors:** [optimole](https://profiles.wordpress.org/optimole)
|
3 |
**Tags:** image optimization, convert webp, responsive images, lazy load, images, optimization, performance, photos
|
4 |
**Requires at least:** 4.7
|
5 |
+
**Tested up to:** 5.3
|
6 |
**Requires PHP:** 5.4
|
7 |
**License:** GPLv3
|
8 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.en.html
|
89 |
|
90 |
## Changelog ##
|
91 |
|
92 |
+
#### [Version 2.2.5](https://github.com/Codeinwp/optimole-wp/compare/v2.2.4...v2.2.5) (2019-11-18)
|
93 |
+
|
94 |
+
* **Bug Fixes**
|
95 |
+
* inherit custom sizes desired cropping, adds enlarge compatibility ([84f7056](https://github.com/Codeinwp/optimole-wp/commit/84f7056))
|
96 |
+
|
97 |
+
* **Features**
|
98 |
+
* adds compatibility with multiple slider plugins ([d78fd1b](https://github.com/Codeinwp/optimole-wp/commit/d78fd1b))
|
99 |
+
* improve compatibility with various page builders: Divi, Thrive, Elementor, Beaver ([a4391b4](https://github.com/Codeinwp/optimole-wp/commit/a4391b4))
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
104 |
|
105 |
* **Bug Fixes**
|
inc/app_replacer.php
CHANGED
@@ -75,7 +75,12 @@ abstract class Optml_App_Replacer {
|
|
75 |
* @var array Domains.
|
76 |
*/
|
77 |
protected $possible_sources = array();
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
79 |
/**
|
80 |
* Whitelisted domains sources to optimize from, according to optimole service.
|
81 |
*
|
@@ -157,12 +162,38 @@ abstract class Optml_App_Replacer {
|
|
157 |
}
|
158 |
|
159 |
foreach ( self::image_sizes() as $size_data ) {
|
160 |
-
self::$size_to_crop[ $size_data['width'] . $size_data['height'] ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
}
|
162 |
|
163 |
return self::$size_to_crop;
|
164 |
}
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
/**
|
168 |
* Returns the array of image sizes since `get_intermediate_image_sizes` and image metadata doesn't include the
|
@@ -212,6 +243,8 @@ abstract class Optml_App_Replacer {
|
|
212 |
} else {
|
213 |
self::$image_sizes = $images;
|
214 |
}
|
|
|
|
|
215 |
self::$image_sizes = array_map(
|
216 |
function ( $value ) {
|
217 |
$value['crop'] = isset( $value['crop'] ) ?
|
@@ -291,7 +324,30 @@ abstract class Optml_App_Replacer {
|
|
291 |
$this->max_width = $this->settings->get( 'max_width' );
|
292 |
|
293 |
add_filter( 'optml_strip_image_size_from_url', [ $this, 'strip_image_size_from_url' ], 10, 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
|
|
295 |
}
|
296 |
|
297 |
/**
|
75 |
* @var array Domains.
|
76 |
*/
|
77 |
protected $possible_sources = array();
|
78 |
+
/**
|
79 |
+
* Possible custom sizes definitions.
|
80 |
+
*
|
81 |
+
* @var array Custom sizes definitions.
|
82 |
+
*/
|
83 |
+
private static $custom_size_buffer = array();
|
84 |
/**
|
85 |
* Whitelisted domains sources to optimize from, according to optimole service.
|
86 |
*
|
162 |
}
|
163 |
|
164 |
foreach ( self::image_sizes() as $size_data ) {
|
165 |
+
if ( isset( self::$size_to_crop[ $size_data['width'] . $size_data['height'] ] ) ) {
|
166 |
+
continue;
|
167 |
+
}
|
168 |
+
self::$size_to_crop[ $size_data['width'] . $size_data['height'] ] =
|
169 |
+
isset( $size_data['enlarge'] ) ? [
|
170 |
+
'crop' => $size_data['crop'],
|
171 |
+
'enlarge' => true,
|
172 |
+
] : $size_data['crop'];
|
173 |
}
|
174 |
|
175 |
return self::$size_to_crop;
|
176 |
}
|
177 |
|
178 |
+
/**
|
179 |
+
* Set possible custom size.
|
180 |
+
*
|
181 |
+
* @param null $width Width value.
|
182 |
+
* @param null $height Height Value.
|
183 |
+
* @param null $crop Croping.
|
184 |
+
*/
|
185 |
+
public static function add_size( $width = null, $height = null, $crop = null ) {
|
186 |
+
if ( empty( $width ) || empty( $height ) ) {
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
self::$custom_size_buffer[ 'cmole' . $width . $height ] = [
|
190 |
+
'width' => (int) $width,
|
191 |
+
'height' => (int) $height,
|
192 |
+
'enlarge' => true,
|
193 |
+
'crop' => $crop,
|
194 |
+
];
|
195 |
+
|
196 |
+
}
|
197 |
|
198 |
/**
|
199 |
* Returns the array of image sizes since `get_intermediate_image_sizes` and image metadata doesn't include the
|
243 |
} else {
|
244 |
self::$image_sizes = $images;
|
245 |
}
|
246 |
+
|
247 |
+
self::$image_sizes = array_merge( self::$image_sizes, self::$custom_size_buffer );
|
248 |
self::$image_sizes = array_map(
|
249 |
function ( $value ) {
|
250 |
$value['crop'] = isset( $value['crop'] ) ?
|
324 |
$this->max_width = $this->settings->get( 'max_width' );
|
325 |
|
326 |
add_filter( 'optml_strip_image_size_from_url', [ $this, 'strip_image_size_from_url' ], 10, 1 );
|
327 |
+
add_filter(
|
328 |
+
'image_resize_dimensions',
|
329 |
+
[ __CLASS__, 'listen_to_sizes' ],
|
330 |
+
999999,
|
331 |
+
6
|
332 |
+
);
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* List to resizes and save the crop for later re-use.
|
337 |
+
*
|
338 |
+
* @param null $value Original resize.
|
339 |
+
* @param int $orig_w Original W.
|
340 |
+
* @param int $orig_h Original H.
|
341 |
+
* @param int $dest_w Output W.
|
342 |
+
* @param int $dest_h Output H.
|
343 |
+
* @param mixed $crop Cropping behaviour.
|
344 |
+
*
|
345 |
+
* @return mixed Original value.
|
346 |
+
*/
|
347 |
+
static function listen_to_sizes( $value, $orig_w, $orig_h, $dest_w, $dest_h, $crop ) {
|
348 |
+
self::add_size( $dest_w, $dest_h, $crop );
|
349 |
|
350 |
+
return $value;
|
351 |
}
|
352 |
|
353 |
/**
|
inc/compatibilities/beaver_builder.php
CHANGED
@@ -23,6 +23,15 @@ class Optml_beaver_builder extends Optml_compatibility {
|
|
23 |
* Register integration details.
|
24 |
*/
|
25 |
public function register() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
add_filter( 'fl_builder_render_css', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
|
27 |
}
|
28 |
|
23 |
* Register integration details.
|
24 |
*/
|
25 |
public function register() {
|
26 |
+
add_filter(
|
27 |
+
'optml_lazyload_bg_selectors',
|
28 |
+
function ( $all_watchers ) {
|
29 |
+
$all_watchers[] = '.fl-col-content';
|
30 |
+
$all_watchers[] = '.fl-row-bg-photo > .fl-row-content-wrap';
|
31 |
+
|
32 |
+
return $all_watchers;
|
33 |
+
}
|
34 |
+
);
|
35 |
add_filter( 'fl_builder_render_css', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
|
36 |
}
|
37 |
|
inc/compatibilities/divi_builder.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Optml_divi_builder
|
5 |
+
*
|
6 |
+
* @reason Adding selectors for background lazyload
|
7 |
+
*/
|
8 |
+
class Optml_divi_builder extends Optml_compatibility {
|
9 |
+
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Should we load the integration logic.
|
13 |
+
*
|
14 |
+
* @return bool Should we load.
|
15 |
+
*/
|
16 |
+
function should_load() {
|
17 |
+
return (
|
18 |
+
strcmp( wp_get_theme(), 'Divi' ) === 0 ||
|
19 |
+
is_plugin_active( 'divi-builder/divi-builder.php' )
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Register integration details.
|
25 |
+
*/
|
26 |
+
public function register() {
|
27 |
+
add_filter(
|
28 |
+
'optml_lazyload_bg_selectors',
|
29 |
+
function ( $all_watchers ) {
|
30 |
+
$all_watchers[] = '.et_pb_slides > .et_pb_slide';
|
31 |
+
$all_watchers[] = '.et_parallax_bg';
|
32 |
+
$all_watchers[] = '.et_pb_video_overlay';
|
33 |
+
$all_watchers[] = '.et_pb_module';
|
34 |
+
$all_watchers[] = '.et_pb_row';
|
35 |
+
$all_watchers[] = '.et_pb_with_background';
|
36 |
+
return $all_watchers;
|
37 |
+
}
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
inc/compatibilities/elementor_builder.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Optml_elementor_builder
|
5 |
+
*
|
6 |
+
* @reason Adding selectors for background lazyload
|
7 |
+
*/
|
8 |
+
class Optml_elementor_builder extends Optml_compatibility {
|
9 |
+
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Should we load the integration logic.
|
13 |
+
*
|
14 |
+
* @return bool Should we load.
|
15 |
+
*/
|
16 |
+
function should_load() {
|
17 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
18 |
+
|
19 |
+
return is_plugin_active( 'elementor/elementor.php' );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Register integration details.
|
24 |
+
*/
|
25 |
+
public function register() {
|
26 |
+
add_filter(
|
27 |
+
'optml_lazyload_bg_selectors',
|
28 |
+
function ( $all_watchers ) {
|
29 |
+
$all_watchers[] = '.elementor-widget-container';
|
30 |
+
return $all_watchers;
|
31 |
+
}
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
}
|
inc/compatibilities/master_slider.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Optml_master_slider.
|
5 |
+
*
|
6 |
+
* @reason Added classes to watch for background lazyload
|
7 |
+
*/
|
8 |
+
class Optml_master_slider extends Optml_compatibility {
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Should we load the integration logic.
|
14 |
+
*
|
15 |
+
* @return bool Should we load.
|
16 |
+
*/
|
17 |
+
function should_load() {
|
18 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
19 |
+
|
20 |
+
return is_plugin_active( 'master-slider/master-slider.php' );
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Register integration details.
|
25 |
+
*/
|
26 |
+
public function register() {
|
27 |
+
add_filter(
|
28 |
+
'optml_lazyload_bg_selectors',
|
29 |
+
function ( $all_watchers ) {
|
30 |
+
$all_watchers[] = '.master-slider';
|
31 |
+
return $all_watchers;
|
32 |
+
}
|
33 |
+
);
|
34 |
+
|
35 |
+
}
|
36 |
+
}
|
inc/compatibilities/metaslider.php
CHANGED
@@ -27,6 +27,14 @@ class Optml_metaslider extends Optml_compatibility {
|
|
27 |
add_filter( 'optml_possible_lazyload_flags', [ $this, 'add_ignore_lazyload' ], PHP_INT_MAX, 1 );
|
28 |
add_filter( 'optml_watcher_lz_classes', [ $this, 'add_watcher_class' ], 10, 1 );
|
29 |
add_filter( 'metaslider_coin_slider_image_attributes', [ $this, 'setup_listner' ], PHP_INT_MAX, 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
27 |
add_filter( 'optml_possible_lazyload_flags', [ $this, 'add_ignore_lazyload' ], PHP_INT_MAX, 1 );
|
28 |
add_filter( 'optml_watcher_lz_classes', [ $this, 'add_watcher_class' ], 10, 1 );
|
29 |
add_filter( 'metaslider_coin_slider_image_attributes', [ $this, 'setup_listner' ], PHP_INT_MAX, 1 );
|
30 |
+
add_filter(
|
31 |
+
'optml_lazyload_bg_selectors',
|
32 |
+
function ( $all_watchers ) {
|
33 |
+
$all_watchers[] = '.coin-slider > .coin-slider > a';
|
34 |
+
$all_watchers[] = '.coin-slider > .coin-slider';
|
35 |
+
return $all_watchers;
|
36 |
+
}
|
37 |
+
);
|
38 |
}
|
39 |
|
40 |
/**
|
inc/compatibilities/thrive.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Optml_thrive.
|
5 |
+
*
|
6 |
+
* @reason @reason Adding selectors for background lazyload
|
7 |
+
*/
|
8 |
+
class Optml_thrive extends Optml_compatibility {
|
9 |
+
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Should we load the integration logic.
|
13 |
+
*
|
14 |
+
* @return bool Should we load.
|
15 |
+
*/
|
16 |
+
function should_load() {
|
17 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
18 |
+
|
19 |
+
return is_plugin_active( 'thrive-visual-editor/thrive-visual-editor.php' );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Register integration details.
|
24 |
+
*/
|
25 |
+
public function register() {
|
26 |
+
add_filter(
|
27 |
+
'optml_lazyload_bg_selectors',
|
28 |
+
function ( $all_watchers ) {
|
29 |
+
$all_watchers[] = '.tve-content-box-background';
|
30 |
+
$all_watchers[] = '.tve-page-section-out';
|
31 |
+
$all_watchers[] = '.thrv_text_element';
|
32 |
+
|
33 |
+
return $all_watchers;
|
34 |
+
}
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
inc/image_properties/resize.php
CHANGED
@@ -90,6 +90,18 @@ class Optml_Resize extends Optml_Property_Type {
|
|
90 |
* @var string Resize type string.
|
91 |
*/
|
92 |
private $resize_type = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
/**
|
95 |
* Gravity type.
|
@@ -112,6 +124,7 @@ class Optml_Resize extends Optml_Property_Type {
|
|
112 |
*/
|
113 |
public function set( $value ) {
|
114 |
$this->resize_type = isset( $value['type'] ) ? $value['type'] : '';
|
|
|
115 |
$this->gravity = isset( $value['gravity'] ) ? is_array( $value['gravity'] ) ? self::GRAVITY_FOCUS_POINT : $value['gravity'] : '';
|
116 |
if ( $this->gravity === self::GRAVITY_FOCUS_POINT ) {
|
117 |
$this->focus_point_x = $value['gravity'][0];
|
@@ -139,6 +152,7 @@ class Optml_Resize extends Optml_Property_Type {
|
|
139 |
return [
|
140 |
'type' => $this->resize_type,
|
141 |
'gravity' => $this->gravity,
|
|
|
142 |
];
|
143 |
}
|
144 |
|
@@ -153,6 +167,10 @@ class Optml_Resize extends Optml_Property_Type {
|
|
153 |
|
154 |
$resize .= sprintf( '/g:%s', $this->gravity );
|
155 |
|
|
|
|
|
|
|
|
|
156 |
if ( $this->gravity === self::GRAVITY_FOCUS_POINT ) {
|
157 |
$resize .= sprintf( ':%s:%s', $this->focus_point_x, $this->focus_point_y );
|
158 |
}
|
90 |
* @var string Resize type string.
|
91 |
*/
|
92 |
private $resize_type = '';
|
93 |
+
/**
|
94 |
+
* Should enlarge.
|
95 |
+
*
|
96 |
+
* @var string Enlarge flag
|
97 |
+
*/
|
98 |
+
private $enlarge = false;
|
99 |
+
/**
|
100 |
+
* Global default enlarge.
|
101 |
+
*
|
102 |
+
* @var string Enlarge flag
|
103 |
+
*/
|
104 |
+
public static $default_enlarge = false;
|
105 |
|
106 |
/**
|
107 |
* Gravity type.
|
124 |
*/
|
125 |
public function set( $value ) {
|
126 |
$this->resize_type = isset( $value['type'] ) ? $value['type'] : '';
|
127 |
+
$this->enlarge = isset( $value['enlarge'] ) ? $value['enlarge'] : self::$default_enlarge;
|
128 |
$this->gravity = isset( $value['gravity'] ) ? is_array( $value['gravity'] ) ? self::GRAVITY_FOCUS_POINT : $value['gravity'] : '';
|
129 |
if ( $this->gravity === self::GRAVITY_FOCUS_POINT ) {
|
130 |
$this->focus_point_x = $value['gravity'][0];
|
152 |
return [
|
153 |
'type' => $this->resize_type,
|
154 |
'gravity' => $this->gravity,
|
155 |
+
'enlarge' => $this->enlarge,
|
156 |
];
|
157 |
}
|
158 |
|
167 |
|
168 |
$resize .= sprintf( '/g:%s', $this->gravity );
|
169 |
|
170 |
+
if ( $this->enlarge ) {
|
171 |
+
$resize .= '/el:1';
|
172 |
+
}
|
173 |
+
|
174 |
if ( $this->gravity === self::GRAVITY_FOCUS_POINT ) {
|
175 |
$resize .= sprintf( ':%s:%s', $this->focus_point_x, $this->focus_point_y );
|
176 |
}
|
inc/lazyload_replacer.php
CHANGED
@@ -255,7 +255,6 @@ final class Optml_Lazyload_Replacer extends Optml_App_Replacer {
|
|
255 |
return false;
|
256 |
}
|
257 |
}
|
258 |
-
|
259 |
if ( false === Optml_Filters::should_do_image( $url, self::$filters[ Optml_Settings::FILTER_TYPE_LAZYLOAD ][ Optml_Settings::FILTER_FILENAME ] ) ) {
|
260 |
return false;
|
261 |
}
|
255 |
return false;
|
256 |
}
|
257 |
}
|
|
|
258 |
if ( false === Optml_Filters::should_do_image( $url, self::$filters[ Optml_Settings::FILTER_TYPE_LAZYLOAD ][ Optml_Settings::FILTER_FILENAME ] ) ) {
|
259 |
return false;
|
260 |
}
|
inc/manager.php
CHANGED
@@ -65,6 +65,10 @@ final class Optml_Manager {
|
|
65 |
'essential_grid',
|
66 |
'yith_quick_view',
|
67 |
'cache_enabler',
|
|
|
|
|
|
|
|
|
68 |
);
|
69 |
|
70 |
/**
|
65 |
'essential_grid',
|
66 |
'yith_quick_view',
|
67 |
'cache_enabler',
|
68 |
+
'elementor_builder',
|
69 |
+
'divi_builder',
|
70 |
+
'thrive',
|
71 |
+
'master_slider',
|
72 |
);
|
73 |
|
74 |
/**
|
inc/url_replacer.php
CHANGED
@@ -89,7 +89,7 @@ final class Optml_Url_Replacer extends Optml_App_Replacer {
|
|
89 |
|
90 |
Optml_Quality::$default_quality = $this->to_accepted_quality( $this->settings->get_quality() );
|
91 |
Optml_Image::$watermark = new Optml_Watermark( $this->settings->get_site_settings()['watermark'] );
|
92 |
-
|
93 |
add_filter( 'optml_content_url', array( $this, 'build_image_url' ), 1, 2 );
|
94 |
|
95 |
}
|
@@ -153,7 +153,10 @@ final class Optml_Url_Replacer extends Optml_App_Replacer {
|
|
153 |
if ( $new_url !== $url ) {
|
154 |
if ( ! isset( $args['quality'] ) || $args['quality'] !== 'eco' ) {
|
155 |
list( $args['width'], $args['height'], $crop ) = $this->parse_dimensions_from_filename( $url );
|
156 |
-
|
|
|
|
|
|
|
157 |
if ( $crop ) {
|
158 |
$args['resize'] = $this->to_optml_crop( $crop );
|
159 |
}
|
89 |
|
90 |
Optml_Quality::$default_quality = $this->to_accepted_quality( $this->settings->get_quality() );
|
91 |
Optml_Image::$watermark = new Optml_Watermark( $this->settings->get_site_settings()['watermark'] );
|
92 |
+
Optml_Resize::$default_enlarge = apply_filters( 'optml_always_enlarge', false );
|
93 |
add_filter( 'optml_content_url', array( $this, 'build_image_url' ), 1, 2 );
|
94 |
|
95 |
}
|
153 |
if ( $new_url !== $url ) {
|
154 |
if ( ! isset( $args['quality'] ) || $args['quality'] !== 'eco' ) {
|
155 |
list( $args['width'], $args['height'], $crop ) = $this->parse_dimensions_from_filename( $url );
|
156 |
+
if ( ! $crop ) {
|
157 |
+
$sizes2crop = self::size_to_crop();
|
158 |
+
$crop = isset( $sizes2crop[ $args['width'] . $args['height'] ] ) ? $sizes2crop[ $args['width'] . $args['height'] ] : false;
|
159 |
+
}
|
160 |
if ( $crop ) {
|
161 |
$args['resize'] = $this->to_optml_crop( $crop );
|
162 |
}
|
optimole-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Image optimization service by Optimole
|
4 |
* Description: Complete handling of your website images.
|
5 |
-
* Version: 2.2.
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
@@ -75,7 +75,7 @@ function optml() {
|
|
75 |
define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
|
76 |
define( 'OPTML_JS_CDN', 'd5jmkjjpb7yfg.cloudfront.net' );
|
77 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
78 |
-
define( 'OPTML_VERSION', '2.2.
|
79 |
define( 'OPTML_NAMESPACE', 'optml' );
|
80 |
define( 'OPTML_BASEFILE', __FILE__ );
|
81 |
// Fallback for old PHP versions when this constant is not defined.
|
2 |
/**
|
3 |
* Plugin Name: Image optimization service by Optimole
|
4 |
* Description: Complete handling of your website images.
|
5 |
+
* Version: 2.2.5
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
75 |
define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
|
76 |
define( 'OPTML_JS_CDN', 'd5jmkjjpb7yfg.cloudfront.net' );
|
77 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
78 |
+
define( 'OPTML_VERSION', '2.2.5' );
|
79 |
define( 'OPTML_NAMESPACE', 'optml' );
|
80 |
define( 'OPTML_BASEFILE', __FILE__ );
|
81 |
// Fallback for old PHP versions when this constant is not defined.
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: optimole
|
3 |
Tags: image optimization, convert webp, responsive images, lazy load, images, optimization, performance, photos
|
4 |
Requires at least: 4.7
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.4
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
@@ -89,6 +89,17 @@ Premium users will be able to optimize images for more than 25k monthly active u
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
93 |
|
94 |
* **Bug Fixes**
|
2 |
Contributors: optimole
|
3 |
Tags: image optimization, convert webp, responsive images, lazy load, images, optimization, performance, photos
|
4 |
Requires at least: 4.7
|
5 |
+
Tested up to: 5.3
|
6 |
Requires PHP: 5.4
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
#### [Version 2.2.5](https://github.com/Codeinwp/optimole-wp/compare/v2.2.4...v2.2.5) (2019-11-18)
|
93 |
+
|
94 |
+
* **Bug Fixes**
|
95 |
+
* inherit custom sizes desired cropping, adds enlarge compatibility ([84f7056](https://github.com/Codeinwp/optimole-wp/commit/84f7056))
|
96 |
+
|
97 |
+
* **Features**
|
98 |
+
* adds compatibility with multiple slider plugins ([d78fd1b](https://github.com/Codeinwp/optimole-wp/commit/d78fd1b))
|
99 |
+
* improve compatibility with various page builders: Divi, Thrive, Elementor, Beaver ([a4391b4](https://github.com/Codeinwp/optimole-wp/commit/a4391b4))
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
#### [Version 2.2.4](https://github.com/Codeinwp/optimole-wp/compare/v2.2.3...v2.2.4) (2019-11-05)
|
104 |
|
105 |
* **Bug Fixes**
|
themeisle-hash.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"optimole-wp.php":"
|
1 |
+
{"optimole-wp.php":"1a4cbcf1c9ffd092671a99b75c68d0c5"}
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitf672ac0a53fb3c67f899ea4313257832::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit1ec27f5f292e52e41f871b249505a2ac
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit1ec27f5f292e52e41f871b249505a2ac
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitf672ac0a53fb3c67f899ea4313257832
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitf672ac0a53fb3c67f899ea4313257832', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitf672ac0a53fb3c67f899ea4313257832', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitf672ac0a53fb3c67f899ea4313257832::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInitf672ac0a53fb3c67f899ea4313257832::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequiref672ac0a53fb3c67f899ea4313257832($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequiref672ac0a53fb3c67f899ea4313257832($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitf672ac0a53fb3c67f899ea4313257832
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|