Changeset 3159481
- Timestamp:
- 09/29/2024 01:05:13 PM (16 months ago)
- Location:
- avif-support/trunk
- Files:
-
- 13 edited
-
assets/dist/js/admin/settings.min.js (modified) (1 diff)
-
assets/images/avif-test.avif (modified) (previous)
-
gpls-avif-support.php (modified) (1 diff)
-
includes/AJAXs/SettingsAJAX.php (modified) (1 diff)
-
includes/AvifSupport.php (modified) (5 diffs)
-
includes/Core/Core.php (modified) (1 diff)
-
includes/Pages/SettingsPage.php (modified) (1 diff)
-
includes/Plugin.php (modified) (2 diffs)
-
includes/Templates/pages/status-template.php (modified) (6 diffs)
-
includes/Utils/GeneralUtilsTrait.php (modified) (4 diffs)
-
includes/Utils/Img/ImgUtilsTrait.php (modified) (6 diffs)
-
languages/avif-support.pot (modified) (5 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
avif-support/trunk/assets/dist/js/admin/settings.min.js
r3149162 r3159481 1 1 /*! For license information please see settings.min.js.LICENSE.txt */ 2 (()=>{"use strict";function t( ){var e=["996566FtMJyv","preventDefault","5304160YJznDT","click","1tSnoiQ","hide","show",".swal2-container","has","each","text","7051696EpfLbZ","hash","html, body","bs-default","writeText","href","6976690nMcUIh","8660lFefjG","getOrCreateInstance","location","2157yqckgk","44087050PvVlLP","length","toggle","animate","11435823wvJfro","Popover","map","slow","data","6Tiwtup","searchParams","clipboard","get","Tooltip","slice","11saDcpI","target",'[data-bs-toggle="tooltip"]',"delete","querySelectorAll","pathname","top","offset","toString"];return(t=function(){return e})()}function e(r,n){var o=t();return(e=function(t,e){return o[t-=410]})(r,n)}function r(t,e){var n=i();return(r=function(t,e){return n[t-=208]})(t,e)}!function(t,r){for(var n=e,o=t();;)try{if(859258==parseInt(n(420))/1*(-parseInt(n(416))/2)+-parseInt(n(437))/3*(-parseInt(n(434))/4)+parseInt(n(418))/5+parseInt(n(447))/6*(parseInt(n(433))/7)+parseInt(n(427))/8+parseInt(n(442))/9+-parseInt(n(438))/10*(parseInt(n(453))/11))break;o.push(o.shift())}catch(t){o.push(o.shift())}}(t);var n=r;function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n(239),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n(210),a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=n,c={success:s(215),error:"bg-danger",warning:"bg-warning",info:s(240)},u="";i?(u=s(283)+e+'"'+(o[s(225)]?o+"-toast":"")+s(223)+(a?s(278):"")+s(268)+t+s(228),u=jQuery(u),jQuery(document[s(271)])[s(249)](u),new(bootstrap[s(256)])(u)):u=jQuery("."+o+s(224));var l=u.find(s(245));e=e[s(231)](s(222))?e:e in c?c[e]:"bg-primary",u.removeClass(s(258))[s(218)](e),u[s(243)](s(248))[s(238)](t),u[s(281)](),r&&setTimeout((function(){u[s(273)]()}),r),l.on(s(269),(function(){var t=s;i?u.remove():u[t(273)]()}))}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n(281),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=n;"show"===t?jQuery("."+(e||"loader")).removeClass(r(220))[r(281)]():jQuery("."+(e||r(235)))[r(218)](r(220))[r(273)]()}function i(){var t=[".toast-msg","append","css","block","trigger",".alert","</div>","-login-form","Toast","51jOBqxB","bg-primary bg-danger","removeClass","-notice","-register-form","6360440OGvedt","config","login","processing","none","1697015DmkblG",'<div class="toast-body text-white">',"click","1070556LvdZej","body","115162PJAbPq","hide","40218ZdabLQ","9236lGktDj","danger","parseHTML",'<div class="toast-header">\n <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>\n </div>',"blur","paddle_billing_shipping_container","show","prepend",'<div style="z-index:999999999;" class="position-fixed top-50 start-50 translate-middle-x toast ',"#place_order",".input-text, select, input:checkbox","gpls-general","validate","disabled","order_btn_loader","form.checkout","bg-success","display","full_page_loader_wrapper","addClass","closest","d-none","billing|shipping","bg-",'role="alert" aria-live="assertive" aria-atomic="true">\n ',"-toast","length","unblock","-notice, .woocommerce-error"," </div>\n </div>","classes","checkout_error","startsWith","register","forms_popup_loader","general","loader",".woocommerce-notices-wrapper","10409IvTzSD","html","bg-primary","bg-info","prop",'<button type="buttom" class="btn-close" data-bs-dismiss="alert" aria-label="close" ></button>',"find","prefix",".btn-close","remove","forms_popup_container"];return(i=function(){return t})()}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(){c=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),i=new _(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=I(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function p(){}function v(){}function d(){}var y={};u(y,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(L([])));m&&m!==e&&r.call(m,o)&&(y=m);var b=d.prototype=p.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==s(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(h).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function I(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:j}}function j(){return{value:void 0,done:!0}}return v.prototype=d,u(b,"constructor",d),u(d,"constructor",v),v.displayName=u(d,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,i,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new x(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),u(b,i,"Generator"),u(b,o,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function u(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t,e){for(var n=r,o=t();;)try{if(177885==-parseInt(n(272))/1+parseInt(n(274))/2*(-parseInt(n(257))/3)+parseInt(n(275))/4+-parseInt(n(267))/5+parseInt(n(270))/6+-parseInt(n(237))/7+parseInt(n(262))/8)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(i),gpls_avfstw_localize_data;var h=v;function p(){var t=["status","errorCallback","length","success","3lSBUqG","toastDuration","responseText","fireAjax","showToastHeader","ajaxUrl","message","fire","asyncFire","createNewToast","error in ajax","6074212slXvgd","params","completeCallback","danger","data","showToast","1653562KUdrlz","responseJSON","successCallback","27485540IZsHsz","488vNtAyh","complete","9yQHsBo","method","1120215KfPYCV","307072awZGyy","7707384UMUzOn","ajax","168133lKnahD"];return(p=function(){return t})()}function v(t,e){var r=p();return(v=function(t,e){return r[t-=280]})(t,e)}!function(t,e){for(var r=v,n=t();;)try{if(775970==parseInt(r(310))/1+-parseInt(r(301))/2+parseInt(r(284))/3*(parseInt(r(295))/4)+-parseInt(r(309))/5+parseInt(r(311))/6+parseInt(r(313))/7*(parseInt(r(305))/8)+parseInt(r(307))/9*(-parseInt(r(304))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(p),h(287);var d,y,g=function(t,e){function r(t,e,n,o,a,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};l(this,r);var u=h;this[u(289)]=t,this[u(308)]=e,this[u(299)]=n,this.successCallback=o,this[u(281)]=a,this[u(297)]=i,this.showToast=(null==c?void 0:c[u(300)])||!1,this[u(293)]=(null==c?void 0:c.createNewToast)||!1,this[u(285)]=(null==c?void 0:c.toastDuration)||!1,this[u(288)]=(null==c?void 0:c[u(288)])||!1,s&&this[u(291)]()}var n,a,i,s,p;return i=r,s=[{key:t,value:function(){var t=this,e=h;jQuery.ajax({method:this.method,url:this[e(289)],data:this.data,success:function(r){var n,a=e;null!=r&&null!==(n=r[a(299)])&&void 0!==n&&n[a(290)]&&t.showToast&&o(r[a(299)][a(290)],r.data.status,t[a(285)],"",t.showToastHeader,t.createNewToast),t[a(303)](r)},error:function(r){var n,a,i=e;null!=r&&null!==(n=r[i(302)])&&void 0!==n&&null!==(a=n[i(299)])&&void 0!==a&&a.message&&t.showToast&&o(r[i(302)][i(299)][i(290)],r.responseJSON.data[i(280)],t[i(285)],"",t[i(288)],t.createNewToast),t.errorCallback(r)},complete:function(){t[e(297)]()}})}},{key:e,value:(n=c().mark((function t(){var e,r=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=h,t.prev=1,t.next=4,jQuery[e(312)]({method:this[e(308)],url:this[e(289)],data:this.data,success:function(t){var n,a=e;return null!=t&&null!==(n=t[a(299)])&&void 0!==n&&n[a(290)]&&t.data[a(290)][a(282)]&&r[a(300)]&&o(t[a(299)][a(290)],t[a(299)][a(280)],r.toastDuration,"",r[a(288)],r.createNewToast),r[a(303)](t),t},error:function(t){var n,a,i,s,c=e;return console.log(c(294),t),null!=t&&null!==(n=t[c(302)])&&void 0!==n&&null!==(a=n[c(299)])&&void 0!==a&&a[c(290)]&&t.responseJSON[c(299)][c(290)].length&&r[c(300)]&&o(t[c(302)].data.message,t[c(302)][c(299)][c(280)],r[c(285)],"",r[c(288)],r.createNewToast),!(null!=t&&null!==(i=t.responseJSON)&&void 0!==i&&null!==(s=i.data)&&void 0!==s&&s[c(290)])&&null!=t&&t[c(286)]&&r[c(300)]&&o(t.responseText,c(298),r[c(285)],"",r[c(288)],r[c(293)]),r[c(281)](t),null!=t&&t[c(302)]?t[c(302)]:t.responseText},complete:function(){r[e(297)]()}});case 4:return t.abrupt("return",t.sent);case 7:return t.prev=7,t.t0=t.catch(1),t.abrupt("return",null!==t.t0&&void 0!==t.t0&&t.t0.responseJSON?t.t0[e(302)]:t.t0.responseText);case 10:case"end":return t.stop()}}),t,this,[[1,7]])})),a=function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function i(t){u(a,r,o,i,s,"next",t)}function s(t){u(a,r,o,i,s,"throw",t)}i(void 0)}))},function(){return a.apply(this,arguments)})}],s&&f(i.prototype,s),p&&f(i,p),Object.defineProperty(i,"prototype",{writable:!1}),r}(h(291),h(292));function m(t,e){var r=b();return(m=function(t,e){return r[t-=248]})(t,e)}function b(){var t=["4145325BeZTwq","12580428lcTRvE","log","hide","show","resp","action","1884110cKAdEP","prefix","val","1126470estHdg","#default-avif-lib","click","nonce",".avif-quality","629680uLsZdR","ajaxUrl","-loader",":checked","preventDefault",".enable-svg-support",".avif-speed","476969evklkW","2759742ceQFYU","POST"];return(b=function(){return t})()}!function(t,e){for(var r=m,n=t();;)try{if(523838==parseInt(r(255))/1+parseInt(r(265))/2+parseInt(r(268))/3+parseInt(r(248))/4+parseInt(r(258))/5+-parseInt(r(256))/6+-parseInt(r(259))/7)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(b),d=jQuery,y=gpls_avfstw_localize_data,d((function(t){var e=m;d(document).on(e(270),"."+y.prefix+"-save-settings",(function(t){var r=e;t[r(252)]();var n,o,i={lib:d(r(269)).val(),quality:d(r(272))[r(267)](),speed:d(r(254)).val()};d(r(253)).is(r(251))&&(i.svgSupport=!0),n=i,a((o=m)(262),y[o(266)]+o(250)),n[o(271)]=y[o(271)],n[o(264)]=y[o(264)],new g(y[o(249)],o(257),n,(function(t){var e=o;console[e(260)](e(263),t)}),(function(t){console[o(260)]("err",t)}),(function(){var t=o;a(t(261),y[t(266)]+t(250))}),!0,{showToast:!0,createNewToast:!0,toastDuration:3e3,showToastHeader:!1})}))}))})();2 (()=>{"use strict";function t(r,n){var o=e();return(t=function(t,e){return o[t-=280]})(r,n)}function e(){var t=["clipboard","show","Collapse","searchParams","1125flpIKl","7762632lMFXTB","24XCpQIu","each","href","53756okmFOQ","10663163MORHNL","data","has","origin","map","delete","327101WABWJF",'[data-bs-toggle="popover"]',"bs-default","11692329rgwYeU","9YNYWQK","html, body",".gpls-general-clipboard-icon-btn","465CordJw","pathname",".swal2-container","slow","target","hide","getOrCreateInstance",'[data-bs-toggle="tooltip"]',"130620LlghrG","slice","click","animate","toString","querySelectorAll","length","get","toggle","628516McWCxO","8rwYOGD","replaceState","text","offset",'[data-bs-element="collapse"]',"call","Popover"];return(e=function(){return t})()}!function(e,r){for(var n=t,o=e();;)try{if(897745==parseInt(n(286))/1+-parseInt(n(310))/2*(parseInt(n(290))/3)+-parseInt(n(327))/4*(-parseInt(n(293))/5)+parseInt(n(323))/6+parseInt(n(280))/7*(-parseInt(n(311))/8)+-parseInt(n(322))/9*(parseInt(n(301))/10)+parseInt(n(289))/11*(parseInt(n(324))/12))break;o.push(o.shift())}catch(t){o.push(o.shift())}}(e);var r=i;function n(){var t=["464166gkXjkT","removeClass","157451EHClNN","show","1XivyHJ","full_page_loader_wrapper","forms_popup_loader","config","unblock","222085XpVSiO","find","startsWith","empty","gpls-general",".toast-msg","-login-form",".alert","disabled","form.checkout","6fXiLOW","append","addClass","blur","721589kvTNZv","prop",'<div class="alert alert-dismissible fade show alert-',"465FqNaRa","</div>",".btn-close","general","prepend","30flRrjz","bg-","processing","classes","d-none","hide",'" role="alert">',"-toast","Toast","click","474178KDhSvZ","120xkynTv",'<div class="toast-header">\n <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>\n </div>',"-register-form","32eRezca","bg-info","bg-primary bg-danger","paddle_checkout_btn_base","-notice","closest","forms_popup_container","loader","trigger","633464tyJhbt","bg-primary","remove","parseHTML",'<button type="buttom" class="btn-close" data-bs-dismiss="alert" aria-label="close" ></button>',"772LoNQvs","prefix","bg-success",'<div class="toast-body text-white">',"display","none","css","bg-warning","html",".input-text, select, input:checkbox",".woocommerce-notices-wrapper","length","validate","-notice, .woocommerce-error"];return(n=function(){return t})()}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r(287),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r(245),a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=r,c={success:s(293),error:"bg-danger",warning:s(298),info:s(278)},u="";i?(u='<div style="z-index:999999999;" class="position-fixed top-50 start-50 translate-middle-x toast '+e+'"'+(o[s(302)]?o+s(270):"")+'role="alert" aria-live="assertive" aria-atomic="true">\n '+(a?s(275):"")+s(294)+t+" </div>\n </div>",u=jQuery(u),jQuery(document.body)[s(252)](u),new(bootstrap[s(271)])(u)):u=jQuery("."+o+s(270));var l=u.find(s(260));e=e[s(243)](s(264))?e:e in c?c[e]:s(287),u[s(306)](s(279))[s(253)](e),u[s(242)](s(246))[s(299)](t),u[s(308)](),n&&setTimeout((function(){u[s(268)]()}),n),l.on(s(272),(function(){var t=s;i?u[t(288)]():u[t(268)]()}))}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r(308),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=r;t===n(308)?jQuery("."+(e||n(284)))[n(306)](n(267))[n(308)]():jQuery("."+(e||n(284)))[n(253)](n(267))[n(268)]()}function i(t,e){var r=n();return(i=function(t,e){return r[t-=242]})(t,e)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(){c=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=x(i,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,i),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var p={};function h(){}function d(){}function v(){}var y={};u(y,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(j([])));m&&m!==e&&r.call(m,o)&&(y=m);var b=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function n(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==s(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(p).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=f(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=v,u(b,"constructor",v),u(v,"constructor",d),d.displayName=u(v,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,i,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(I.prototype),u(I.prototype,a,(function(){return this})),t.AsyncIterator=I,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new I(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),u(b,i,"Generator"),u(b,o,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function u(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t,e){for(var r=i,n=t();;)try{if(120608==parseInt(r(309))/1*(-parseInt(r(273))/2)+parseInt(r(258))/3*(-parseInt(r(291))/4)+parseInt(r(314))/5*(-parseInt(r(251))/6)+parseInt(r(307))/7*(parseInt(r(277))/8)+parseInt(r(305))/9+-parseInt(r(263))/10*(parseInt(r(255))/11)+-parseInt(r(274))/12*(-parseInt(r(286))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(n),gpls_avfstw_localize_data;var p=g;function h(){var t=["145YDTyIl","createNewToast","success","fireAjax","asyncFire","1338152Ticugy","completeCallback","1040cowrhz","length","message","complete","errorCallback","ajaxUrl","1082457ViwzRY","params","successCallback","111310dVUwgp","responseJSON","showToast","log","532392sWSwFF","ajax","status","16dYyhEq","229386ghdhTh","6010hBNqaF","method","toastDuration","data","367zZWWFp","9BNpyBq","error in ajax","5138322TwbkXS","fire","danger","1507PEwSvf","responseText","showToastHeader","POST"];return(h=function(){return t})()}!function(t,e){for(var r=g,n=t();;)try{if(771952==parseInt(r(347))/1*(parseInt(r(343))/2)+-parseInt(r(348))/3*(parseInt(r(323))/4)+-parseInt(r(357))/5*(-parseInt(r(342))/6)+-parseInt(r(350))/7*(-parseInt(r(341))/8)+parseInt(r(331))/9+parseInt(r(334))/10*(parseInt(r(353))/11)+parseInt(r(338))/12*(-parseInt(r(325))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(h),p(321);var d,v,y=function(t,e){function r(t,e,n,o,a,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};l(this,r);var u=p;this.ajaxUrl=t,this.method=e,this[u(346)]=n,this[u(333)]=o,this[u(329)]=a,this[u(324)]=i,this.showToast=(null==c?void 0:c[u(336)])||!1,this[u(358)]=(null==c?void 0:c[u(358)])||!1,this[u(345)]=(null==c?void 0:c[u(345)])||!1,this[u(355)]=(null==c?void 0:c[u(355)])||!1,s&&this[u(351)]()}var n,a,i,s,h;return i=r,s=[{key:t,value:function(){var t=this,e=p;jQuery[e(339)]({method:this[e(344)],url:this.ajaxUrl,data:this[e(346)],success:function(r){var n,a=e;null!=r&&null!==(n=r[a(346)])&&void 0!==n&&n[a(327)]&&t[a(336)]&&o(r[a(346)][a(327)],r[a(346)].status,t[a(345)],"",t.showToastHeader,t[a(358)]),t[a(333)](r)},error:function(r){var n,a,i=e;null!=r&&null!==(n=r[i(335)])&&void 0!==n&&null!==(a=n[i(346)])&&void 0!==a&&a[i(327)]&&t[i(336)]&&o(r[i(335)][i(346)][i(327)],r[i(335)][i(346)][i(340)],t[i(345)],"",t.showToastHeader,t[i(358)]),t.errorCallback(r)},complete:function(){t[e(324)]()}})}},{key:e,value:(n=c().mark((function t(){var e,r=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=p,t.prev=1,t.next=4,jQuery[e(339)]({method:this[e(344)],url:this[e(330)],data:this[e(346)],success:function(t){var n,a=e;return null!=t&&null!==(n=t[a(346)])&&void 0!==n&&n[a(327)]&&t[a(346)][a(327)][a(326)]&&r.showToast&&o(t[a(346)].message,t[a(346)][a(340)],r[a(345)],"",r[a(355)],r[a(358)]),r[a(333)](t),t},error:function(t){var n,a,i,s,c=e;return console[c(337)](c(349),t),null!=t&&null!==(n=t[c(335)])&&void 0!==n&&null!==(a=n.data)&&void 0!==a&&a[c(327)]&&t[c(335)].data.message[c(326)]&&r[c(336)]&&o(t.responseJSON[c(346)][c(327)],t[c(335)][c(346)][c(340)],r[c(345)],"",r.showToastHeader,r[c(358)]),!(null!=t&&null!==(i=t.responseJSON)&&void 0!==i&&null!==(s=i[c(346)])&&void 0!==s&&s[c(327)])&&null!=t&&t[c(354)]&&r[c(336)]&&o(t[c(354)],c(352),r[c(345)],"",r.showToastHeader,r.createNewToast),r[c(329)](t),null!=t&&t[c(335)]?t[c(335)]:t[c(354)]},complete:function(){r[e(324)]()}});case 4:return t.abrupt("return",t.sent);case 7:return t.prev=7,t.t0=t.catch(1),t.abrupt("return",null!==t.t0&&void 0!==t.t0&&t.t0[e(335)]?t.t0[e(335)]:t.t0.responseText);case 10:case"end":return t.stop()}}),t,this,[[1,7]])})),a=function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function i(t){u(a,r,o,i,s,"next",t)}function s(t){u(a,r,o,i,s,"throw",t)}i(void 0)}))},function(){return a.apply(this,arguments)})}],s&&f(i.prototype,s),h&&f(i,h),Object.defineProperty(i,"prototype",{writable:!1}),r}(p(351),p(322));function g(t,e){var r=h();return(g=function(t,e){return r[t-=321]})(t,e)}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function b(){var t=["#default-avif-lib","POST","err","-loader","876894QszrId","prefix","querySelectorAll","8pJzheL",".avif-speed","action","669290GtIdSp","755947IaJtra","hide","resp","val","113939dHCsWi","25oxHmgE","Tooltip",".avif-package-choose","map","nonce","17728326yrZXmI","log","812604slLWNC","583912BVxHZW","click","preventDefault","-save-settings"];return(b=function(){return t})()}function w(t,e){var r=b();return(w=function(t,e){return r[t-=119]})(t,e)}!function(t,e){for(var r=w,n=t();;)try{if(416789==-parseInt(r(128))/1+parseInt(r(127))/2+-parseInt(r(121))/3+-parseInt(r(141))/4+parseInt(r(133))/5*(-parseInt(r(140))/6)+parseInt(r(132))/7*(-parseInt(r(124))/8)+parseInt(r(138))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(b),d=jQuery,v=gpls_avfstw_localize_data,d((function(t){var e,r=w;d(document).on(r(142),"."+v[r(122)]+r(144),(function(t){var e,n,o=r;t[o(143)](),e={lib:d(o(145)).val(),quality:d(".avif-quality")[o(131)](),speed:d(o(125)).val(),package:d(o(135))[o(131)]()},a("show",v[(n=w)(122)]+"-loader"),e[n(137)]=v.nonce,e[n(126)]=v[n(126)],new y(v.ajaxUrl,n(146),e,(function(t){var e=n;console[e(139)](e(130),t)}),(function(t){var e=n;console.log(e(119),t)}),(function(){var t=n;a(t(129),v.prefix+t(120))}),!0,{showToast:!0,createNewToast:!0,toastDuration:3e3,showToastHeader:!1})})),(e=document[r(123)]('[data-bs-toggle="tooltip"]'),function(t){if(Array.isArray(t))return m(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[r(136)]((function(t){return new(bootstrap[r(134)])(t)}))}))})(); -
avif-support/trunk/gpls-avif-support.php
r3149162 r3159481 3 3 4 4 /** 5 * Plugin Name: AVIF & SVGSupport [GrandPlugins]6 * Description: AVIF & SVG support plugin aims to support avif and svgimages in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif images.5 * Plugin Name: AVIF Support [GrandPlugins] 6 * Description: AVIF support plugin aims to support avif images in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif images. 7 7 * Author: GrandPlugins 8 8 * Author URI: https://grandplugins.com 9 9 * Text Domain: avif-support 10 10 * Std Name: gpls-avfstw-avif-support 11 * Version: 1.1. 011 * Version: 1.1.1 12 12 * Requires at least: 5.3.0 13 13 * Requires PHP: 7.0.0 -
avif-support/trunk/includes/AJAXs/SettingsAJAX.php
r3149162 r3159481 61 61 public function ajax_handle_general_settings() { 62 62 if ( ! empty( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), self::$plugin_info['prefix'] . '-nonce' ) ) { 63 $quality = ! empty( $_POST['quality'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['quality'] ) ) ) : 82;64 $speed = isset( $_POST['speed'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['speed'] ) ) ) : 6;65 $ svg_status = isset( $_POST['svgSupport'] ) ? true : false;63 $quality = ! empty( $_POST['quality'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['quality'] ) ) ) : 82; 64 $speed = isset( $_POST['speed'] ) ? absint( sanitize_text_field( wp_unslash( $_POST['speed'] ) ) ) : 6; 65 $package = ! empty( $_POST['package'] ) ? sanitize_text_field( wp_unslash( $_POST['package'] ) ) : 'imagick'; 66 66 AvifSupport::update_settings( 67 67 array( 68 'quality' => $quality,69 'speed' => $speed,70 ' allow_svg' => $svg_status,68 'quality' => $quality, 69 'speed' => $speed, 70 'package' => $package, 71 71 ) 72 72 ); -
avif-support/trunk/includes/AvifSupport.php
r3149162 r3159481 50 50 self::$settings_key = self::$plugin_info['prefix'] . '-avif-support'; 51 51 self::$default_settings = array( 52 'lib' => 'imagick',53 'quality' => 82,54 'speed' => 6,55 ' allow_svg' => false,52 'lib' => 'imagick', 53 'quality' => 82, 54 'speed' => 6, 55 'package' => 'imagick', 56 56 ); 57 57 } … … 78 78 $settings = array_merge( self::$default_settings, $settings ); 79 79 return ( is_null( $key ) ? $settings : ( isset( $settings[ $key ] ) ? $settings[ $key ] : false ) ); 80 }81 82 /**83 * IS SVG Support Enabled.84 * @return bool85 */86 public static function is_svg_support_enabled() {87 return self::get_settings( 'allow_svg' );88 80 } 89 81 … … 167 159 // if it's 6.5^, bail. they already handle it. 168 160 if ( version_compare( $wp_version, '6.5', '>=' ) ) { 161 if ( $this->is_upload_avif() && $this->is_both_supported() && ( 'gd' === self::get_settings( 'package' ) ) ) { 162 $editors = array_reverse( $editors ); 163 } 169 164 return $editors; 170 165 } … … 175 170 176 171 $supported_gd_editor_class = __NAMESPACE__ . '\AVIFGDEditor'; 172 173 if ( $this->is_upload_avif() && $this->is_both_supported() && ( 'gd' === self::get_settings( 'package' ) ) ) { 174 $editors = array_reverse( $editors ); 175 } 177 176 178 177 // Filter GD editor with our editor. … … 450 449 } 451 450 451 /** 452 * Check if both libs are supporting AVIF. 453 * 454 * @return boolean 455 */ 456 private function is_both_supported() { 457 return ( self::is_type_supported( 'avif', 'gd' ) && self::is_type_supported( 'avif', 'imagick' ) ); 458 } 459 460 /** 461 * Is uploading AVIF image. 462 * 463 * @return boolean 464 */ 465 private function is_upload_avif() { 466 if ( ! empty( $_FILES['async-upload'] ) && ! empty( $_FILES['async-upload']['type'] ) && ( 'image/avif' === $_FILES['async-upload']['type'] ) ) { 467 return true; 468 } 469 return false; 470 } 471 452 472 } -
avif-support/trunk/includes/Core/Core.php
r3149162 r3159481 125 125 ); 126 126 $this->plugins_list = array( 127 'woo-lemonsqueezy-checkout' => array( 128 'title' => 'Woo Lemonsqueezy Checkout', 129 'desc' => 'Integrate Lemonsqueezy payment gateway with WooCommerce. Accept payments, manage subscriptions, and streamline your digital product sales effortlessly.', 130 'thumbnail' => 'woo-lemonsqueezy-checkout.webp', 131 'pro_link' => 'https://grandplugins.com/product/woo-lemonsqueezy-gateway/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], 132 ), 133 'woo-paypal-checkout' => array( 134 'title' => 'Woo Paypal Checkout', 135 'desc' => 'integrates PayPal payment options seamlessly into your WooCommerce store. It allows customers to complete purchases directly from checkout, single product page, and shop pages with ease.', 136 'thumbnail' => 'woo-paypal-checkout.webp', 137 'pro_link' => 'https://grandplugins.com/product/woo-paypal-checkout/?utm_source=free&utm_medium=sidebar&utm_content=' . $this->plugin_info['name'], 138 ), 127 139 'woo-gift-cards' => array( 128 140 'title' => 'Woo Gift Cards', -
avif-support/trunk/includes/Pages/SettingsPage.php
r3149162 r3159481 46 46 protected function prepare() { 47 47 $this->page_props = array( 48 'menu_title' => esc_html__( 'AVIF & SVGSupport', 'avif-support' ),48 'menu_title' => esc_html__( 'AVIF Support', 'avif-support' ), 49 49 'page_title' => '', 50 50 'parent_slug' => 'upload.php', -
avif-support/trunk/includes/Plugin.php
r3149162 r3159481 6 6 use GPLSCore\GPLS_PLUGIN_AVFSTW\Base; 7 7 use GPLSCore\GPLS_PLUGIN_AVFSTW\AvifSupport; 8 use GPLSCore\GPLS_PLUGIN_AVFSTW\SVGSupport;9 8 use function GPLSCore\GPLS_PLUGIN_AVFSTW\Pages\PagesBase\setup_pages; 10 9 use function GPLSCore\GPLS_PLUGIN_AVFSTW\AJAXs\Base\setup_ajaxs; … … 23 22 public static function load() { 24 23 AvifSupport::init(); 25 SVGSupport::init();26 24 setup_pages(); 27 25 setup_ajaxs(); -
avif-support/trunk/includes/Templates/pages/status-template.php
r3149162 r3159481 18 18 <div class="notice notice-error avif-reqs py-2 px-3"> 19 19 <span><?php esc_html_e( 'AVIF image will be uploaded, but sub-sizes will not be generated', 'avif-support' ); ?></span> 20 </div>21 <?php endif; ?>22 <?php if ( ! $template_page::is_type_supported( 'svg' ) ) : ?>23 <div class="notice notice-error avif-reqs py-2 px-3">24 <span><?php esc_html_e( 'SVG image will be uploaded, but sub-sizes will not be generated', 'avif-support' ); ?></span>25 20 </div> 26 21 <?php endif; ?> … … 52 47 $template_page::install_and_version_icon( 'red' ); 53 48 } else { 54 $template_page::install_and_version_icon( $template_page::is_type_supported( 'avif', 'gd' ) ? 'green' : ' red', $template_page->get_gd_version());49 $template_page::install_and_version_icon( $template_page::is_type_supported( 'avif', 'gd' ) ? 'green' : 'yellow', $template_page->get_gd_version(), 'gd' ); 55 50 } 56 51 ?> … … 70 65 $is_imagick_enabled = $template_page::is_imagick_enabled( 'avif' ); 71 66 if ( $is_imagick_enabled && $template_page->get_imagick_version() ) { 72 $template_page::install_and_version_icon( $template_page::is_type_supported( 'avif', 'imagick' ) ? 'green' : ' red', $template_page->get_imagick_version());67 $template_page::install_and_version_icon( $template_page::is_type_supported( 'avif', 'imagick' ) ? 'green' : 'yellow', $template_page->get_imagick_version(), 'imagick' ); 73 68 74 69 } else { … … 97 92 </li> 98 93 </ul> 99 <ul class="mt-5 list-group">100 <!-- SVG Support -->101 <li class="list-group-item">102 <div class="row">103 <div class="col-md-6 border-end">104 <span class="item-key"><?php esc_html_e( 'SVG Support', 'avif-support' ); ?> <span><?php $core->new_keyword( 'New', false ); ?></span></span>105 </div>106 <div class="col-md-6 text-end">107 <span class="item-value">108 <?php109 $is_svg_supported = $template_page::is_type_supported( 'svg' );110 $template_page::install_and_version_icon( $is_svg_supported ? 'green' : 'red', ( ! $is_svg_supported ? 'Not ' : '' ) . 'Supported' );111 ?>112 </span>113 </div>114 </div>115 </li>116 </ul>117 94 </div> 118 95 … … 120 97 <?php $template_page::loader_html( $plugin_info['prefix'] ); ?> 121 98 <h5 class="mb-5 p-3 bg-light"><?php esc_html_e( 'General settings', 'avif-support' ); ?></h5> 122 <!-- Enable SVG Support -->123 <div class="mb-3">124 <label for="svg-support-status" class="form-label"><?php esc_html_e( 'Enable SVG upload', 'avif-support' ); ?></label>125 <input <?php checked( true, $settings['allow_svg'] ); ?> style="margin-left:10px;" type="checkbox" class="form-control enable-svg-support" value="on">126 <span><?php $core->new_keyword( 'New', false ); ?></span>127 </div>128 99 <!-- Quality --> 129 100 <div class="mb-3"> … … 139 110 <small><?php esc_html_e( '( 0: slow - smaller image ) - ( 10: fast - larger image ). default is 6', 'avif-support' ); ?></small> 140 111 </div> 141 142 112 <?php if ( $template_page::is_type_supported( 'avif', 'gd' ) && $template_page::is_type_supported( 'avif', 'imagick' ) ) : ?> 113 <!-- Lib Choice --> 114 <div class="mb-3"> 115 <label for="package-choose" class="form-label"><?php esc_html_e( 'Package used', 'avif-support' ); ?></label> 116 <select class="form-control avif-package-choose" id="package-choose"> 117 <option <?php selected( 'imagick', $settings['package'] ); ?> value="imagick"><?php echo esc_html( 'Imagick' ); ?></option> 118 <option <?php selected( 'gd', $settings['package'] ); ?> value="gd"><?php echo esc_html( 'GD' ); ?></option> 119 </select> 120 <small><?php esc_html_e( 'Choose which package to use to process AVIF images ( Imagick or GD ) Imagick is used by default.', 'avif-support' ); ?></small> 121 </div> 122 <?php endif; ?> 143 123 <button class=" mt-3 button button-primary <?php echo esc_attr( $plugin_info['prefix'] . '-save-settings' ); ?>"><?php esc_html_e( 'Save', 'avif-support' ); ?></button> 144 124 </div> -
avif-support/trunk/includes/Utils/GeneralUtilsTrait.php
r3016879 r3159481 1 1 <?php 2 2 namespace GPLSCore\GPLS_PLUGIN_AVFSTW\Utils; 3 4 defined( 'ABSPATH' ) || exit; 5 6 use GPLSCore\GPLS_PLUGIN_AVFSTW\Utils\Img\ImgUtilsTrait; 3 7 4 8 /** … … 6 10 */ 7 11 trait GeneralUtilsTrait { 12 13 use ImgUtilsTrait; 8 14 9 15 /** … … 177 183 * @return void 178 184 */ 179 public static function install_and_version_icon( $status = 'green', $version = '' ) {185 public static function install_and_version_icon( $status = 'green', $version = '', $lib = 'imagick' ) { 180 186 if ( 'red' === $status ) { 181 187 ?> … … 197 203 <span class="install-status-icon led-green mx-2 align-middle" style="margin: 0 auto;width: 24px;height: 24px;background-color: #fff476;border-radius: 50%;box-shadow: rgb(0 0 0 / 20%) 0 -1px 7px 1px, inset #c0d510 0 -1px 9px, #d0db27 0 2px 12px;display: inline-block;"></span> 198 204 <span class="align-middle"><?php echo esc_attr( $version ); ?></span> 205 <?php 206 $fail_details = self::test_avif_img_check( $lib ); 207 if ( is_string( $fail_details ) ) : 208 ?> 209 <span class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-title="<?php echo esc_html( $fail_details ); ?>">?</span> 210 <?php endif; ?> 199 211 </div> 200 212 <?php -
avif-support/trunk/includes/Utils/Img/ImgUtilsTrait.php
r3149162 r3159481 13 13 */ 14 14 public static function is_imagick_enabled( $for_avif = true ) { 15 return ( extension_loaded( 'imagick' ) && class_exists( '\Imagick', false ) && class_exists( '\ImagickPixel', false ) && ( $for_avif ? self::test_avif_img_check( 'imagick' ) : self::test_svg_img_check( 'imagick' ) ));15 return ( extension_loaded( 'imagick' ) && class_exists( '\Imagick', false ) && class_exists( '\ImagickPixel', false ) ); 16 16 } 17 17 … … 22 22 */ 23 23 public static function is_gd_enabled( $for_avif = true ) { 24 return ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) && ( $for_avif ? self::test_avif_img_check( 'gd' ) : self::test_svg_img_check( 'gd' ) ) ); 25 } 26 27 /** 28 * Test AVIF Image check. 29 * 30 * @return boolean 31 */ 32 public static function test_avif_img_check( $lib = 'gd' ) { 33 $test_avif_img_path = static::$plugin_info['path'] . 'assets/images/avif-test.avif'; 34 if ( 'gd' === $lib ) { 35 return self::test_avif_img_gd( $test_avif_img_path ); 36 } elseif ( 'imagick' === $lib ) { 37 return self::test_img_imagick( $test_avif_img_path ); 38 } 39 return false; 40 } 41 42 /** 43 * Test SVG Image check. 44 * 45 * @return boolean 46 */ 47 public static function test_svg_img_check( $lib = 'gd' ) { 48 $test_avif_img_path = static::$plugin_info['path'] . 'assets/images/svg-test.svg'; 49 if ( 'gd' === $lib ) { 50 return false; 51 } elseif ( 'imagick' === $lib ) { 52 return self::test_img_imagick( $test_avif_img_path ); 53 } 54 return false; 55 } 56 57 /** 58 * Test AVIF Image using GD lib. 59 * 60 * @param string $img_path 61 * @return boolean 62 */ 63 public static function test_avif_img_gd( $img_path ) { 64 if ( ! function_exists( 'imagecreatefromavif' ) ) { 65 return false; 66 } 67 try { 68 return ( false !== imagecreatefromavif( $img_path ) ); 69 } catch ( \Exception $e ) { 70 return false; 71 } 72 } 73 74 /** 75 * Test AVIF Image using Imagick. 76 * 77 * @param string $img_path 78 * @return boolean 79 */ 80 public static function test_img_imagick( $img_path ) { 81 try { 82 $imgick = new \Imagick(); 83 $img_read = $imgick->readImage( $img_path ); 84 if ( ! $img_read ) { 85 return false; 86 } 87 return ( true === $imgick->writeImage( $img_path ) ); 88 } catch ( \Exception $e ) { 89 return false; 90 } 24 return ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ); 91 25 } 92 26 … … 364 298 foreach ( $gd_info as $gd_key => $gd_value ) { 365 299 if ( str_starts_with( strtolower( $gd_key ), strtolower( $type ) ) && $gd_value ) { 366 return true; 300 $gd_check = true; 301 break; 367 302 } 368 303 } 369 304 } 370 305 306 if ( $gd_check ) { 307 $gd_check = true === self::test_avif_img_check( 'gd' ) ? true : false; 308 } 309 371 310 if ( 'gd' === $lib_type ) { 311 372 312 return $gd_check; 373 313 } … … 382 322 } 383 323 324 if ( $imagick_check ) { 325 $imagick_check = true === self::test_avif_img_check( 'imagick' ) ? true : false; 326 } 327 384 328 if ( 'imagick' === $lib_type ) { 385 329 return $imagick_check; … … 388 332 return $gd_check || $imagick_check; 389 333 } 334 335 /** 336 * Test AVIF Image check. 337 * 338 * @return string|true 339 */ 340 public static function test_avif_img_check( $lib = 'gd' ) { 341 $test_avif_img_path = static::$plugin_info['path'] . 'assets/images/avif-test.avif'; 342 if ( 'gd' === $lib ) { 343 return self::test_avif_img_gd( $test_avif_img_path ); 344 } elseif ( 'imagick' === $lib ) { 345 return self::test_img_imagick( $test_avif_img_path ); 346 } 347 return false; 348 } 349 350 /** 351 * Test AVIF Image using GD lib. 352 * 353 * @param string $img_path 354 * @return string|true 355 */ 356 public static function test_avif_img_gd( $img_path ) { 357 if ( ! function_exists( 'imagecreatefromavif' ) ) { 358 return esc_html__( 'imagecreatefromavif function doesn\'t exist', 'avif-support' ); 359 } 360 if ( ! function_exists( 'imageavif' ) ) { 361 return esc_html__( 'imageavif function doesn\'t exist', 'avif-support' ); 362 } 363 try { 364 return ( false !== imagecreatefromavif( $img_path ) ); 365 } catch ( \Exception $e ) { 366 return $e->getMessage(); 367 } 368 } 369 370 /** 371 * Test AVIF Image using Imagick. 372 * 373 * @param string $img_path 374 * @return string|true 375 */ 376 public static function test_img_imagick( $img_path ) { 377 try { 378 $imgick = new \Imagick(); 379 $img_read = $imgick->readImage( $img_path ); 380 if ( ! $img_read ) { 381 return esc_html__( 'Failed to read test AVIF image', 'avif-support' ); 382 } 383 return ( true === $imgick->writeImage( $img_path ) ); 384 } catch ( \Exception $e ) { 385 return $e->getMessage(); 386 } 387 } 388 390 389 391 390 /** … … 405 404 'heic' => 'image/heic', 406 405 'avif' => 'image/avif', 407 'svg' => 'image/svg+xml',408 406 ); 409 407 } -
avif-support/trunk/languages/avif-support.pot
r3149162 r3159481 1 1 # Copyright (C) 2024 GrandPlugins 2 # This file is distributed under the same license as the AVIF & SVGSupport [GrandPlugins] plugin.2 # This file is distributed under the same license as the AVIF Support [GrandPlugins] plugin. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: AVIF & SVG Support [GrandPlugins] 1.1.0\n"5 "Project-Id-Version: AVIF Support [GrandPlugins] 1.1.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gpls-avif-support\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-09- 10T10:37:35+00:00\n"12 "POT-Creation-Date: 2024-09-29T11:56:08+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 17 17 #. Plugin Name of the plugin 18 18 #: C:\laragon\www\AVIF-Support\wp-content\plugins\gpls-avif-support\gpls-avif-support.php 19 msgid "AVIF & SVGSupport [GrandPlugins]"19 msgid "AVIF Support [GrandPlugins]" 20 20 msgstr "" 21 21 22 22 #. Description of the plugin 23 23 #: C:\laragon\www\AVIF-Support\wp-content\plugins\gpls-avif-support\gpls-avif-support.php 24 msgid "AVIF & SVG support plugin aims to support avif and svgimages in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif images."24 msgid "AVIF support plugin aims to support avif images in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif images." 25 25 msgstr "" 26 26 … … 44 44 45 45 #: includes/Pages/SettingsPage.php:48 46 msgid "AVIF & SVGSupport"46 msgid "AVIF Support" 47 47 msgstr "" 48 48 … … 59 59 msgstr "" 60 60 61 #: includes/Templates/pages/status-template.php:24 62 msgid "SVG image will be uploaded, but sub-sizes will not be generated" 63 msgstr "" 64 65 #: includes/Templates/pages/status-template.php:32 61 #: includes/Templates/pages/status-template.php:27 66 62 msgid "PHP Version" 67 63 msgstr "" 68 64 69 #: includes/Templates/pages/status-template.php:4 565 #: includes/Templates/pages/status-template.php:40 70 66 msgid "GD Version" 71 67 msgstr "" 72 68 73 #: includes/Templates/pages/status-template.php:6 569 #: includes/Templates/pages/status-template.php:60 74 70 msgid "ImageMagick Version" 75 71 msgstr "" 76 72 77 #: includes/Templates/pages/status-template.php:8 673 #: includes/Templates/pages/status-template.php:81 78 74 msgid "AVIF support" 79 75 msgstr "" 80 76 81 #: includes/Templates/pages/status-template.php:104 82 msgid "SVG Support" 83 msgstr "" 84 85 #: includes/Templates/pages/status-template.php:121 77 #: includes/Templates/pages/status-template.php:98 86 78 msgid "General settings" 87 79 msgstr "" 88 80 89 #: includes/Templates/pages/status-template.php:124 90 msgid "Enable SVG upload" 91 msgstr "" 92 93 #: includes/Templates/pages/status-template.php:130 81 #: includes/Templates/pages/status-template.php:101 94 82 msgid "Default quality" 95 83 msgstr "" 96 84 97 #: includes/Templates/pages/status-template.php:1 3385 #: includes/Templates/pages/status-template.php:104 98 86 msgid "select the default quality for processing and creating sub-sizes of AVIF images. default is 82" 99 87 msgstr "" 100 88 101 #: includes/Templates/pages/status-template.php:1 3789 #: includes/Templates/pages/status-template.php:108 102 90 msgid "Speed ( GD only )" 103 91 msgstr "" 104 92 105 #: includes/Templates/pages/status-template.php:1 3993 #: includes/Templates/pages/status-template.php:110 106 94 msgid "( 0: slow - smaller image ) - ( 10: fast - larger image ). default is 6" 107 95 msgstr "" 108 96 109 #: includes/Templates/pages/status-template.php:143 97 #: includes/Templates/pages/status-template.php:115 98 msgid "Package used" 99 msgstr "" 100 101 #: includes/Templates/pages/status-template.php:120 102 msgid "Choose which package to use to process AVIF images ( Imagick or GD ) Imagick is used by default." 103 msgstr "" 104 105 #: includes/Templates/pages/status-template.php:123 110 106 msgid "Save" 111 107 msgstr "" 108 109 #: includes/Utils/Img/ImgUtilsTrait.php:358 110 msgid "imagecreatefromavif function doesn't exist" 111 msgstr "" 112 113 #: includes/Utils/Img/ImgUtilsTrait.php:361 114 msgid "imageavif function doesn't exist" 115 msgstr "" 116 117 #: includes/Utils/Img/ImgUtilsTrait.php:381 118 msgid "Failed to read test AVIF image" 119 msgstr "" -
avif-support/trunk/readme.txt
r3149162 r3159481 1 === AVIF & SVGUploader ===2 Tags: avif, image, svg,wordpress avif, image optimization, avif subsizes1 === AVIF Uploader === 2 Tags: avif, image, wordpress avif, image optimization, avif subsizes 3 3 Tested up to: 6.6 4 4 Requires at least: 5.3.0 5 5 Requires PHP: 7.0.0 6 Stable Tag: 1.1. 07 Version: 1.1. 06 Stable Tag: 1.1.1 7 Version: 1.1.1 8 8 Contributors: grandplugins 9 9 Author: GrandPlugins … … 15 15 16 16 == Description == 17 AVIF & SVG support plugin aims to support avif and svgimages in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif and SVG images.17 AVIF support plugin aims to support avif images in WordPress by overcome wp issues and limits regarding uploading, displaying and generating avif and SVG images. 18 18 19 19 == Features == … … 24 24 * Fix AVIF sub-sizes generation. 25 25 * Fix AVIF downscale image generation. 26 * [New] Allow uploading SVG images.27 * [New] Generate subsizes for SVG images.28 26 29 27 to learn more details about the wp issues the plugin solves, check this article: … … 33 31 == Empower Your Website with Our Additional Plugins == 34 32 33 [Woo Paypal Checkout](https://grandplugins.com/product/woo-paypal-checkout/?utm_source=free&utm_medium=gpls-avfstw-avif-support) 34 35 [Woo Debug Viewer](https://grandplugins.com/product/wp-debug-viewer/?utm_source=free&utm_medium=gpls-avfstw-avif-support) 35 36 36 37 [Woo Order Splitter](https://grandplugins.com/product/woo-order-splitter/?utm_source=free&utm_medium=gpls-avfstw-avif-support)
Note: See TracChangeset
for help on using the changeset viewer.