Version Description
Download this release
Release Info
Developer | optimole |
Plugin | Image optimization & Lazy Load by Optimole |
Version | 3.3.5 |
Comparing to | |
See all releases |
Code changes from version 3.3.4 to 3.3.5
- CHANGELOG.md +6 -0
- inc/compatibilities/facetwp.php +36 -2
- inc/traits/normalizer.php +1 -1
- optimole-wp.php +2 -2
- readme.txt +9 -0
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +2 -2
CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
##### [Version 3.3.4](https://github.com/Codeinwp/optimole-wp/compare/v3.3.3...v3.3.4) (2022-03-25)
|
2 |
|
3 |
* Add support for HEIC/AVIF formats as source input
|
1 |
+
##### [Version 3.3.5](https://github.com/Codeinwp/optimole-wp/compare/v3.3.4...v3.3.5) (2022-03-31)
|
2 |
+
|
3 |
+
#### Fixes
|
4 |
+
- updates compatibility with FacetWP
|
5 |
+
- fixes warning regarding image size calculation
|
6 |
+
|
7 |
##### [Version 3.3.4](https://github.com/Codeinwp/optimole-wp/compare/v3.3.3...v3.3.4) (2022-03-25)
|
8 |
|
9 |
* Add support for HEIC/AVIF formats as source input
|
inc/compatibilities/facetwp.php
CHANGED
@@ -20,20 +20,54 @@ class Optml_facetwp extends Optml_compatibility {
|
|
20 |
* Register integration details.
|
21 |
*/
|
22 |
public function register() {
|
23 |
-
add_filter( 'facetwp_ajax_response', [ $this, '
|
|
|
24 |
}
|
25 |
/**
|
26 |
* Add filter to replace images from api requests.
|
27 |
*
|
|
|
|
|
|
|
28 |
* @param string $output The output before optimization.
|
29 |
* @param array $data More data about the request.
|
30 |
* @return string The output with the optimized images.
|
31 |
*/
|
32 |
-
public function
|
33 |
do_action( 'optml_replacer_setup' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
$output = Optml_Main::instance()->manager->replace_content( $output );
|
35 |
return $output;
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
/**
|
38 |
* Should we early load the compatibility?
|
39 |
*
|
20 |
* Register integration details.
|
21 |
*/
|
22 |
public function register() {
|
23 |
+
add_filter( 'facetwp_ajax_response', [ $this, 'api_replacement_filter' ], 1, 2 );
|
24 |
+
add_action( 'facetwp_inject_template', [ $this, 'api_replacement_action' ], 1 );
|
25 |
}
|
26 |
/**
|
27 |
* Add filter to replace images from api requests.
|
28 |
*
|
29 |
+
* Modifies template for a facetwp template.
|
30 |
+
* NOTE: $output needs to be json decoded before modification and re encoded before returning.
|
31 |
+
*
|
32 |
* @param string $output The output before optimization.
|
33 |
* @param array $data More data about the request.
|
34 |
* @return string The output with the optimized images.
|
35 |
*/
|
36 |
+
public function api_replacement_filter( $output, $data ) {
|
37 |
do_action( 'optml_replacer_setup' );
|
38 |
+
|
39 |
+
$output = json_decode( $output );
|
40 |
+
|
41 |
+
if ( isset( $output->template ) ) {
|
42 |
+
$output->template = Optml_Main::instance()->manager->replace_content( $output->template );
|
43 |
+
}
|
44 |
+
|
45 |
+
// Ignore invalid UTF-8 characters in PHP 7.2+
|
46 |
+
if ( version_compare( phpversion(), '7.2', '<' ) ) {
|
47 |
+
$output = json_encode( $output );
|
48 |
+
} else {
|
49 |
+
$output = json_encode( $output, JSON_INVALID_UTF8_IGNORE );
|
50 |
+
}
|
51 |
$output = Optml_Main::instance()->manager->replace_content( $output );
|
52 |
return $output;
|
53 |
}
|
54 |
+
/**
|
55 |
+
* Add action to replace images from facetwp api requests.
|
56 |
+
*
|
57 |
+
* Modifies template for a non-facetwp template.
|
58 |
+
*
|
59 |
+
* @param array $output The output before optimization.
|
60 |
+
* @return void
|
61 |
+
*/
|
62 |
+
public function api_replacement_action( $output ) {
|
63 |
+
do_action( 'optml_replacer_setup' );
|
64 |
+
|
65 |
+
if ( ! isset( $output['template'] ) || ! function_exists( 'FWP' ) ) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
$output['template'] = Optml_Main::instance()->manager->replace_content( $output['template'] );
|
69 |
+
FWP()->request->output = $output;
|
70 |
+
}
|
71 |
/**
|
72 |
* Should we early load the compatibility?
|
73 |
*
|
inc/traits/normalizer.php
CHANGED
@@ -143,8 +143,8 @@ trait Optml_Normalizer {
|
|
143 |
|
144 |
$enlarge = false;
|
145 |
if ( isset( $crop_args['enlarge'] ) ) {
|
146 |
-
$crop_args = $crop_args['crop'];
|
147 |
$enlarge = $crop_args['enlarge'];
|
|
|
148 |
}
|
149 |
if ( $crop_args === true ) {
|
150 |
return [
|
143 |
|
144 |
$enlarge = false;
|
145 |
if ( isset( $crop_args['enlarge'] ) ) {
|
|
|
146 |
$enlarge = $crop_args['enlarge'];
|
147 |
+
$crop_args = $crop_args['crop'];
|
148 |
}
|
149 |
if ( $crop_args === true ) {
|
150 |
return [
|
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: 3.3.
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
@@ -74,7 +74,7 @@ function optml() {
|
|
74 |
}
|
75 |
define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
|
76 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
77 |
-
define( 'OPTML_VERSION', '3.3.
|
78 |
define( 'OPTML_NAMESPACE', 'optml' );
|
79 |
define( 'OPTML_BASEFILE', __FILE__ );
|
80 |
// 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: 3.3.5
|
6 |
* Author: Optimole
|
7 |
* Author URI: https://optimole.com
|
8 |
* License: GPL-2.0+
|
74 |
}
|
75 |
define( 'OPTML_URL', plugin_dir_url( __FILE__ ) );
|
76 |
define( 'OPTML_PATH', plugin_dir_path( __FILE__ ) );
|
77 |
+
define( 'OPTML_VERSION', '3.3.5' );
|
78 |
define( 'OPTML_NAMESPACE', 'optml' );
|
79 |
define( 'OPTML_BASEFILE', __FILE__ );
|
80 |
// Fallback for old PHP versions when this constant is not defined.
|
readme.txt
CHANGED
@@ -94,6 +94,15 @@ Premium users will be able to optimize images starting with more than 25k monthl
|
|
94 |
|
95 |
== Changelog ==
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
##### [Version 3.3.4](https://github.com/Codeinwp/optimole-wp/compare/v3.3.3...v3.3.4) (2022-03-25)
|
98 |
|
99 |
* Add support for HEIC/AVIF formats as source input
|
94 |
|
95 |
== Changelog ==
|
96 |
|
97 |
+
##### [Version 3.3.5](https://github.com/Codeinwp/optimole-wp/compare/v3.3.4...v3.3.5) (2022-03-31)
|
98 |
+
|
99 |
+
#### Fixes
|
100 |
+
- updates compatibility with FacetWP
|
101 |
+
- fixes warning regarding image size calculation
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
##### [Version 3.3.4](https://github.com/Codeinwp/optimole-wp/compare/v3.3.3...v3.3.4) (2022-03-25)
|
107 |
|
108 |
* Add support for HEIC/AVIF formats as source input
|
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 ComposerAutoloaderInit3c0d5c9417450fb03b6a01c4367512b7::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 ComposerAutoloaderInitddd4a04df47eac135ef58942521e1b1b
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
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 __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,12 +51,12 @@ class ComposerAutoloaderInitddd4a04df47eac135ef58942521e1b1b
|
|
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;
|
@@ -68,7 +68,7 @@ class ComposerAutoloaderInitddd4a04df47eac135ef58942521e1b1b
|
|
68 |
* @param string $file
|
69 |
* @return void
|
70 |
*/
|
71 |
-
function
|
72 |
{
|
73 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
74 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit3c0d5c9417450fb03b6a01c4367512b7
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit3c0d5c9417450fb03b6a01c4367512b7', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit3c0d5c9417450fb03b6a01c4367512b7', '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 __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit3c0d5c9417450fb03b6a01c4367512b7::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\ComposerStaticInit3c0d5c9417450fb03b6a01c4367512b7::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequire3c0d5c9417450fb03b6a01c4367512b7($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
68 |
* @param string $file
|
69 |
* @return void
|
70 |
*/
|
71 |
+
function composerRequire3c0d5c9417450fb03b6a01c4367512b7($fileIdentifier, $file)
|
72 |
{
|
73 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
74 |
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
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',
|
@@ -17,7 +17,7 @@ class ComposerStaticInitddd4a04df47eac135ef58942521e1b1b
|
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
-
$loader->classMap =
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit3c0d5c9417450fb03b6a01c4367512b7
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
+
$loader->classMap = ComposerStaticInit3c0d5c9417450fb03b6a01c4367512b7::$classMap;
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|