Version Description
Download this release
Release Info
Developer | optimole |
Plugin | Image optimization & Lazy Load by Optimole |
Version | 2.5.5 |
Comparing to | |
See all releases |
Code changes from version 2.5.4 to 2.5.5
- CHANGELOG.md +5 -0
- inc/admin.php +4 -18
- inc/url_replacer.php +1 -1
- optimole-wp.php +2 -2
- readme.txt +8 -0
- 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,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
##### [Version 2.5.4](https://github.com/Codeinwp/optimole-wp/compare/v2.5.3...v2.5.4) (2020-09-21)
|
2 |
|
3 |
* Fix compatibility with GiveWP
|
1 |
+
##### [Version 2.5.5](https://github.com/Codeinwp/optimole-wp/compare/v2.5.4...v2.5.5) (2020-10-19)
|
2 |
+
|
3 |
+
* Fix compatibility with image urls which had uppercase image extensions
|
4 |
+
* Improve CLS web vital for the lazyloading mechanism.
|
5 |
+
|
6 |
##### [Version 2.5.4](https://github.com/Codeinwp/optimole-wp/compare/v2.5.3...v2.5.4) (2020-09-21)
|
7 |
|
8 |
* Fix compatibility with GiveWP
|
inc/admin.php
CHANGED
@@ -149,7 +149,6 @@ class Optml_Admin {
|
|
149 |
return;
|
150 |
}
|
151 |
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
|
152 |
-
add_filter( 'body_class', array( $this, 'adds_body_classes' ) );
|
153 |
add_action( 'wp_head', array( $this, 'inline_bootstrap_script' ) );
|
154 |
|
155 |
}
|
@@ -226,7 +225,7 @@ class Optml_Admin {
|
|
226 |
}
|
227 |
}(window, document));
|
228 |
document.addEventListener( "DOMContentLoaded", function() {
|
229 |
-
|
230 |
if ( "loading" in HTMLImageElement.prototype && Object.prototype.hasOwnProperty.call( optimoleData, "nativeLazyload" ) && optimoleData.nativeLazyload === true ) {
|
231 |
const images = document.querySelectorAll(\'img[loading="lazy"]\');
|
232 |
images.forEach( function (img) {
|
@@ -271,19 +270,6 @@ class Optml_Admin {
|
|
271 |
wp_localize_script( 'optml-report', 'reportScript', $report_script );
|
272 |
}
|
273 |
|
274 |
-
/**
|
275 |
-
* Adds body class for no-js.
|
276 |
-
*
|
277 |
-
* @param array $classes No js class.
|
278 |
-
*
|
279 |
-
* @return array
|
280 |
-
*/
|
281 |
-
public function adds_body_classes( $classes ) {
|
282 |
-
$classes[] = 'optimole-no-script';
|
283 |
-
|
284 |
-
return $classes;
|
285 |
-
}
|
286 |
-
|
287 |
/**
|
288 |
* Add settings links in the plugin listing page.
|
289 |
*
|
@@ -471,7 +457,7 @@ class Optml_Admin {
|
|
471 |
|
472 |
wp_register_style( 'optm_lazyload_noscript_style', false );
|
473 |
wp_enqueue_style( 'optm_lazyload_noscript_style' );
|
474 |
-
wp_add_inline_style( 'optm_lazyload_noscript_style', ".
|
475 |
}
|
476 |
|
477 |
/**
|
@@ -798,8 +784,8 @@ The root cause might be either a security plugin which blocks this feature or so
|
|
798 |
'sample_image_loading' => __( 'Loading a sample image. ', 'optimole-wp' ),
|
799 |
'save_changes' => __( 'Save changes', 'optimole-wp' ),
|
800 |
'show' => __( 'Show', 'optimole-wp' ),
|
801 |
-
'size_desc' => __( 'We
|
802 |
-
'size_title' => __( 'Resize large images.', 'optimole-wp' ),
|
803 |
'toggle_ab_item' => __( 'Admin bar status', 'optimole-wp' ),
|
804 |
'toggle_lazyload' => __( 'Scale images & Lazy load', 'optimole-wp' ),
|
805 |
'toggle_scale' => __( 'Scale Images', 'optimole-wp' ),
|
149 |
return;
|
150 |
}
|
151 |
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
|
|
|
152 |
add_action( 'wp_head', array( $this, 'inline_bootstrap_script' ) );
|
153 |
|
154 |
}
|
225 |
}
|
226 |
}(window, document));
|
227 |
document.addEventListener( "DOMContentLoaded", function() {
|
228 |
+
|
229 |
if ( "loading" in HTMLImageElement.prototype && Object.prototype.hasOwnProperty.call( optimoleData, "nativeLazyload" ) && optimoleData.nativeLazyload === true ) {
|
230 |
const images = document.querySelectorAll(\'img[loading="lazy"]\');
|
231 |
images.forEach( function (img) {
|
270 |
wp_localize_script( 'optml-report', 'reportScript', $report_script );
|
271 |
}
|
272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
/**
|
274 |
* Add settings links in the plugin listing page.
|
275 |
*
|
457 |
|
458 |
wp_register_style( 'optm_lazyload_noscript_style', false );
|
459 |
wp_enqueue_style( 'optm_lazyload_noscript_style' );
|
460 |
+
wp_add_inline_style( 'optm_lazyload_noscript_style', ":not(.optimole_has_js) img[data-opt-src] { display: none !important; } \n " . $bg_css );
|
461 |
}
|
462 |
|
463 |
/**
|
784 |
'sample_image_loading' => __( 'Loading a sample image. ', 'optimole-wp' ),
|
785 |
'save_changes' => __( 'Save changes', 'optimole-wp' ),
|
786 |
'show' => __( 'Show', 'optimole-wp' ),
|
787 |
+
'size_desc' => __( 'We resize all images with sizes greater than the values defined here. Changing this option is not recommended unless large images are not being processed correctly. This does NOT affect the scaling of images on the frontend.', 'optimole-wp' ),
|
788 |
+
'size_title' => __( 'Resize large images original source.', 'optimole-wp' ),
|
789 |
'toggle_ab_item' => __( 'Admin bar status', 'optimole-wp' ),
|
790 |
'toggle_lazyload' => __( 'Scale images & Lazy load', 'optimole-wp' ),
|
791 |
'toggle_scale' => __( 'Scale Images', 'optimole-wp' ),
|
inc/url_replacer.php
CHANGED
@@ -149,7 +149,7 @@ final class Optml_Url_Replacer extends Optml_App_Replacer {
|
|
149 |
if ( substr( $url, 0, 2 ) === '//' ) {
|
150 |
$url = sprintf( '%s:%s', is_ssl() ? 'https' : 'http', $url );
|
151 |
}
|
152 |
-
if ( isset( Optml_Config::$image_extensions[ $ext ] ) ) {
|
153 |
$new_url = $this->normalize_image( $url, $original_url, $args );
|
154 |
} else {
|
155 |
$new_url = ( new Optml_Asset( $url, $args, $this->active_cache_buster, $this->is_css_minify_on, $this->is_js_minify_on ) )->get_url();
|
149 |
if ( substr( $url, 0, 2 ) === '//' ) {
|
150 |
$url = sprintf( '%s:%s', is_ssl() ? 'https' : 'http', $url );
|
151 |
}
|
152 |
+
if ( isset( Optml_Config::$image_extensions[ strtolower( $ext ) ] ) ) {
|
153 |
$new_url = $this->normalize_image( $url, $original_url, $args );
|
154 |
} else {
|
155 |
$new_url = ( new Optml_Asset( $url, $args, $this->active_cache_buster, $this->is_css_minify_on, $this->is_js_minify_on ) )->get_url();
|
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.5.
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
@@ -77,7 +77,7 @@ function optml() {
|
|
77 |
define( 'OPTML_JS_CDN', 'd5jmkjjpb7yfg.cloudfront.net' );
|
78 |
}
|
79 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
80 |
-
define( 'OPTML_VERSION', '2.5.
|
81 |
define( 'OPTML_NAMESPACE', 'optml' );
|
82 |
define( 'OPTML_BASEFILE', __FILE__ );
|
83 |
// 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.5.5
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
77 |
define( 'OPTML_JS_CDN', 'd5jmkjjpb7yfg.cloudfront.net' );
|
78 |
}
|
79 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
80 |
+
define( 'OPTML_VERSION', '2.5.5' );
|
81 |
define( 'OPTML_NAMESPACE', 'optml' );
|
82 |
define( 'OPTML_BASEFILE', __FILE__ );
|
83 |
// Fallback for old PHP versions when this constant is not defined.
|
readme.txt
CHANGED
@@ -89,6 +89,14 @@ Premium users will be able to optimize images for more than 25k monthly active u
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
##### [Version 2.5.4](https://github.com/Codeinwp/optimole-wp/compare/v2.5.3...v2.5.4) (2020-09-21)
|
93 |
|
94 |
* Fix compatibility with GiveWP
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
##### [Version 2.5.5](https://github.com/Codeinwp/optimole-wp/compare/v2.5.4...v2.5.5) (2020-10-19)
|
93 |
+
|
94 |
+
* Fix compatibility with image urls which had uppercase image extensions
|
95 |
+
* Improve CLS web vital for the lazyloading mechanism.
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
##### [Version 2.5.4](https://github.com/Codeinwp/optimole-wp/compare/v2.5.3...v2.5.4) (2020-09-21)
|
101 |
|
102 |
* Fix compatibility with GiveWP
|
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 ComposerAutoloaderInite02236a563060aff99a1060892a3c131::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 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInite02236a563060aff99a1060892a3c131
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInite02236a563060aff99a1060892a3c131', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInite02236a563060aff99a1060892a3c131', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInite02236a563060aff99a1060892a3c131::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInite02236a563060aff99a1060892a3c131::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequiree02236a563060aff99a1060892a3c131($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequiree02236a563060aff99a1060892a3c131($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
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 ComposerStaticInite02236a563060aff99a1060892a3c131
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|