Plugin Directory

Changeset 3076002

Timestamp:
04/23/2024 05:15:48 PM (3 months ago)
Author:
nosilver4u
Message:

tagging and releasing 3.9.0

Location:
easy-image-optimizer
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-image-optimizer/tags/3.9.0/changelog.txt

    r3069168 r3076002  
     1
     2
     3
     4
     5
     6
     7
     8
    19= 3.8.0 =
    210*Release Date - April 11, 2024*
  • easy-image-optimizer/tags/3.9.0/classes/class-exactdn.php

    r3069168 r3076002  
    121121     */
    122122    private $sub_folder = false;
     123
     124
     125
     126
     127
     128
     129
     130
    123131
    124132    /**
     
    258266        \add_action( 'easyio_verification_checkin', array( $this, 'health_check' ) );
    259267
     268
     269
     270
     271
    260272        // Images in post content and galleries.
    261273        \add_filter( 'the_content', array( $this, 'filter_the_content' ), 999999 );
     
    301313        // Filter for generic use by other plugins/themes.
    302314        \add_filter( 'exactdn_local_to_cdn_url', array( $this, 'plugin_get_image_url' ) );
     315
     316
     317
    303318
    304319        // Filter to check for Elementor full_width layouts.
     
    411426        $this->allowed_domains   = \apply_filters( 'exactdn_allowed_domains', $this->allowed_domains );
    412427        $this->debug_message( 'allowed domains: ' . \implode( ',', $this->allowed_domains ) );
     428
    413429        $this->get_allowed_paths();
    414430        $this->validate_user_exclusions();
     
    641657                    $this->set_exactdn_option( 'verified', 1, false );
    642658                    $this->set_exactdn_option( 'verify_method', -1, false ); // After initial activation, use simpler API verification.
     659
     660
     661
     662
    643663                    \add_action( 'admin_notices', $this->prefix . 'notice_exactdn_activation_success' );
    644664                    return true;
     
    687707                    $this->set_exactdn_option( 'plan_id', (int) $response['plan_id'] );
    688708                    $this->plan_id = (int) $response['plan_id'];
     709
     710
     711
     712
    689713                }
    690714                $this->debug_message( 'exactdn verification via API succeeded' );
     
    20892113                $content = \preg_replace( '#(https?:)?//(?:www\.)?' . $escaped_upload_domain . '((?:/[^"\'?&>:/]+?){0,3})/(nextgen-image|' . $this->include_path . '|' . $this->content_path . ')/#i', '$1//' . $this->exactdn_domain . '$2/$3/', $content );
    20902114            }
     2115
     2116
     2117
     2118
     2119
     2120
     2121
     2122
     2123
     2124
     2125
     2126
     2127
     2128
    20912129            $content = \str_replace( '?wpcontent-bypass?', $this->content_path, $content );
    20922130            $content = $this->replace_fonts( $content );
     
    32023240
    32033241    /**
     3242
     3243
     3244
     3245
     3246
     3247
     3248
     3249
     3250
     3251
     3252
     3253
     3254
     3255
     3256
     3257
     3258
     3259
     3260
     3261
     3262
    32043263     * Ensure image URL is valid for ExactDN.
    32053264     * Though ExactDN functions address some of the URL issues, we should avoid unnecessary processing if we know early on that the image isn't supported.
     
    40154074        }
    40164075
     4076
     4077
     4078
     4079
     4080
    40174081        // Make sure this is an allowed image domain/hostname for ExactDN on this site.
    4018         if ( ! $this->allow_image_domain( $parsed_url['host'] ) ) {
     4082        if ( ! $this->allow_image_domain( $parsed_url['host'] ) ) {
    40194083            $this->debug_message( "invalid host for ExactDN: {$parsed_url['host']}" );
    40204084            return $url;
     
    40264090            $this->debug_message( 'url already has exactdn domain' );
    40274091            return $url;
    4028         }
    4029 
    4030         $scheme = $this->scheme;
    4031         if ( isset( $parsed_url['scheme'] ) && 'https' === $parsed_url['scheme'] ) {
    4032             $scheme = 'https';
    40334092        }
    40344093
     
    40724131
    40734132        $exactdn_url = $scheme . '://' . $this->exactdn_domain . '/' . \ltrim( $parsed_url['path'], '/' ) . '?' . $parsed_url['query'];
     4133
     4134
     4135
    40744136        $this->debug_message( "exactdn css/script url: $exactdn_url" );
    40754137        return $this->url_scheme( $exactdn_url, $scheme );
  • easy-image-optimizer/tags/3.9.0/classes/class-plugin.php

    r3069168 r3076002  
    218218        \add_option( 'exactdn_sub_folder', false );
    219219        \add_option( 'exactdn_prevent_db_queries', true );
     220
    220221        \add_option( 'easyio_add_missing_dims', true );
    221222        \add_option( 'easyio_lazy_load', false );
  • easy-image-optimizer/tags/3.9.0/easy-image-optimizer.php

    r3069168 r3076002  
    1414Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert.
    1515Author: Exactly WWW
    16 Version: 3.8.0
     16Version: 3..0
    1717Requires at least: 6.3
    1818Requires PHP: 8.0
     
    3030    add_action( 'admin_notices', 'easyio_unsupported_php' );
    3131} elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) {
    32     define( 'EASYIO_VERSION', 380 );
     32    define( 'EASYIO_VERSION', 30 );
    3333
    3434    /**
  • easy-image-optimizer/tags/3.9.0/includes/eio.js

    r2408733 r3076002  
    1212        }
    1313    });
    14     function HSregister() {
    15         if (typeof(Beacon) !== 'undefined' ) {
     14    ) {
     15        ) {
    1616            $('.easyio-overrides-nav').click(function() {
    1717                event.preventDefault();
     
    3636                Beacon('article', hsid, { type: 'modal' });
    3737            });
    38         }
     38        }
    3939    }
    40     HSregister();
    4140    $('#easyio-general-settings').show();
    4241    $('li.easyio-general-nav').addClass('easyio-selected');
  • easy-image-optimizer/tags/3.9.0/includes/lazysizes-post.js

    r2940483 r3076002  
    5050                    var targetHeight = Math.round(e.target.offsetHeight * dPR);
    5151                    if ( 0 === bg.search(/\[/) ) {
    52                     } else if (!shouldAutoScale(e.target)||!shouldAutoScale(e.target.parentNode)){
     52                    } else if (!shouldAutoScale(e.target)){
    5353                    } else if (lazySizes.hC(e.target,'wp-block-cover')) {
    5454                        console.log('found wp-block-cover with data-back');
     
    123123            return false;
    124124        }
    125         if (target.hasAttributes()) {
    126             var attrs = target.attributes
    127             var regNoScale = /skip-autoscale/;
    128             for (var i = attrs.length - 1; i >= 0; i--) {
    129                 if (regNoScale.test(attrs[i].name)) {
    130                     console.log('autoscale disabled by attr');
    131                     return false;
    132                 }
    133                 if (regNoScale.test(attrs[i].value)) {
    134                     console.log('autoscale disabled by attr value');
    135                     return false;
    136                 }
     125        var currentNode = target;
     126        for (var i = 0; i <= 7; i++) {
     127            if (currentNode.hasAttributes()) {
     128                var attrs = currentNode.attributes
     129                var regNoScale = /skip-autoscale/;
     130                for (var i = attrs.length - 1; i >= 0; i--) {
     131                    if (regNoScale.test(attrs[i].name)) {
     132                        console.log('autoscale disabled by attr');
     133                        return false;
     134                    }
     135                    if (regNoScale.test(attrs[i].value)) {
     136                        console.log('autoscale disabled by attr value');
     137                        return false;
     138                    }
     139                }
     140            }
     141            if (currentNode.parentNode && currentNode.parentNode.nodeType === 1 && currentNode.parentNode.hasAttributes) {
     142                currentNode = currentNode.parentNode;
     143            } else {
     144                break;
    137145            }
    138146        }
     
    370378            src = webpsrc;
    371379        }
    372         if (!shouldAutoScale(target)||!shouldAutoScale(target.parentNode)){
     380        if (!shouldAutoScale(target)){
    373381            return;
    374382        }
  • easy-image-optimizer/tags/3.9.0/includes/lazysizes.min.js

    r2940483 r3076002  
    1 var ewww_webp_supported;void 0===ewww_webp_supported&&(ewww_webp_supported=!1),window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.expand=500<document.documentElement.clientHeight&&500<document.documentElement.clientWidth?1e3:740,"undefined"==typeof eio_lazy_vars&&(eio_lazy_vars={exactdn_domain:".exactdn.com",threshold:0,skip_autoscale:0}),50<eio_lazy_vars.threshold&&(window.lazySizesConfig.expand=eio_lazy_vars.threshold),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,n,o){"use strict";var s,l,d={};function c(e,t,a){var i,r;d[e]||(i=n.createElement(t?"link":"script"),r=n.getElementsByTagName("script")[0],t?(i.rel="stylesheet",i.href=e):(i.onload=function(){i.onerror=null,i.onload=null,a()},i.onerror=i.onload,i.src=e),d[e]=!0,d[i.src||i.href]=!0,r.parentNode.insertBefore(i,r))}n.addEventListener&&(l=/\(|\)|\s|'/,s=function(e,t){var a=n.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,i;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&c(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,c(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):c(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,s(a,function(){r.style.backgroundImage="url("+(l.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(i=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,s(i,function(){r.poster=i,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!1))}),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(u,f,g){"use strict";var n;f.addEventListener&&(n=/\(|\)|\s|'/,addEventListener("lazybeforeunveil",function(e){var t,a,i,r;e.detail.instance==g&&(e.defaultPrevented||("none"==e.target.preload&&(e.target.preload="auto"),(i=e.target.getAttribute("data-back"))&&(ewww_webp_supported&&(r=e.target.getAttribute("data-back-webp"))&&(i=r),t=u.devicePixelRatio||1,a=Math.round(e.target.offsetWidth*t),r=Math.round(e.target.offsetHeight*t),0===i.search(/\[/)||o(e.target)&&o(e.target.parentNode)&&(i=g.hC(e.target,"wp-block-cover")?(g.hC(e.target,"has-parallax")?(a=Math.round(u.screen.width*t),r=Math.round(u.screen.height*t)):r<300&&(r=430),s(i,a,r,"bg-cover")):g.hC(e.target,"cover-image")||g.hC(e.target,"elementor-bg")||g.hC(e.target,"et_parallax_bg")||g.hC(e.target,"bg-image-crop")?s(i,a,r,"bg-cover"):s(i,a,r,"bg")),e.target.style.backgroundImage&&-1===e.target.style.backgroundImage.search(/^initial/)?0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',r=e.target.style.backgroundImage+", "+i,e.target.style.backgroundImage=r):e.target.style.backgroundImage=e.target.style.backgroundImage+', url("'+(n.test(i)?JSON.stringify(i):i)+'")':0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',e.target.style.backgroundImage=i):e.target.style.backgroundImage="url("+(n.test(i)?JSON.stringify(i):i)+")")))},!1));function h(e){var t=e.getAttribute("data-eio-rwidth"),e=e.getAttribute("data-eio-rheight");return 1<t&&1<e?{w:t,h:e}:{w:0,h:0}}function m(e,t=!1){var a=u.devicePixelRatio||1,i=Math.round(e.offsetWidth*a),r=Math.round(e.offsetHeight*a),n=e.getAttribute("data-src"),a=e.getAttribute("data-src-webp");ewww_webp_supported&&a&&-1==n.search("webp=1")&&!t&&(n=a),o(e)&&o(e.parentNode)&&(a=e,a=g.hC(a,"et_pb_jt_filterable_grid_item_image")||g.hC(a,"ss-foreground-image")||g.hC(a,"img-crop")?"img-crop":g.hC(a,"object-cover")&&(g.hC(a,"object-top")||g.hC(a,"object-bottom"))?"img-w":g.hC(a,"object-cover")&&(g.hC(a,"object-left")||g.hC(a,"object-right"))?"img-h":g.hC(a,"ct-image")&&g.hC(a,"object-cover")||!a.getAttribute("data-srcset")&&!a.srcset&&a.offsetHeight>a.offsetWidth&&1<l(a)?"img-crop":"img",(a=s(n,i,r,a,t))&&n!=a&&(t&&e.setAttribute("src",a),e.setAttribute("data-src",a)))}var o=function(e){if(1==eio_lazy_vars.skip_autoscale)return!1;if(e.hasAttributes())for(var t=e.attributes,a=/skip-autoscale/,i=t.length-1;0<=i;i--){if(a.test(t[i].name))return!1;if(a.test(t[i].value))return!1}return!0},s=function(e,t,a,i,r=!1){if(null===e)return e;var n=/w=(\d+)/,o=/fit=(\d+),(\d+)/,s=/resize=(\d+),(\d+)/,l=decodeURIComponent(e);if(/\.svg(\?.+)?$/.exec(l))return e;if(0<e.search("\\?")&&0<e.search(eio_lazy_vars.exactdn_domain)){var d=s.exec(l);if(d&&(t<d[1]||r))return"img-w"===i?l.replace(s,"w="+t):"img-h"===i?l.replace(s,"h="+a):l.replace(s,"resize="+t+","+a);s=n.exec(e);if(s&&(t<=s[1]||r)){if("img-h"===i)return l.replace(n,"h="+a);if("bg-cover"!==i&&"img-crop"!==i)return e.replace(n,"w="+t);var c=Math.abs(s[1]-t);return 20<c||a<1080?e.replace(n,"resize="+t+","+a):e}c=o.exec(l);if(c&&(t<c[1]||r)){if("bg-cover"!==i&&"img-crop"!==i)return"img-w"===i?l.replace(o,"w="+t):"img-h"===i?l.replace(o,"h="+a):l.replace(o,"fit="+t+","+a);l=Math.abs(c[1]-t),o=Math.abs(c[2]-a);return 20<l||20<o?e.replace(n,"resize="+t+","+a):e}if(!s&&!c&&!d)return"img"===i?e+"&fit="+t+","+a:"bg-cover"===i||"img-crop"===i?e+"&resize="+t+","+a:"img-h"===i||t<a?e+"&h="+a:e+"&w="+t}return-1==e.search("\\?")&&0<e.search(eio_lazy_vars.exactdn_domain)?"img"===i?e+"?fit="+t+","+a:"bg-cover"===i||"img-crop"===i?e+"?resize="+t+","+a:"img-h"===i||t<a?e+"?h="+a:e+"?w="+t:e},p=function(e){e=/-(\d+)x(\d+)\./.exec(e);return e&&1<e[1]&&1<e[2]?{w:e[1],h:e[2]}:{w:0,h:0}},l=function(e){var t=e.getAttribute("width"),a=e.getAttribute("height");if(1<t&&1<a)return t/a;a=!1;if(a=(a=e.src&&-1<e.src.search("http")?e.src:a)||e.getAttribute("data-src")){var i=p(a);if(i.w&&i.h)return i.w/i.h}i=h(e);if(i.w&&i.h)return i.w/i.h;e=function(e){var t;if(e.srcset?t=e.srcset.split(","):(e=e.getAttribute("data-srcset"))&&(t=e.split(",")),t){var a=0,i=t.length;if(i){for(;a<i;a++){var r,n=t[a].trim().split(" ");!n[0].length||(n=p(n[0])).w&&n.h&&(r=n)}if(r.w&&r.h)return r}}return{w:0,h:0}}(e);return e.w&&e.h?e.w/e.h:0};f.addEventListener("lazybeforesizes",function(e){e.target.getAttribute("data-src");var t=l(e.target);1<e.target.clientHeight&&t&&(t=Math.ceil(t*e.target.clientHeight),e.detail.width+2<t&&(e.detail.width=t)),void 0!==e.target._lazysizesWidth&&e.detail.width<e.target._lazysizesWidth&&(e.detail.width=e.target._lazysizesWidth)}),f.addEventListener("lazybeforeunveil",function(e){var t,a,i,r,n=e.target,o=n.getAttribute("data-srcset");n.naturalWidth&&!o&&1<n.naturalWidth&&1<n.naturalHeight&&(t=u.devicePixelRatio||1,a=n.naturalWidth,i=n.naturalHeight,(e=h(n)).w&&e.w>a&&(a=e.w,i=e.h),a=n.clientWidth&&1.25*n.clientWidth*t<a,i=n.clientHeight&&1.25*n.clientHeight*t<i,(a||i)&&m(n)),ewww_webp_supported&&(!o||(r=n.getAttribute("data-srcset-webp"))&&n.setAttribute("data-srcset",r),(r=n.getAttribute("data-src-webp"))&&n.setAttribute("data-src",r))});function e(e=!1){e.type&&"load"===e.type&&g.autoSizer.checkElems(),u.devicePixelRatio;var t,a=f.getElementsByClassName(g.cfg.loadedClass),i=a.length;if(i)for(t=0;t<i;t++){var r,n,o,s,l,d,c=a[t];c.src&&!c.srcset&&1<c.naturalWidth&&1<c.naturalHeight&&1<c.clientWidth&&1<c.clientHeight&&(r=c.naturalWidth,n=c.naturalHeight,o=u.innerWidth,s=u.innerHeight,l=h(c),d=p(c.src),l.w?o=l.w:d.w&&(o=d.w),l.h?s=l.h:d.h&&(s=d.h),l=c.clientWidth,d=c.clientHeight,(1.1*r<l&&l<=o||1.1*n<d&&d<=s)&&m(c,!0))}}var t,a,i,r,d=(t=e,r=function(){a=null,t()},function(){i=Date.now(),a=a||setTimeout(c,99)});function c(){var e=Date.now()-i;e<99?setTimeout(c,99-e):(u.requestIdleCallback||r)(r)}addEventListener("load",e),addEventListener("resize",d),setTimeout(e,2e4)}),function(e,t){t=t(e,e.document,Date);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:{},function(i,f,n){"use strict";var g,h;if(!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=i.lazySizesConfig||i.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function c(e,t){E(e,t)||e.setAttribute("class",(e[v]("class")||"").trim()+" "+t)}function u(e,t){(t=E(e,t))&&e.setAttribute("class",(e[v]("class")||"").replace(t," "))}function m(e,t){var a;!l&&(a=i.picturefill||h.pf)?(t&&t.src&&!e[v]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}var a,r,t,o,s,p=f.documentElement,l=i.HTMLPictureElement,d="addEventListener",v="getAttribute",e=i[d].bind(i),y=i.setTimeout,b=i.requestAnimationFrame||y,z=i.requestIdleCallback,w=/^picture$/i,C=["load","error","lazyincluded","_lazyloaded"],_={},A=Array.prototype.forEach,E=function(e,t){return _[t]||(_[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),_[t].test(e[v]("class")||"")&&_[t]},x=function(t,a,e){var i=e?d:"removeEventListener";e&&x(t,a),C.forEach(function(e){t[i](e,a)})},L=function(e,t,a,i,r){var n=f.createEvent("Event");return(a=a||{}).instance=g,n.initEvent(t,!i,!r),n.detail=a,e.dispatchEvent(n),n},N=function(e,t){return(getComputedStyle(e,null)||{})[t]},W=function(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a},M=(o=[],s=t=[],k._lsFlush=S,k);function S(){var e=s;for(s=t.length?o:t,r=!(a=!0);e.length;)e.shift()();a=!1}function k(e,t){a&&!t?e.apply(this,arguments):(s.push(e),r||(r=!0,(f.hidden?y:b)(S)))}function H(a,e){return e?function(){M(a)}:function(){var e=this,t=arguments;M(function(){a.apply(e,t)})}}function I(e){function t(){var e=n.now()-i;e<99?y(t,99-e):(z||r)(r)}var a,i,r=function(){a=null,e()};return function(){i=n.now(),a=a||y(t,99)}}var j,R,T,B,O,P,q,F,J,D,$,U,G,K,Q,V,X,Y,Z,ee,te,ae,ie,re,ne,oe,se,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in i&&!/(gle|ing)bot/.test(navigator.userAgent),re=-1,ne=function(e){return(U=null==U?"hidden"==N(f.body,"visibility"):U)||!("hidden"==N(e.parentNode,"visibility")&&"hidden"==N(e,"visibility"))},G=he,Q=ie=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=z&&49<X?function(){z(me,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:H(function(){y(me)},!0),se=H(pe),le=function(e){se({target:e.target})},de=H(function(t,e,a,i,r){var n,o,s,l,d;(s=L(t,"lazybeforeunveil",e)).defaultPrevented||(i&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",i)),n=t[v](h.srcsetAttr),a=t[v](h.srcAttr),r&&(o=(d=t.parentNode)&&w.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(n||a||o),s={target:t},c(t,h.loadingClass),l&&(clearTimeout(T),T=y(ge,2500),x(t,le,!0)),o&&A.call(d.getElementsByTagName("source"),ve),n?t.setAttribute("srcset",n):a&&!o&&(ee.test(t.nodeName)?(i=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(i):1==d&&(e.src=i)):t.src=a),r&&(n||o)&&m(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),M(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),pe(s),t._lazyCache=!0,y(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ie--},!0)}),ue=I(function(){h.loadMode=3,oe()}),{_:function(){O=n.now(),g.elements=f.getElementsByClassName(h.lazyClass),j=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",oe,!0),e("resize",oe,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&b(function(){t.forEach(function(e){e.complete&&ce(e)})})}),i.MutationObserver?new MutationObserver(oe).observe(p,{childList:!0,subtree:!0,attributes:!0}):(p[d]("DOMNodeInserted",oe,!0),p[d]("DOMAttrModified",oe,!0),setInterval(oe,999)),e("hashchange",oe,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[d](e,oe,!0)}),/d$|^c/.test(f.readyState)?be():(e("load",be),f[d]("DOMContentLoaded",oe),y(be,2e4)),g.elements.length?(he(),M._lsFlush()):oe()},checkElems:oe=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(n.now()-Q))<0&&(t=0),e||t<9?Y():y(Y,t))},unveil:ce=function(e){var t,a,i,r;e._lazyRace||(!(r="auto"==(i=(a=Z.test(e.nodeName))&&(e[v](h.sizesAttr)||e[v]("sizes"))))&&R||!a||!e[v]("src")&&!e.srcset||e.complete||E(e,h.errorClass)||!E(e,h.lazyClass))&&(t=L(e,"lazyunveilread").detail,r&&_e.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ie++,de(e,t,r,i,a))},_aLSL:ye});function ge(e){ie--,e&&!(ie<0)&&e.target||(ie=0)}function he(){var e,t,a,i,r,n,o,s,l,d,c,u=g.elements;if((B=h.loadMode)&&ie<8&&(e=u.length)){for(t=0,re++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||g.prematureUnveil&&g.prematureUnveil(u[t]))ce(u[t]);else if((o=u[t][v]("data-expand"))&&(r=+o)||(r=ae),l||(l=!h.expand||h.expand<1?500<p.clientHeight&&500<p.clientWidth?500:370:h.expand,d=(g._defEx=l)*h.expFactor,c=h.hFac,U=null,ae<d&&ie<1&&2<re&&2<B&&!f.hidden?(ae=d,re=0):ae=1<B&&1<re&&ie<6?l:0),s!==r&&(P=innerWidth+r*c,q=innerHeight+r,n=-1*r,s=r),d=u[t].getBoundingClientRect(),($=d.bottom)>=n&&(F=d.top)<=q&&(D=d.right)>=n*c&&(J=d.left)<=P&&($||D||J||F)&&(h.loadHidden||ne(u[t]))&&(R&&ie<3&&!o&&(B<3||re<4)||function(e,t){var a,i=e,r=ne(e);for(F-=t,$+=t,J-=t,D+=t;r&&(i=i.offsetParent)&&i!=f.body&&i!=p;)(r=0<(N(i,"opacity")||1))&&"visible"!=N(i,"overflow")&&(a=i.getBoundingClientRect(),r=D>a.left&&J<a.right&&$>a.top-1&&F<a.bottom+1);return r}(u[t],r))){if(ce(u[t]),i=!0,9<ie)break}else!i&&R&&!a&&ie<4&&re<4&&2<B&&(j[0]||h.preloadAfterLoad)&&(j[0]||!o&&($||D||J||F||"auto"!=u[t][v](h.sizesAttr)))&&(a=j[0]||u[t]);a&&!i&&ce(a)}}function me(){K=!1,Q=n.now(),G()}function pe(e){var t=e.target;t._lazyCache?delete t._lazyCache:(ge(e),c(t,h.loadedClass),u(t,h.loadingClass),x(t,le),L(t,"lazyloaded"))}function ve(e){var t,a=e[v](h.srcsetAttr);(t=h.customMedia[e[v]("data-media")||e[v]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function ye(){3==h.loadMode&&(h.loadMode=2),ue()}function be(){R||(n.now()-O<999?y(be,999):(R=!0,h.loadMode=3,oe(),e("scroll",ye,!0)))}var ze,we,Ce,_e=(we=H(function(e,t,a,i){var r,n,o;if(e._lazysizesWidth=i,e.setAttribute("sizes",i+="px"),w.test(t.nodeName||""))for(n=0,o=(r=t.getElementsByTagName("source")).length;n<o;n++)r[n].setAttribute("sizes",i);a.detail.dataAttr||m(e,a.detail)}),{_:function(){ze=f.getElementsByClassName(h.autosizesClass),e("resize",Ce)},checkElems:Ce=I(function(){var e,t=ze.length;if(t)for(e=0;e<t;e++)Ae(ze[e])}),updateElem:Ae});function Ae(e,t,a){var i=e.parentNode;i&&(a=W(e,i,a),(t=L(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&we(e,i,t,a))}function Ee(){!Ee.i&&f.getElementsByClassName&&(Ee.i=!0,_e._(),fe._())}return y(function(){h.init&&Ee()}),g={cfg:h,autoSizer:_e,loader:fe,init:Ee,uP:m,aC:c,rC:u,hC:E,fire:L,gW:W,rAF:M}});
     1var ewww_webp_supported;void 0===ewww_webp_supported&&(ewww_webp_supported=!1),window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.expand=500<document.documentElement.clientHeight&&500<document.documentElement.clientWidth?1e3:740,"undefined"==typeof eio_lazy_vars&&(eio_lazy_vars={exactdn_domain:".exactdn.com",threshold:0,skip_autoscale:0}),50<eio_lazy_vars.threshold&&(window.lazySizesConfig.expand=eio_lazy_vars.threshold),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,n,o){"use strict";var s,l,d={};function c(e,t,a){var i,r;d[e]||(i=n.createElement(t?"link":"script"),r=n.getElementsByTagName("script")[0],t?(i.rel="stylesheet",i.href=e):(i.onload=function(){i.onerror=null,i.onload=null,a()},i.onerror=i.onload,i.src=e),d[e]=!0,d[i.src||i.href]=!0,r.parentNode.insertBefore(i,r))}n.addEventListener&&(l=/\(|\)|\s|'/,s=function(e,t){var a=n.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,i;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&c(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,c(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):c(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,s(a,function(){r.style.backgroundImage="url("+(l.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(i=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,s(i,function(){r.poster=i,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!1))}),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(u,f,g){"use strict";var n;f.addEventListener&&(n=/\(|\)|\s|'/,addEventListener("lazybeforeunveil",function(e){var t,a,i,r;e.detail.instance==g&&(e.defaultPrevented||("none"==e.target.preload&&(e.target.preload="auto"),(i=e.target.getAttribute("data-back"))&&(ewww_webp_supported&&(r=e.target.getAttribute("data-back-webp"))&&(i=r),t=u.devicePixelRatio||1,a=Math.round(e.target.offsetWidth*t),r=Math.round(e.target.offsetHeight*t),0===i.search(/\[/)||o(e.target)&&=!0,h.loadMode=3,oe(),e("scroll",ye,!0)))}var ze,we,Ce,_e=(we=H(function(e,t,a,i){var r,n,o;if(e._lazysizesWidth=i,e.setAttribute("sizes",i+="px"),w.test(t.nodeName||""))for(n=0,o=(r=t.getElementsByTagName("source")).length;n<o;n++)r[n].setAttribute("sizes",i);a.detail.dataAttr||m(e,a.detail)}),{_:function(){ze=f.getElementsByClassName(h.autosizesClass),e("resize",Ce)},checkElems:Ce=I(function(){var e,t=ze.length;if(t)for(e=0;e<t;e++)Ae(ze[e])}),updateElem:Ae});function Ae(e,t,a){var i=e.parentNode;i&&(a=W(e,i,a),(t=L(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&we(e,i,t,a))}function Ee(){!Ee.i&&f.getElementsByClassName&&(Ee.i=!0,_e._(),fe._())}return y(function(){h.init&&Ee()}),g={cfg:h,autoSizer:_e,loader:fe,init:Ee,uP:m,aC:c,rC:u,hC:E,fire:L,gW:W,rAF:M}});
  • easy-image-optimizer/tags/3.9.0/readme.txt

    r3069168 r3076002  
    55Tested up to: 6.5
    66Requires PHP: 8.0
    7 Stable tag: 3.8.0
     7Stable tag: 3..0
    88License: GPLv3
    99
     
    5757
    5858* If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/easy-image-optimizer/
     59
     60
     61
     62
     63
     64
     65
     66
    5967
    6068= 3.8.0 =
  • easy-image-optimizer/trunk/changelog.txt

    r3069168 r3076002  
     1
     2
     3
     4
     5
     6
     7
     8
    19= 3.8.0 =
    210*Release Date - April 11, 2024*
  • easy-image-optimizer/trunk/classes/class-exactdn.php

    r3069168 r3076002  
    121121     */
    122122    private $sub_folder = false;
     123
     124
     125
     126
     127
     128
     129
     130
    123131
    124132    /**
     
    258266        \add_action( 'easyio_verification_checkin', array( $this, 'health_check' ) );
    259267
     268
     269
     270
     271
    260272        // Images in post content and galleries.
    261273        \add_filter( 'the_content', array( $this, 'filter_the_content' ), 999999 );
     
    301313        // Filter for generic use by other plugins/themes.
    302314        \add_filter( 'exactdn_local_to_cdn_url', array( $this, 'plugin_get_image_url' ) );
     315
     316
     317
    303318
    304319        // Filter to check for Elementor full_width layouts.
     
    411426        $this->allowed_domains   = \apply_filters( 'exactdn_allowed_domains', $this->allowed_domains );
    412427        $this->debug_message( 'allowed domains: ' . \implode( ',', $this->allowed_domains ) );
     428
    413429        $this->get_allowed_paths();
    414430        $this->validate_user_exclusions();
     
    641657                    $this->set_exactdn_option( 'verified', 1, false );
    642658                    $this->set_exactdn_option( 'verify_method', -1, false ); // After initial activation, use simpler API verification.
     659
     660
     661
     662
    643663                    \add_action( 'admin_notices', $this->prefix . 'notice_exactdn_activation_success' );
    644664                    return true;
     
    687707                    $this->set_exactdn_option( 'plan_id', (int) $response['plan_id'] );
    688708                    $this->plan_id = (int) $response['plan_id'];
     709
     710
     711
     712
    689713                }
    690714                $this->debug_message( 'exactdn verification via API succeeded' );
     
    20892113                $content = \preg_replace( '#(https?:)?//(?:www\.)?' . $escaped_upload_domain . '((?:/[^"\'?&>:/]+?){0,3})/(nextgen-image|' . $this->include_path . '|' . $this->content_path . ')/#i', '$1//' . $this->exactdn_domain . '$2/$3/', $content );
    20902114            }
     2115
     2116
     2117
     2118
     2119
     2120
     2121
     2122
     2123
     2124
     2125
     2126
     2127
     2128
    20912129            $content = \str_replace( '?wpcontent-bypass?', $this->content_path, $content );
    20922130            $content = $this->replace_fonts( $content );
     
    32023240
    32033241    /**
     3242
     3243
     3244
     3245
     3246
     3247
     3248
     3249
     3250
     3251
     3252
     3253
     3254
     3255
     3256
     3257
     3258
     3259
     3260
     3261
     3262
    32043263     * Ensure image URL is valid for ExactDN.
    32053264     * Though ExactDN functions address some of the URL issues, we should avoid unnecessary processing if we know early on that the image isn't supported.
     
    40154074        }
    40164075
     4076
     4077
     4078
     4079
     4080
    40174081        // Make sure this is an allowed image domain/hostname for ExactDN on this site.
    4018         if ( ! $this->allow_image_domain( $parsed_url['host'] ) ) {
     4082        if ( ! $this->allow_image_domain( $parsed_url['host'] ) ) {
    40194083            $this->debug_message( "invalid host for ExactDN: {$parsed_url['host']}" );
    40204084            return $url;
     
    40264090            $this->debug_message( 'url already has exactdn domain' );
    40274091            return $url;
    4028         }
    4029 
    4030         $scheme = $this->scheme;
    4031         if ( isset( $parsed_url['scheme'] ) && 'https' === $parsed_url['scheme'] ) {
    4032             $scheme = 'https';
    40334092        }
    40344093
     
    40724131
    40734132        $exactdn_url = $scheme . '://' . $this->exactdn_domain . '/' . \ltrim( $parsed_url['path'], '/' ) . '?' . $parsed_url['query'];
     4133
     4134
     4135
    40744136        $this->debug_message( "exactdn css/script url: $exactdn_url" );
    40754137        return $this->url_scheme( $exactdn_url, $scheme );
  • easy-image-optimizer/trunk/classes/class-plugin.php

    r3069168 r3076002  
    218218        \add_option( 'exactdn_sub_folder', false );
    219219        \add_option( 'exactdn_prevent_db_queries', true );
     220
    220221        \add_option( 'easyio_add_missing_dims', true );
    221222        \add_option( 'easyio_lazy_load', false );
  • easy-image-optimizer/trunk/easy-image-optimizer.php

    r3069168 r3076002  
    1414Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert.
    1515Author: Exactly WWW
    16 Version: 3.8.0
     16Version: 3..0
    1717Requires at least: 6.3
    1818Requires PHP: 8.0
     
    3030    add_action( 'admin_notices', 'easyio_unsupported_php' );
    3131} elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) {
    32     define( 'EASYIO_VERSION', 380 );
     32    define( 'EASYIO_VERSION', 30 );
    3333
    3434    /**
  • easy-image-optimizer/trunk/includes/eio.js

    r2408733 r3076002  
    1212        }
    1313    });
    14     function HSregister() {
    15         if (typeof(Beacon) !== 'undefined' ) {
     14    ) {
     15        ) {
    1616            $('.easyio-overrides-nav').click(function() {
    1717                event.preventDefault();
     
    3636                Beacon('article', hsid, { type: 'modal' });
    3737            });
    38         }
     38        }
    3939    }
    40     HSregister();
    4140    $('#easyio-general-settings').show();
    4241    $('li.easyio-general-nav').addClass('easyio-selected');
  • easy-image-optimizer/trunk/includes/lazysizes-post.js

    r2940483 r3076002  
    5050                    var targetHeight = Math.round(e.target.offsetHeight * dPR);
    5151                    if ( 0 === bg.search(/\[/) ) {
    52                     } else if (!shouldAutoScale(e.target)||!shouldAutoScale(e.target.parentNode)){
     52                    } else if (!shouldAutoScale(e.target)){
    5353                    } else if (lazySizes.hC(e.target,'wp-block-cover')) {
    5454                        console.log('found wp-block-cover with data-back');
     
    123123            return false;
    124124        }
    125         if (target.hasAttributes()) {
    126             var attrs = target.attributes
    127             var regNoScale = /skip-autoscale/;
    128             for (var i = attrs.length - 1; i >= 0; i--) {
    129                 if (regNoScale.test(attrs[i].name)) {
    130                     console.log('autoscale disabled by attr');
    131                     return false;
    132                 }
    133                 if (regNoScale.test(attrs[i].value)) {
    134                     console.log('autoscale disabled by attr value');
    135                     return false;
    136                 }
     125        var currentNode = target;
     126        for (var i = 0; i <= 7; i++) {
     127            if (currentNode.hasAttributes()) {
     128                var attrs = currentNode.attributes
     129                var regNoScale = /skip-autoscale/;
     130                for (var i = attrs.length - 1; i >= 0; i--) {
     131                    if (regNoScale.test(attrs[i].name)) {
     132                        console.log('autoscale disabled by attr');
     133                        return false;
     134                    }
     135                    if (regNoScale.test(attrs[i].value)) {
     136                        console.log('autoscale disabled by attr value');
     137                        return false;
     138                    }
     139                }
     140            }
     141            if (currentNode.parentNode && currentNode.parentNode.nodeType === 1 && currentNode.parentNode.hasAttributes) {
     142                currentNode = currentNode.parentNode;
     143            } else {
     144                break;
    137145            }
    138146        }
     
    370378            src = webpsrc;
    371379        }
    372         if (!shouldAutoScale(target)||!shouldAutoScale(target.parentNode)){
     380        if (!shouldAutoScale(target)){
    373381            return;
    374382        }
  • easy-image-optimizer/trunk/includes/lazysizes.min.js

    r2940483 r3076002  
    1 var ewww_webp_supported;void 0===ewww_webp_supported&&(ewww_webp_supported=!1),window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.expand=500<document.documentElement.clientHeight&&500<document.documentElement.clientWidth?1e3:740,"undefined"==typeof eio_lazy_vars&&(eio_lazy_vars={exactdn_domain:".exactdn.com",threshold:0,skip_autoscale:0}),50<eio_lazy_vars.threshold&&(window.lazySizesConfig.expand=eio_lazy_vars.threshold),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,n,o){"use strict";var s,l,d={};function c(e,t,a){var i,r;d[e]||(i=n.createElement(t?"link":"script"),r=n.getElementsByTagName("script")[0],t?(i.rel="stylesheet",i.href=e):(i.onload=function(){i.onerror=null,i.onload=null,a()},i.onerror=i.onload,i.src=e),d[e]=!0,d[i.src||i.href]=!0,r.parentNode.insertBefore(i,r))}n.addEventListener&&(l=/\(|\)|\s|'/,s=function(e,t){var a=n.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,i;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&c(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,c(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):c(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,s(a,function(){r.style.backgroundImage="url("+(l.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(i=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,s(i,function(){r.poster=i,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!1))}),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(u,f,g){"use strict";var n;f.addEventListener&&(n=/\(|\)|\s|'/,addEventListener("lazybeforeunveil",function(e){var t,a,i,r;e.detail.instance==g&&(e.defaultPrevented||("none"==e.target.preload&&(e.target.preload="auto"),(i=e.target.getAttribute("data-back"))&&(ewww_webp_supported&&(r=e.target.getAttribute("data-back-webp"))&&(i=r),t=u.devicePixelRatio||1,a=Math.round(e.target.offsetWidth*t),r=Math.round(e.target.offsetHeight*t),0===i.search(/\[/)||o(e.target)&&o(e.target.parentNode)&&(i=g.hC(e.target,"wp-block-cover")?(g.hC(e.target,"has-parallax")?(a=Math.round(u.screen.width*t),r=Math.round(u.screen.height*t)):r<300&&(r=430),s(i,a,r,"bg-cover")):g.hC(e.target,"cover-image")||g.hC(e.target,"elementor-bg")||g.hC(e.target,"et_parallax_bg")||g.hC(e.target,"bg-image-crop")?s(i,a,r,"bg-cover"):s(i,a,r,"bg")),e.target.style.backgroundImage&&-1===e.target.style.backgroundImage.search(/^initial/)?0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',r=e.target.style.backgroundImage+", "+i,e.target.style.backgroundImage=r):e.target.style.backgroundImage=e.target.style.backgroundImage+', url("'+(n.test(i)?JSON.stringify(i):i)+'")':0===i.search(/\[/)?((i=JSON.parse(i)).forEach(function(e){n.test(e)&&JSON.stringify(e)}),i='url("'+i.join('"), url("')+'"',e.target.style.backgroundImage=i):e.target.style.backgroundImage="url("+(n.test(i)?JSON.stringify(i):i)+")")))},!1));function h(e){var t=e.getAttribute("data-eio-rwidth"),e=e.getAttribute("data-eio-rheight");return 1<t&&1<e?{w:t,h:e}:{w:0,h:0}}function m(e,t=!1){var a=u.devicePixelRatio||1,i=Math.round(e.offsetWidth*a),r=Math.round(e.offsetHeight*a),n=e.getAttribute("data-src"),a=e.getAttribute("data-src-webp");ewww_webp_supported&&a&&-1==n.search("webp=1")&&!t&&(n=a),o(e)&&o(e.parentNode)&&(a=e,a=g.hC(a,"et_pb_jt_filterable_grid_item_image")||g.hC(a,"ss-foreground-image")||g.hC(a,"img-crop")?"img-crop":g.hC(a,"object-cover")&&(g.hC(a,"object-top")||g.hC(a,"object-bottom"))?"img-w":g.hC(a,"object-cover")&&(g.hC(a,"object-left")||g.hC(a,"object-right"))?"img-h":g.hC(a,"ct-image")&&g.hC(a,"object-cover")||!a.getAttribute("data-srcset")&&!a.srcset&&a.offsetHeight>a.offsetWidth&&1<l(a)?"img-crop":"img",(a=s(n,i,r,a,t))&&n!=a&&(t&&e.setAttribute("src",a),e.setAttribute("data-src",a)))}var o=function(e){if(1==eio_lazy_vars.skip_autoscale)return!1;if(e.hasAttributes())for(var t=e.attributes,a=/skip-autoscale/,i=t.length-1;0<=i;i--){if(a.test(t[i].name))return!1;if(a.test(t[i].value))return!1}return!0},s=function(e,t,a,i,r=!1){if(null===e)return e;var n=/w=(\d+)/,o=/fit=(\d+),(\d+)/,s=/resize=(\d+),(\d+)/,l=decodeURIComponent(e);if(/\.svg(\?.+)?$/.exec(l))return e;if(0<e.search("\\?")&&0<e.search(eio_lazy_vars.exactdn_domain)){var d=s.exec(l);if(d&&(t<d[1]||r))return"img-w"===i?l.replace(s,"w="+t):"img-h"===i?l.replace(s,"h="+a):l.replace(s,"resize="+t+","+a);s=n.exec(e);if(s&&(t<=s[1]||r)){if("img-h"===i)return l.replace(n,"h="+a);if("bg-cover"!==i&&"img-crop"!==i)return e.replace(n,"w="+t);var c=Math.abs(s[1]-t);return 20<c||a<1080?e.replace(n,"resize="+t+","+a):e}c=o.exec(l);if(c&&(t<c[1]||r)){if("bg-cover"!==i&&"img-crop"!==i)return"img-w"===i?l.replace(o,"w="+t):"img-h"===i?l.replace(o,"h="+a):l.replace(o,"fit="+t+","+a);l=Math.abs(c[1]-t),o=Math.abs(c[2]-a);return 20<l||20<o?e.replace(n,"resize="+t+","+a):e}if(!s&&!c&&!d)return"img"===i?e+"&fit="+t+","+a:"bg-cover"===i||"img-crop"===i?e+"&resize="+t+","+a:"img-h"===i||t<a?e+"&h="+a:e+"&w="+t}return-1==e.search("\\?")&&0<e.search(eio_lazy_vars.exactdn_domain)?"img"===i?e+"?fit="+t+","+a:"bg-cover"===i||"img-crop"===i?e+"?resize="+t+","+a:"img-h"===i||t<a?e+"?h="+a:e+"?w="+t:e},p=function(e){e=/-(\d+)x(\d+)\./.exec(e);return e&&1<e[1]&&1<e[2]?{w:e[1],h:e[2]}:{w:0,h:0}},l=function(e){var t=e.getAttribute("width"),a=e.getAttribute("height");if(1<t&&1<a)return t/a;a=!1;if(a=(a=e.src&&-1<e.src.search("http")?e.src:a)||e.getAttribute("data-src")){var i=p(a);if(i.w&&i.h)return i.w/i.h}i=h(e);if(i.w&&i.h)return i.w/i.h;e=function(e){var t;if(e.srcset?t=e.srcset.split(","):(e=e.getAttribute("data-srcset"))&&(t=e.split(",")),t){var a=0,i=t.length;if(i){for(;a<i;a++){var r,n=t[a].trim().split(" ");!n[0].length||(n=p(n[0])).w&&n.h&&(r=n)}if(r.w&&r.h)return r}}return{w:0,h:0}}(e);return e.w&&e.h?e.w/e.h:0};f.addEventListener("lazybeforesizes",function(e){e.target.getAttribute("data-src");var t=l(e.target);1<e.target.clientHeight&&t&&(t=Math.ceil(t*e.target.clientHeight),e.detail.width+2<t&&(e.detail.width=t)),void 0!==e.target._lazysizesWidth&&e.detail.width<e.target._lazysizesWidth&&(e.detail.width=e.target._lazysizesWidth)}),f.addEventListener("lazybeforeunveil",function(e){var t,a,i,r,n=e.target,o=n.getAttribute("data-srcset");n.naturalWidth&&!o&&1<n.naturalWidth&&1<n.naturalHeight&&(t=u.devicePixelRatio||1,a=n.naturalWidth,i=n.naturalHeight,(e=h(n)).w&&e.w>a&&(a=e.w,i=e.h),a=n.clientWidth&&1.25*n.clientWidth*t<a,i=n.clientHeight&&1.25*n.clientHeight*t<i,(a||i)&&m(n)),ewww_webp_supported&&(!o||(r=n.getAttribute("data-srcset-webp"))&&n.setAttribute("data-srcset",r),(r=n.getAttribute("data-src-webp"))&&n.setAttribute("data-src",r))});function e(e=!1){e.type&&"load"===e.type&&g.autoSizer.checkElems(),u.devicePixelRatio;var t,a=f.getElementsByClassName(g.cfg.loadedClass),i=a.length;if(i)for(t=0;t<i;t++){var r,n,o,s,l,d,c=a[t];c.src&&!c.srcset&&1<c.naturalWidth&&1<c.naturalHeight&&1<c.clientWidth&&1<c.clientHeight&&(r=c.naturalWidth,n=c.naturalHeight,o=u.innerWidth,s=u.innerHeight,l=h(c),d=p(c.src),l.w?o=l.w:d.w&&(o=d.w),l.h?s=l.h:d.h&&(s=d.h),l=c.clientWidth,d=c.clientHeight,(1.1*r<l&&l<=o||1.1*n<d&&d<=s)&&m(c,!0))}}var t,a,i,r,d=(t=e,r=function(){a=null,t()},function(){i=Date.now(),a=a||setTimeout(c,99)});function c(){var e=Date.now()-i;e<99?setTimeout(c,99-e):(u.requestIdleCallback||r)(r)}addEventListener("load",e),addEventListener("resize",d),setTimeout(e,2e4)}),function(e,t){t=t(e,e.document,Date);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:{},function(i,f,n){"use strict";var g,h;if(!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(e in h=i.lazySizesConfig||i.lazysizesConfig||{},t)e in h||(h[e]=t[e])}(),!f||!f.getElementsByClassName)return{init:function(){},cfg:h,noSupport:!0};function c(e,t){E(e,t)||e.setAttribute("class",(e[v]("class")||"").trim()+" "+t)}function u(e,t){(t=E(e,t))&&e.setAttribute("class",(e[v]("class")||"").replace(t," "))}function m(e,t){var a;!l&&(a=i.picturefill||h.pf)?(t&&t.src&&!e[v]("srcset")&&e.setAttribute("srcset",t.src),a({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)}var a,r,t,o,s,p=f.documentElement,l=i.HTMLPictureElement,d="addEventListener",v="getAttribute",e=i[d].bind(i),y=i.setTimeout,b=i.requestAnimationFrame||y,z=i.requestIdleCallback,w=/^picture$/i,C=["load","error","lazyincluded","_lazyloaded"],_={},A=Array.prototype.forEach,E=function(e,t){return _[t]||(_[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),_[t].test(e[v]("class")||"")&&_[t]},x=function(t,a,e){var i=e?d:"removeEventListener";e&&x(t,a),C.forEach(function(e){t[i](e,a)})},L=function(e,t,a,i,r){var n=f.createEvent("Event");return(a=a||{}).instance=g,n.initEvent(t,!i,!r),n.detail=a,e.dispatchEvent(n),n},N=function(e,t){return(getComputedStyle(e,null)||{})[t]},W=function(e,t,a){for(a=a||e.offsetWidth;a<h.minSize&&t&&!e._lazysizesWidth;)a=t.offsetWidth,t=t.parentNode;return a},M=(o=[],s=t=[],k._lsFlush=S,k);function S(){var e=s;for(s=t.length?o:t,r=!(a=!0);e.length;)e.shift()();a=!1}function k(e,t){a&&!t?e.apply(this,arguments):(s.push(e),r||(r=!0,(f.hidden?y:b)(S)))}function H(a,e){return e?function(){M(a)}:function(){var e=this,t=arguments;M(function(){a.apply(e,t)})}}function I(e){function t(){var e=n.now()-i;e<99?y(t,99-e):(z||r)(r)}var a,i,r=function(){a=null,e()};return function(){i=n.now(),a=a||y(t,99)}}var j,R,T,B,O,P,q,F,J,D,$,U,G,K,Q,V,X,Y,Z,ee,te,ae,ie,re,ne,oe,se,le,de,ce,ue,fe=(Z=/^img$/i,ee=/^iframe$/i,te="onscroll"in i&&!/(gle|ing)bot/.test(navigator.userAgent),re=-1,ne=function(e){return(U=null==U?"hidden"==N(f.body,"visibility"):U)||!("hidden"==N(e.parentNode,"visibility")&&"hidden"==N(e,"visibility"))},G=he,Q=ie=ae=0,V=h.throttleDelay,X=h.ricTimeout,Y=z&&49<X?function(){z(me,{timeout:X}),X!==h.ricTimeout&&(X=h.ricTimeout)}:H(function(){y(me)},!0),se=H(pe),le=function(e){se({target:e.target})},de=H(function(t,e,a,i,r){var n,o,s,l,d;(s=L(t,"lazybeforeunveil",e)).defaultPrevented||(i&&(a?c(t,h.autosizesClass):t.setAttribute("sizes",i)),n=t[v](h.srcsetAttr),a=t[v](h.srcAttr),r&&(o=(d=t.parentNode)&&w.test(d.nodeName||"")),l=e.firesLoad||"src"in t&&(n||a||o),s={target:t},c(t,h.loadingClass),l&&(clearTimeout(T),T=y(ge,2500),x(t,le,!0)),o&&A.call(d.getElementsByTagName("source"),ve),n?t.setAttribute("srcset",n):a&&!o&&(ee.test(t.nodeName)?(i=a,0==(d=(e=t).getAttribute("data-load-mode")||h.iframeLoadMode)?e.contentWindow.location.replace(i):1==d&&(e.src=i)):t.src=a),r&&(n||o)&&m(t,{src:a})),t._lazyRace&&delete t._lazyRace,u(t,h.lazyClass),M(function(){var e=t.complete&&1<t.naturalWidth;l&&!e||(e&&c(t,h.fastLoadedClass),pe(s),t._lazyCache=!0,y(function(){"_lazyCache"in t&&delete t._lazyCache},9)),"lazy"==t.loading&&ie--},!0)}),ue=I(function(){h.loadMode=3,oe()}),{_:function(){O=n.now(),g.elements=f.getElementsByClassName(h.lazyClass),j=f.getElementsByClassName(h.lazyClass+" "+h.preloadClass),e("scroll",oe,!0),e("resize",oe,!0),e("pageshow",function(e){var t;!e.persisted||(t=f.querySelectorAll("."+h.loadingClass)).length&&t.forEach&&b(function(){t.forEach(function(e){e.complete&&ce(e)})})}),i.MutationObserver?new MutationObserver(oe).observe(p,{childList:!0,subtree:!0,attributes:!0}):(p[d]("DOMNodeInserted",oe,!0),p[d]("DOMAttrModified",oe,!0),setInterval(oe,999)),e("hashchange",oe,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){f[d](e,oe,!0)}),/d$|^c/.test(f.readyState)?be():(e("load",be),f[d]("DOMContentLoaded",oe),y(be,2e4)),g.elements.length?(he(),M._lsFlush()):oe()},checkElems:oe=function(e){var t;(e=!0===e)&&(X=33),K||(K=!0,(t=V-(n.now()-Q))<0&&(t=0),e||t<9?Y():y(Y,t))},unveil:ce=function(e){var t,a,i,r;e._lazyRace||(!(r="auto"==(i=(a=Z.test(e.nodeName))&&(e[v](h.sizesAttr)||e[v]("sizes"))))&&R||!a||!e[v]("src")&&!e.srcset||e.complete||E(e,h.errorClass)||!E(e,h.lazyClass))&&(t=L(e,"lazyunveilread").detail,r&&_e.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,ie++,de(e,t,r,i,a))},_aLSL:ye});function ge(e){ie--,e&&!(ie<0)&&e.target||(ie=0)}function he(){var e,t,a,i,r,n,o,s,l,d,c,u=g.elements;if((B=h.loadMode)&&ie<8&&(e=u.length)){for(t=0,re++;t<e;t++)if(u[t]&&!u[t]._lazyRace)if(!te||g.prematureUnveil&&g.prematureUnveil(u[t]))ce(u[t]);else if((o=u[t][v]("data-expand"))&&(r=+o)||(r=ae),l||(l=!h.expand||h.expand<1?500<p.clientHeight&&500<p.clientWidth?500:370:h.expand,d=(g._defEx=l)*h.expFactor,c=h.hFac,U=null,ae<d&&ie<1&&2<re&&2<B&&!f.hidden?(ae=d,re=0):ae=1<B&&1<re&&ie<6?l:0),s!==r&&(P=innerWidth+r*c,q=innerHeight+r,n=-1*r,s=r),d=u[t].getBoundingClientRect(),($=d.bottom)>=n&&(F=d.top)<=q&&(D=d.right)>=n*c&&(J=d.left)<=P&&($||D||J||F)&&(h.loadHidden||ne(u[t]))&&(R&&ie<3&&!o&&(B<3||re<4)||function(e,t){var a,i=e,r=ne(e);for(F-=t,$+=t,J-=t,D+=t;r&&(i=i.offsetParent)&&i!=f.body&&i!=p;)(r=0<(N(i,"opacity")||1))&&"visible"!=N(i,"overflow")&&(a=i.getBoundingClientRect(),r=D>a.left&&J<a.right&&$>a.top-1&&F<a.bottom+1);return r}(u[t],r))){if(ce(u[t]),i=!0,9<ie)break}else!i&&R&&!a&&ie<4&&re<4&&2<B&&(j[0]||h.preloadAfterLoad)&&(j[0]||!o&&($||D||J||F||"auto"!=u[t][v](h.sizesAttr)))&&(a=j[0]||u[t]);a&&!i&&ce(a)}}function me(){K=!1,Q=n.now(),G()}function pe(e){var t=e.target;t._lazyCache?delete t._lazyCache:(ge(e),c(t,h.loadedClass),u(t,h.loadingClass),x(t,le),L(t,"lazyloaded"))}function ve(e){var t,a=e[v](h.srcsetAttr);(t=h.customMedia[e[v]("data-media")||e[v]("media")])&&e.setAttribute("media",t),a&&e.setAttribute("srcset",a)}function ye(){3==h.loadMode&&(h.loadMode=2),ue()}function be(){R||(n.now()-O<999?y(be,999):(R=!0,h.loadMode=3,oe(),e("scroll",ye,!0)))}var ze,we,Ce,_e=(we=H(function(e,t,a,i){var r,n,o;if(e._lazysizesWidth=i,e.setAttribute("sizes",i+="px"),w.test(t.nodeName||""))for(n=0,o=(r=t.getElementsByTagName("source")).length;n<o;n++)r[n].setAttribute("sizes",i);a.detail.dataAttr||m(e,a.detail)}),{_:function(){ze=f.getElementsByClassName(h.autosizesClass),e("resize",Ce)},checkElems:Ce=I(function(){var e,t=ze.length;if(t)for(e=0;e<t;e++)Ae(ze[e])}),updateElem:Ae});function Ae(e,t,a){var i=e.parentNode;i&&(a=W(e,i,a),(t=L(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&we(e,i,t,a))}function Ee(){!Ee.i&&f.getElementsByClassName&&(Ee.i=!0,_e._(),fe._())}return y(function(){h.init&&Ee()}),g={cfg:h,autoSizer:_e,loader:fe,init:Ee,uP:m,aC:c,rC:u,hC:E,fire:L,gW:W,rAF:M}});
     1var ewww_webp_supported;void 0===ewww_webp_supported&&(ewww_webp_supported=!1),window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.expand=500<document.documentElement.clientHeight&&500<document.documentElement.clientWidth?1e3:740,"undefined"==typeof eio_lazy_vars&&(eio_lazy_vars={exactdn_domain:".exactdn.com",threshold:0,skip_autoscale:0}),50<eio_lazy_vars.threshold&&(window.lazySizesConfig.expand=eio_lazy_vars.threshold),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(e,n,o){"use strict";var s,l,d={};function c(e,t,a){var i,r;d[e]||(i=n.createElement(t?"link":"script"),r=n.getElementsByTagName("script")[0],t?(i.rel="stylesheet",i.href=e):(i.onload=function(){i.onerror=null,i.onload=null,a()},i.onerror=i.onload,i.src=e),d[e]=!0,d[i.src||i.href]=!0,r.parentNode.insertBefore(i,r))}n.addEventListener&&(l=/\(|\)|\s|'/,s=function(e,t){var a=n.createElement("img");a.onload=function(){a.onload=null,a.onerror=null,a=null,t()},a.onerror=a.onload,a.src=e,a&&a.complete&&a.onload&&a.onload()},addEventListener("lazybeforeunveil",function(e){var t,a,i;if(e.detail.instance==o&&!e.defaultPrevented){var r=e.target;if("none"==r.preload&&(r.preload=r.getAttribute("data-preload")||"auto"),null!=r.getAttribute("data-autoplay"))if(r.getAttribute("data-expand")&&!r.autoplay)try{r.play()}catch(e){}else requestAnimationFrame(function(){r.setAttribute("data-expand","-10"),o.aC(r,o.cfg.lazyClass)});(t=r.getAttribute("data-link"))&&c(t,!0),(t=r.getAttribute("data-script"))&&(e.detail.firesLoad=!0,c(t,null,function(){e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(t=r.getAttribute("data-require"))&&(o.cfg.requireJs?o.cfg.requireJs([t]):c(t)),(a=r.getAttribute("data-bg"))&&(e.detail.firesLoad=!0,s(a,function(){r.style.backgroundImage="url("+(l.test(a)?JSON.stringify(a):a)+")",e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)})),(i=r.getAttribute("data-poster"))&&(e.detail.firesLoad=!0,s(i,function(){r.poster=i,e.detail.firesLoad=!1,o.fire(r,"_lazyloaded",{},!0,!0)}))}},!1))}),function(e,t){function a(){t(e.lazySizes),e.removeEventListener("lazyunveilread",a,!0)}t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?a():e.addEventListener("lazyunveilread",a,!0)}(window,function(u,f,g){"use strict";var n;f.addEventListener&&(n=/\(|\)|\s|'/,addEventListener("lazybeforeunveil",function(e){var t,a,i,r;e.detail.instance==g&&(e.defaultPrevented||("none"==e.target.preload&&(e.target.preload="auto"),(i=e.target.getAttribute("data-back"))&&(ewww_webp_supported&&(r=e.target.getAttribute("data-back-webp"))&&(i=r),t=u.devicePixelRatio||1,a=Math.round(e.target.offsetWidth*t),r=Math.round(e.target.offsetHeight*t),0===i.search(/\[/)||o(e.target)&&=!0,h.loadMode=3,oe(),e("scroll",ye,!0)))}var ze,we,Ce,_e=(we=H(function(e,t,a,i){var r,n,o;if(e._lazysizesWidth=i,e.setAttribute("sizes",i+="px"),w.test(t.nodeName||""))for(n=0,o=(r=t.getElementsByTagName("source")).length;n<o;n++)r[n].setAttribute("sizes",i);a.detail.dataAttr||m(e,a.detail)}),{_:function(){ze=f.getElementsByClassName(h.autosizesClass),e("resize",Ce)},checkElems:Ce=I(function(){var e,t=ze.length;if(t)for(e=0;e<t;e++)Ae(ze[e])}),updateElem:Ae});function Ae(e,t,a){var i=e.parentNode;i&&(a=W(e,i,a),(t=L(e,"lazybeforesizes",{width:a,dataAttr:!!t})).defaultPrevented||(a=t.detail.width)&&a!==e._lazysizesWidth&&we(e,i,t,a))}function Ee(){!Ee.i&&f.getElementsByClassName&&(Ee.i=!0,_e._(),fe._())}return y(function(){h.init&&Ee()}),g={cfg:h,autoSizer:_e,loader:fe,init:Ee,uP:m,aC:c,rC:u,hC:E,fire:L,gW:W,rAF:M}});
  • easy-image-optimizer/trunk/readme.txt

    r3069168 r3076002  
    55Tested up to: 6.5
    66Requires PHP: 8.0
    7 Stable tag: 3.8.0
     7Stable tag: 3..0
    88License: GPLv3
    99
     
    5757
    5858* If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/easy-image-optimizer/
     59
     60
     61
     62
     63
     64
     65
     66
    5967
    6068= 3.8.0 =
Note: See TracChangeset for help on using the changeset viewer.