Image optimization & Lazy Load by Optimole - Version 2.5.4

Version Description

Download this release

Release Info

Developer optimole
Plugin Icon 128x128 Image optimization & Lazy Load by Optimole
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  ##### [Version 2.5.3](https://github.com/Codeinwp/optimole-wp/compare/v2.5.2...v2.5.3) (2020-09-07)
2
 
3
  * Improve compatibility with native lazyload from WP 5.5
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
4
+ * Fix compatibility with IE browser
5
+
6
  ##### [Version 2.5.3](https://github.com/Codeinwp/optimole-wp/compare/v2.5.2...v2.5.3) (2020-09-07)
7
 
8
  * Improve compatibility with native lazyload from WP 5.5
inc/admin.php CHANGED
@@ -229,7 +229,7 @@ class Optml_Admin {
229
  document.body.className = document.body.className.replace("optimole-no-script","");
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(img => {
233
  if ( !img.dataset.optSrc) {
234
  return;
235
  }
229
  document.body.className = document.body.className.replace("optimole-no-script","");
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) {
233
  if ( !img.dataset.optSrc) {
234
  return;
235
  }
inc/compatibilities/give_wp.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Optml_elementor_builder
5
+ *
6
+ * @reason Adding selectors for background lazyload
7
+ */
8
+ class Optml_give_wp 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
+ return Optml_Main::instance()->admin->settings->use_lazyload() && is_plugin_active( 'give/give.php' );
19
+ }
20
+
21
+ /**
22
+ * Register integration details.
23
+ */
24
+ public function register() {
25
+
26
+ add_filter( 'optml_should_ignore_image_tags', [$this, 'check_givewp_page'], 10, 1 );
27
+
28
+ if ( Optml_Main::instance()->admin->settings->get( 'video_lazyload' ) === 'enabled' ) {
29
+ add_filter( 'optml_iframe_lazyload_flags', [$this, 'add_ignore_lazyload_iframe'] );
30
+ }
31
+ }
32
+ /**
33
+ * Add ignore page lazyload flag.
34
+ *
35
+ * @param bool $old_value Previous returned value.
36
+ *
37
+ * @return bool If we should lazyload the page.
38
+ */
39
+ public function check_givewp_page( $old_value ) {
40
+ if ( array_key_exists( 'giveDonationFormInIframe', $_GET ) && $_GET['giveDonationFormInIframe'] == '1' ) {
41
+ return true;
42
+ }
43
+ return $old_value;
44
+ }
45
+
46
+ /**
47
+ * Add ignore lazyload iframe flag.
48
+ *
49
+ * @param array $flags Old flags.
50
+ *
51
+ * @return array New flags.
52
+ */
53
+ public function add_ignore_lazyload_iframe( $flags = array() ) {
54
+ $flags[] = 'give-embed-form';
55
+ return $flags;
56
+ }
57
+
58
+ }
59
+
inc/manager.php CHANGED
@@ -75,6 +75,7 @@ final class Optml_Manager {
75
  'swift_performance',
76
  'w3_total_cache',
77
  'translate_press',
 
78
  );
79
  /**
80
  * The current state of the buffer.
@@ -360,7 +361,7 @@ final class Optml_Manager {
360
  return true;
361
  }
362
 
363
- return false;
364
  }
365
 
366
  /**
75
  'swift_performance',
76
  'w3_total_cache',
77
  'translate_press',
78
+ 'give_wp',
79
  );
80
  /**
81
  * The current state of the buffer.
361
  return true;
362
  }
363
 
364
+ return apply_filters( 'optml_should_ignore_image_tags', false ) === true;
365
  }
366
 
367
  /**
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.3
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.3' );
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.4
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.4' );
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.3](https://github.com/Codeinwp/optimole-wp/compare/v2.5.2...v2.5.3) (2020-09-07)
93
 
94
  * Improve compatibility with native lazyload from WP 5.5
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
95
+ * Fix compatibility with IE browser
96
+
97
+
98
+
99
+
100
  ##### [Version 2.5.3](https://github.com/Codeinwp/optimole-wp/compare/v2.5.2...v2.5.3) (2020-09-07)
101
 
102
  * Improve compatibility with native lazyload from WP 5.5
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -60,7 +60,7 @@ class ClassLoader
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
  }
65
 
66
  return array();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56', '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\ComposerStaticInit9475fb7b928b2065c785a22b7217ea56::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit9475fb7b928b2065c785a22b7217ea56
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit9475fb7b928b2065c785a22b7217ea56::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire9475fb7b928b2065c785a22b7217ea56($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire9475fb7b928b2065c785a22b7217ea56($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit3eceef690d51114b0e153ff6e063f2d1', '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\ComposerStaticInit3eceef690d51114b0e153ff6e063f2d1::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\ComposerStaticInit3eceef690d51114b0e153ff6e063f2d1::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire3eceef690d51114b0e153ff6e063f2d1($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire3eceef690d51114b0e153ff6e063f2d1($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 ComposerStaticInit9475fb7b928b2065c785a22b7217ea56
8
  {
9
  public static $files = array (
10
  '9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit3eceef690d51114b0e153ff6e063f2d1
8
  {
9
  public static $files = array (
10
  '9fef4034ed73e26a337d9856ea126f7f' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',