Version Description
(2021/09/07) = * Add: Option to clean the plugin data on uninstall. * Add: Manual Rename now goes through the cleaning flow to make sure everything is clean and nice.
Download this release
Release Info
Developer | TigrouMeow |
Plugin | Media File Renamer |
Version | 5.2.8 |
Comparing to | |
See all releases |
Code changes from version 5.2.7 to 5.2.8
- app/index.js +1 -1
- classes/admin.php +1 -0
- classes/core.php +3 -1
- media-file-renamer.php +2 -2
- readme.txt +5 -1
- uninstall.php +14 -0
app/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(e){function t(t){for(var r,c,l=t[0],i=t[1],u=t[2],m=0,f=[];m<l.length;m++)c=l[m],Object.prototype.hasOwnProperty.call(a,c)&&a[c]&&f.push(a[c][0]),a[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(s&&s(t);f.length;)f.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==a[i]&&(r=!1)}r&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},a={0:0},o=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="";var l=window.wpJsonMfrh=window.wpJsonMfrh||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;o.push([129,1]),n()}({0:function(e,t){e.exports=React},1:function(e,t,n){"use strict";var r=n(14);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(37);var o=n(49);n.d(t,"q",(function(){return o.a}));var c=n(50);n.d(t,"a",(function(){return c.a}));var l=n(51);n.d(t,"g",(function(){return l.a}));var i=n(52);n.d(t,"v",(function(){return i.a}));n(53);var u=n(38);n.d(t,"C",(function(){return u.b})),n.d(t,"f",(function(){return u.a}));var s=n(54);n.d(t,"d",(function(){return s.a}));var m=n(55);n.d(t,"e",(function(){return m.a}));var f=n(21);n.d(t,"k",(function(){return f.a}));n(56);var d=n(39);n.d(t,"u",(function(){return d.b})),n.d(t,"p",(function(){return d.a}));n(57),n(58),n(8),n(40),n(22);var p=n(59);n.d(t,"s",(function(){return p.a}));var h=n(60);n.d(t,"i",(function(){return h.a}));var y=n(23);n.d(t,"r",(function(){return y.a}));var g=n(10);n.d(t,"j",(function(){return g.a}));var v=n(16);n.d(t,"B",(function(){return v.a}));var b=n(41);n.d(t,"t",(function(){return b.b})),n.d(t,"l",(function(){return b.a}));var E=n(61);n.d(t,"h",(function(){return E.a}));var R=n(42);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(62),n(63),n(19);var w=n(24);n.d(t,"o",(function(){return w.a}));n(68);var _=n(69);n.d(t,"x",(function(){return _.a}));var k=n(44);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(45);var O=n(70);n.d(t,"A",(function(){return O.a}));var x=n(3);n.d(t,"z",(function(){return x.a}));var P=n(7);n.d(t,"J",(function(){return P.d})),n.d(t,"H",(function(){return P.b})),n.d(t,"I",(function(){return P.c}));var T=n(15);n.d(t,"G",(function(){return T.d})),n.d(t,"F",(function(){return T.c})),n.d(t,"E",(function(){return T.b})),n.d(t,"D",(function(){return T.a}));n(20)},120:function(e,t){e.exports=ReactDOM},129:function(e,t,n){"use strict";n.r(t);var r=n(12),a=n(1),o=wp.i18n.__,c={};c.RENAME=o("Rename","media-file-renamer"),c.MOVE=o("Move","media-file-renamer"),c.DASHBOARD=o("Dashboard","media-file-renamer"),c.PENDING=o("Pending","media-file-renamer"),c.RENAMED=o("Renamed","media-file-renamer"),c.ALL=o("All","media-file-renamer"),c.THUMB=o("Thumb","media-file-renamer"),c.TITLE=o("Title","media-file-renamer"),c.ATTACHED_TO=o("Attached To","media-file-renamer"),c.FILENAME=o("Filename","media-file-renamer");var l=c,i=mfrh_media_file_renamer.prefix,u=mfrh_media_file_renamer.domain,s=mfrh_media_file_renamer.rest_url.replace(/\/+$/,""),m=mfrh_media_file_renamer.api_url.replace(/\/+$/,""),f=mfrh_media_file_renamer.plugin_url.replace(/\/+$/,""),d="1"===mfrh_media_file_renamer.is_pro,p=d&&"1"===mfrh_media_file_renamer.is_registered,h=mfrh_media_file_renamer.rest_nonce,y="1"===mfrh_media_file_renamer.mfrh_undo,g="1"===mfrh_media_file_renamer.mfrh_move,v="1"===mfrh_media_file_renamer.mfrh_manual_rename;function b(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){b(o,r,a,c,l,"next",e)}function l(e){b(o,r,a,c,l,"throw",e)}c(void 0)}))}}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _,k,O,x,P,T=wp.element,S=T.useState,A=T.useEffect,j=function(e){var t=e.mutate,n=R(S(e.entry),2),r=n[0],o=n[1],c=R(S(!1),2),i=c[0],u=c[1],s=R(S(""),2),f=s[0],d=s[1],p=R(S(null),2),b=p[0],w=p[1],_=e.natural,k=void 0!==_&&_,O=Object(a.I)({concurrency:2}).runTask;A((function(){d(""),e.entry?o(e.entry):e.mediaId&&x(e.mediaId)}),[e.entry]);var x=function(){var e=E(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,O(E(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(a.G)("".concat(m,"/analyze"),{nonce:h,json:{mediaId:t}}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,o(n.data),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=E(regeneratorRuntime.mark((function e(t){var n,r,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<=220)){e.next=3;break}return d(t),e.abrupt("return");case 3:n=t.lastIndexOf("."),r=-1===n?"":".".concat(t.slice(n+1)),a=r.length>0?r.length:0,o="".concat(t.slice(0,220-a)).concat(r),d(o);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=E(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:r.ID}});case 3:t=e.sent,T(t.data),w(null),u((function(e){return e-1}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:r.ID,filename:f}});case 3:t=e.sent,T(t.data),w(null),d(""),u((function(e){return e-1}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/undo"),{nonce:h,json:{mediaId:r.ID}});case 3:t=e.sent,T(t.data,r.current_filename),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/set_lock"),{nonce:h,json:{mediaId:r.ID,lock:!r.locked}});case 3:t=e.sent,T(t.data),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){var e=E(regeneratorRuntime.mark((function e(){var t,n,o,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log({entry:r}),t=r.metadata.file||"",n="/"+t.substring(0,t.lastIndexOf("/")),!(o=(o=(o=prompt("Where would you like to move this file (in the /uploads directory)?",n)).replace(/\/+$/,""))||"/")){e.next=13;break}return u((function(e){return e+1})),e.next=10,Object(a.G)("".concat(m,"/move"),{nonce:h,json:{mediaId:r.ID,newPath:o}});case 10:c=e.sent,T(c.data),u((function(e){return e-1}));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=!!f,B=U?f:b||(null==r?void 0:r.current_filename);return React.createElement(a.b,{busy:i},React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(a.k,{natural:k,readOnly:!v||i,value:B,onChange:P,onEnter:I,maxLength:220,style:{marginRight:0,flex:"auto"}}),!U&&React.createElement(a.j,{icon:null!=r&&r.locked?"lock":"lock-open",width:24,title:null!=r&&r.locked?"Unlock, to allow future actions":"Lock, to avoid future actions",style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:D}),U&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:function(){d("")}}),(null==r?void 0:r.proposed_filename_exists)&&React.createElement(a.j,{icon:"alert",color:"orange",tooltip:{text:"The ideal filename (".concat(r.proposed_filename,") already exists."),position:"left"}}),y&&!U&&(null==r?void 0:r.original_filename)&&React.createElement(a.j,{icon:"file-undo",title:"Rollback to original",color:a.z.red,onClick:C,onMouseEnter:function(){return w(null==r?void 0:r.original_filename)},onMouseLeave:function(){return w(null)}}),!U&&(null==r?void 0:r.proposed_filename)&&!(null!=r&&r.proposed_filename_exists)&&React.createElement(a.c,{style:{marginLeft:5},title:"Rename automatically",onMouseEnter:function(){return w(null==r?void 0:r.proposed_filename)},onMouseLeave:function(){return w(null)},onClick:j},"Auto Rename"),v&&U&&React.createElement(a.c,{style:{marginLeft:5},title:"Rename manually",onClick:I},l.RENAME),g&&React.createElement(a.c,{style:{marginLeft:5},title:"Move",onClick:M},l.MOVE)))},I=n(4);function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var D=I.a.div(_||(_=C(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),M=Object(I.a)(a.a)(k||(k=C(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),U=I.a.img(O||(O=C(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),B=I.a.div(x||(x=C(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n font-family: Lato;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),L=I.a.ul(P||(P=C(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function N(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(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.")}()}function F(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function G(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){F(o,r,a,c,l,"next",e)}function l(e){F(o,r,a,c,l,"throw",e)}c(void 0)}))}}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||z(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Y=wp.element,W=Y.useState,V=Y.useEffect,$="".concat(s,"/meow-common/v1"),J=function(e){var t=e.request,n=e.title,r=e.max,o=q(W(!1),2),c=o[0],l=o[1],i=q(W([]),2),u=i[0],s=i[1],m=u.length>0?u.reduce((function(e,t){return e+t})):0,f=u.length>0?Math.ceil(m/u.length):0,d=!u.length&&c;V((function(){c&&setTimeout(G(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.G)("".concat($,"/").concat(t),{nonce:h});case 3:r=(new Date).getTime(),o=r-n,s((function(e){return[].concat(N(e),[o])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[u]);return React.createElement(D,{style:{width:200,textAlign:"center"}},React.createElement(a.B,{h2:!0,style:{color:"white"}},n),React.createElement(a.h,{size:200,value:d?r:f,max:r},React.createElement("span",{style:{fontSize:20}},d?"START":f+" ms"),React.createElement("span",{style:{fontSize:12}},d?"YOUR ENGINE":u.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:c?"#cc3627":"#ccb027",onClick:function(){c||s([]),l(!c)}},c?"Stop":"Start"))};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Z(o,r,a,c,l,"next",e)}function l(e){Z(o,r,a,c,l,"throw",e)}c(void 0)}))}}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=wp.element,ae=re.useState,oe=re.useEffect;m&&s&&f||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var ce="".concat(s,"/meow-common/v1"),le=React.createElement(D,null,React.createElement(a.B,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),ie=React.createElement(D,null,React.createElement(a.B,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.B,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),ue=React.createElement(D,null,React.createElement(a.B,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.B,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.B,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),se=["".concat(ce,"/all_settings/"),{headers:{"X-WP-Nonce":h}}],me=function(){var e=te(ae(!1),2),t=e[0],n=e[1],o=Object(r.b)(se,a.F),c=o.data,l=o.mutate,i=o.error,u=null==c?void 0:c.data,s=null==u?void 0:u.meowapps_hide_meowapps,m=null==u?void 0:u.force_sslverify,d=te(ae(!1),2),p=d[0],y=d[1],g=te(ae([]),2),v=g[0],b=g[1],E=te(ae(""),2),R=E[0],w=E[1];oe((function(){i&&!t&&(n(!0),console.error("Error from UseSWR",i.message))}),[i]),oe((function(){var e=document.getElementById("meow-common-phpinfo");w(e.innerHTML)}),[]);var _=function(){var e=ee(regeneratorRuntime.mark((function e(t,n){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=Q({},c.data))[n]=t,l(Q(Q({},c),{},{data:r}),!1),y(!0),e.next=6,Object(a.G)("".concat(ce,"/update_option"),{json:{name:n,value:t},nonce:h});case 6:o=e.sent,y(!1),o.success||alert(o.message),l();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),k=function(){var e=ee(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,Object(a.G)("".concat(ce,"/error_logs"),{nonce:h});case 3:t=e.sent,n=t&&t.data?t.data:[],b(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=React.createElement(a.v,{title:"Main Menu"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:s,onChange:_}))),x=React.createElement(a.v,{title:"SSL Verify"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:m,onChange:_})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},le,React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(M,{title:"Media Cleaner",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/media-cleaner.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(M,{title:"Media File Renamer",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/media-file-renamer.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(M,{title:"Contact Form Block",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress."))),React.createElement(M,{title:"Meow Analytics",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.f,{minimal:!0},React.createElement(M,{title:"Meow Gallery",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/meow-gallery.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(M,{title:"Meow Lightbox",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/meow-lightbox.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(M,{title:"Photo Engine",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/wplr-sync.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(M,{title:"Perfect Images + Retina",className:"primary"},React.createElement(U,{src:"".concat(f,"/common/img/wp-retina-2x.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images + Retina")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more.")))))),React.createElement(a.w,{title:"Performance"},ie,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(J,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(J,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(J,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},ue),React.createElement(a.w,{title:"PHP Info"},React.createElement(B,{dangerouslySetInnerHTML:{__html:R}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(D,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:k},"Load PHP Error Logs"),React.createElement(L,null,v.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.w,{title:"Settings"},React.createElement(a.a,{title:"Settings",className:"primary"},O,x))))))};function fe(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){fe(o,r,a,c,l,"next",e)}function l(e){fe(o,r,a,c,l,"throw",e)}c(void 0)}))}}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ye=wp.element,ge=ye.useState,ve=ye.useEffect,be="".concat(s,"/meow-licenser/").concat(i,"/v1"),Ee=function(){var e=pe(ge(!1),2),t=e[0],n=e[1],r=pe(ge(null),2),o=r[0],c=r[1],l=pe(ge(null),2),i=l[0],u=l[1],s=pe(ge(""),2),m=s[0],f=s[1],y=p&&(!i||"valid"!==i.license),g=function(){var e=de(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.G)("".concat(be,"/get_license"),{nonce:h});case 5:t=e.sent,u(t.data),t.data.key&&f(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=de(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(be,"/set_license"),{nonce:h,json:{serialKey:null}});case 3:e.sent.success&&(f(""),u(null),c("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=de(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(be,"/set_license"),{nonce:h,json:{serialKey:m}});case 3:(t=e.sent).success&&(u(t.data),t.data&&!t.data.issue&&c("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ve((function(){g()}),[]);var E=y?"Forced License":p?"Enabled":"Disabled",R=i&&"valid"===i.license,w="Your license is active. Thanks a lot for your support :)";R||(i?"no_activations_left"===i.issue?w=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===i.issue?w=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"Meow Apps Store"),"."):"missing"===i.issue?w="This license does not exist.":"disabled"===i.issue?w="This license has been disabled.":"item_name_mismatch"===i.issue?w="This license seems to be for a different plugin... isn't it? :)":(w=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:i})):w="Unknown error :(");var _=React.createElement(a.a,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com/"},"Meow Apps Store"),"."),k=React.createElement(a.a,{title:"Pro Version (".concat(E,")"),busy:t,className:"primary"},React.createElement(a.v,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.k,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:m,onChange:function(e){return f(e)},placeholder:""})),i&&!R&&React.createElement(a.m,null,w),i&&R&&React.createElement(a.n,null,w),!i&&React.createElement(a.B,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://store.meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.v,{contentAlign:"right"},i&&!R&&React.createElement(a.c,{className:"secondary",disabled:t||!m,onClick:b},"Retry to validate"),i&&i.key===m&&React.createElement(a.c,{className:"secondary",disabled:t||!m,onClick:v},"Remove License"),React.createElement(a.c,{disabled:t||!m||i&&i.key===m,onClick:b},"Validate License")),React.createElement(a.o,{isOpen:"licenseAdded"===o,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.o,{isOpen:"licenseRemoved"===o,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return d?k:_},Re=wp.element.render;function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function xe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Oe(o,r,a,c,l,"next",e)}function l(e){Oe(o,r,a,c,l,"throw",e)}c(void 0)}))}}function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&Re(React.createElement(me,null),t)})));var Se=wp.element,Ae=Se.useState,je=Se.useMemo,Ie={marginTop:10,background:"rgb(0, 72, 88)",padding:10,color:"rgb(58, 212, 58)",maxHeight:600,minHeight:200,display:"block",fontFamily:"monospace",fontSize:12,whiteSpace:"pre",overflowX:"auto",width:"calc(100vw - 276px)"},Ce=function(){var e,t,n=je((function(){return["".concat(m,"/all_settings/"),{headers:{"X-WP-Nonce":h}}]}),[m,h]),o=Object(r.b)(n,a.F),c=o.data,l=o.mutate,s=Object(a.H)(c,{},!0),f=s.busy,y=s.data,g=s.error,v=Pe(Ae(""),2),b=v[0],E=v[1],R=Pe(Ae(!1),2),w=R[0],_=R[1],k=f||w,O=null==y?void 0:y.mfrh_auto_rename,x=null==y?void 0:y.mfrh_on_upload,P=null==y?void 0:y.mfrh_rename_slug,T=null==y?void 0:y.mfrh_convert_to_ascii,S=null==y?void 0:y.mfrh_update_posts,A=null==y?void 0:y.mfrh_update_postmeta,j=null==y?void 0:y.mfrh_undo,I=null==y?void 0:y.mfrh_move,C=null==y?void 0:y.mfrh_manual_rename,D=null==y?void 0:y.mfrh_numbered_files,M=null==y?void 0:y.mfrh_sync_alt,U=null==y?void 0:y.mfrh_sync_media_title,B=null==y?void 0:y.mfrh_force_rename,L=null==y?void 0:y.mfrh_log,N=null==y?void 0:y.mfrh_logsql,F=null==y?void 0:y.mfrh_rename_guid,G=null==y?void 0:y.mfrh_case_insensitive_check,q=null==y?void 0:y.mfrh_rename_on_save,z=null!==(e=null==y?void 0:y.mfrh_acf_field_name)&&void 0!==e?e:null,H=null!==(t=null==y?void 0:y.mfrh_images_only)&&void 0!==t&&t,Y=[{id:"media_title",value:"media_title",label:React.createElement("span",null,"Based on Media Title"),requirePro:!1},{id:"post_acf_field",value:"post_acf_field",label:React.createElement("span",null,"Based on Attached Post (ACF Field)"),requirePro:!1},{id:"post_title",value:"post_title",label:React.createElement("span",null,"Based on Attached Post Title"),requirePro:!p},{id:"alt_text",value:"alt_text",label:React.createElement("span",null,"Based on Alternative Text"),requirePro:!p},{id:"anonymize_md5",value:"anonymize_md5",label:React.createElement("span",null,"Anonymize with MD5"),requirePro:!p},{id:"none",value:"none",label:React.createElement("span",null,"Disable Automatic Rename"),requirePro:!1}],W=function(){var e=xe(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=_e({},c.data))[n]=t,l(_e(_e({},c),{},{data:r}),!1),_(!0),e.prev=4,e.next=7,Object(a.G)("".concat(m,"/update_option"),{nonce:h,json:{name:n,value:t}});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),alert(e.t0.message);case 12:return e.prev=12,_(!1),l(),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[4,9,12,16]])})));return function(t,n){return e.apply(this,arguments)}}(),V=function(){var e=xe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(!0),e.next=3,Object(a.G)("".concat(m,"/refresh_logs"),{nonce:h});case 3:(t=e.sent).success&&E(t.data),_(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=xe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(!0),e.next=3,Object(a.G)("".concat(m,"/clear_logs"),{nonce:h});case 3:(t=e.sent).success&&E(t.data),_(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=React.createElement(a.a,{busy:k,title:"Side Updates",className:"primary"},React.createElement(a.B,{p:!0,style:{marginTop:0}},"When the files are renamed, many links to them on your WordPress might be broken. Those options are updating the references to those files. ",React.createElement("strong",null,"Give it a try, every install is different and it might not work for certain kind of references.")),React.createElement(a.v,{title:"Posts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_update_posts",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"content")," content and ",React.createElement("strong",null,"excerpt")," of the posts (pages and custom types included)."),value:"1",checked:S,onChange:W}))),React.createElement(a.v,{title:"Post Meta"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_update_postmeta",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"custom fields")," of the posts (including pages and custom types metadata)."),value:"1",checked:A,onChange:W})))),X=React.createElement(a.v,{title:"Method"},React.createElement(a.u,{id:"mfrh_auto_rename",disabled:k,value:O,scrolldown:!0,name:"mfrh_auto_rename",description:"Attached Post includes all kinds of Post Types: Posts, Pages, Products, etc.",onChange:W},Y.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),Q=je((function(){return"post_acf_field"!==O?null:React.createElement(a.v,{title:"ACF Field Name"},React.createElement(a.k,{id:"mfrh_acf_field_name",name:"mfrh_acf_field_name",value:z,onBlur:W}))}),[O]),K=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_images_only",label:"Enable",description:"Restricts the renaming to images (JPG and PNG). Nothing else will be renamed.",value:"1",checked:H,onChange:W}))),Z=React.createElement(a.v,{title:"On Upload"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_on_upload",disabled:k,label:"Enable",description:React.createElement(React.Fragment,null,React.createElement("span",null,"If your image has an EXIF title, it will be used to decide the filename. "),"post_title"===O&&React.createElement("span",null,"Note: The Attached Post Title ",React.createElement("u",null,"will not be used")," at the time of the upload due to WordPress API constraints.")),value:"1",checked:x,onChange:W}))),ee=React.createElement(a.v,{title:"Slug/Permalink"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_slug",disabled:k,label:"Sync with filename",description:"Better to keep this un-checked as the link might have been referenced somewhere else.",value:"1",checked:P,onChange:W}))),te=React.createElement(a.v,{title:"Transliteration"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_convert_to_ascii",disabled:k,label:"Enable (Recommended)",description:React.createElement(a.B,{p:!0},"Replace accents, emoticons, diacritics, umlauts, cyrillic and any kind of tricky characters by their ASCII equivalent.",React.createElement("br",null)," ",React.createElement("i",null,"Examples: tête → tete, schön → schon, Добро → dobro, etc.")),value:"1",requirePro:!p,checked:T,onChange:W}))),ne=React.createElement(a.v,{title:"Undo"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_undo",disabled:k,label:"Enable",description:"An undo icon will be added to the UI. This allows to rollback to the original filename.",value:"1",checked:j,onChange:W}))),re=React.createElement(a.v,{title:"Move"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_move",disabled:k,label:"Enable",description:"A move button will be added, and will allow you to move a file to another directory.",value:"1",checked:I,onChange:W,requirePro:!p}))),ae=React.createElement(a.v,{title:"Rename Field"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_manual_rename",disabled:k,label:"Enable",description:"An editable field will be added everywhere your files appear in the UI.",value:"1",checked:C,onChange:W}))),oe=React.createElement(a.v,{title:"Force Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_force_rename",disabled:k,label:"Enable",description:"Update the references to the file even if the file renaming itself was not successful. You might want to use that option if your install is broken and you are trying to link your Media to files for which the filenames has been altered (after a migration for exemple)",value:"1",requirePro:!p,checked:B,onChange:W}))),ce=React.createElement(a.v,{title:"Numbered Files"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_numbered_files",disabled:k,label:"Enable Numbering",description:"Identical filenames will be allowed by the plugin and a number will be appended automatically (myfile.jpg, myfile-2.jpg, myfile-3.jpg, etc).",requirePro:!p,value:"1",checked:D,onChange:W}))),le=React.createElement(a.v,{title:"ALT Text"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_sync_alt",disabled:k||"alt_text"==O,label:React.createElement(a.B,null,"Synchronize"),description:"The ALT Text will be synchronized with the same source used for the filename.",requirePro:!p,value:"1",checked:M,onChange:W}))),ie=React.createElement(a.v,{title:"Media Title"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_sync_media_title",disabled:k||"media_title"===O,label:React.createElement(a.B,null,"Synchronize"),description:"The Media Title will be synchronized with the same source used for the filename.",requirePro:!p,value:"1",checked:U,onChange:W}))),ue=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_log",label:"Enable",description:React.createElement(a.B,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:L,onChange:W}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:V},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:$},"Clear Logs")))),se=React.createElement(a.v,{title:"SQL Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_logsql",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"The files mfrh_sql.log and mfrh_sql_revert.log will be created in the /logs directory and will include the raw SQL queries which were run by the plugin. If there is an issue, the revert SQL file can help you."),requirePro:!p,value:"1",checked:N,onChange:W}))),me=React.createElement(a.v,{title:"GUID"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_guid",disabled:k,label:"Sync with filename",description:"The GUID will be renamed like the new filename. Better to keep this un-checked.",value:"1",checked:F,onChange:W}))),fe=React.createElement(a.v,{title:"Case Insensitive"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_case_insensitive_check",label:"Enable",value:"1",checked:G,onChange:W,description:React.createElement(React.Fragment,null,'This will consider the file such as "abc.jpg" and "ABC.JPG" as the same file. More information ',React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-file-renamer-faq-issues/"},"here"),". You should check this if you are on a Windows-based server.")}))),de=React.createElement(a.v,{title:"Rename on Post Save"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_on_save",disabled:k,label:"Enable (Unsafe)",description:"You can modify the titles of your media while editing a post but, of course, the plugin can't update the HTML at this stage. With this option, the plugin will update the filenames and HTML after that you saved the post.",value:"1",checked:q,onChange:W})));return React.createElement(a.q,{nekoErrors:[g]},React.createElement(a.i,{title:"Media File Renamer | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=mfrh_dashboard"}},"Dashboard"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.g,null,React.createElement(a.B,{p:!0},"It works out of the box, the default settings are good for most installs. However, you should really have a look at the ",React.createElement("a",{href:"https://meowapps.com/plugin/media-file-renamer/"},"tutorial"),". If you are a SEO guru or someone who loves having a perfectly neat filesystem, it is recommended to use automatic renaming first, then to tweak specific files with manual renaming. The ",React.createElement("a",{href:"/wp-admin/upload.php?page=mfrh_dashboard"},"Renamer Dashboard")," makes it very easy.")),React.createElement(a.y,null,React.createElement(a.w,{title:"Basic"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Settings",className:"primary"},React.createElement(a.B,{h2:!0},"Automatic"),React.createElement(a.B,{p:!0},"This plugin's main goal is to make the process of optimizing your filenames entirely automatic. By default, your files will be named after the title of your media entry."),X,Q,React.createElement(a.B,{h2:!0},"Manual"),ae,React.createElement(a.B,{h2:!0},"Extra Options"),Z,K)),React.createElement(a.f,{minimal:!0},J,React.createElement(a.a,{busy:k,title:"UI (Extra Features)",className:"primary"},ne,re)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Advanced Settings",className:"primary"},te,ce),React.createElement(a.a,{busy:k,title:"Fields Syncing",className:"primary"},ee,me,le,ie,React.createElement(a.B,{p:!0},"The fields in the database will be synchronized, but the data already written in your HTML will not be overwritten."))),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Developer Settings",className:"primary"},fe,oe,se,de)))),React.createElement(a.w,{title:"License (Pro)"},React.createElement(Ee,{domain:u,prefix:i,isPro:d,isRegistered:p})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:k,className:"primary"},ue),React.createElement("div",{style:Ie},b))))))},De=n(0);function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){Ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function Ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Fe(o,r,a,c,l,"next",e)}function l(e){Fe(o,r,a,c,l,"throw",e)}c(void 0)}))}}var qe,ze,He,Ye={pending:"-",renamed:"-",locked:"-",all:"-"},We={accessor:"id",by:"asc"},Ve=0,$e={filterBy:"pending",sort:We,page:1,limit:10,search:"",busy:!1,stats:Ye,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,autoRename:!1,onUpload:!1,renameSlug:!1,convertToAscii:!1,updatePosts:!0,updatePostmeta:!0,undo:!1,move:!1,manualRename:!1,numberedFiles:!1,syncAlt:!1,syncMedia_title:!1,forceRename:!1,log:!1,logsql:!1,renameGuid:!1,caseInsensitiveCheck:!1,renameOnSave:!1,acfFieldName:null,imagesOnly:!1,modals:{renameAll:!1,undoAll:!1,editTitle:!1,autoAttach:!1},mutateEntries:(He=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return He.apply(this,arguments)}),mutateStats:(ze=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return ze.apply(this,arguments)}),mutateSettings:(qe=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return qe.apply(this,arguments)})},Je=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return Le(Le({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return Le(Le({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return Le(Le({},e),{},{apiErrors:a});case"PAGE_UPDATED":var o=t.page;return Le(Le({},e),{},{page:o});case"SET_ENTRIES_MUTATE":var c=t.mutateEntries;return Le(Le({},e),{},{mutateEntries:c});case"SET_STATS_MUTATE":var l=t.mutateStats;return Le(Le({},e),{},{mutateStats:l});case"SET_SETTINGS_MUTATE":var i=t.mutateSettings;return Le(Le({},e),{},{mutateSettings:i});case"LIMIT_UPDATED":var u=t.limit;return Le(Le({},e),{},{limit:u});case"FILTER_UPDATED":var s=t.filter;return Le(Le({},e),{},{filterBy:s});case"SORT_UPDATED":var m=t.sort,f=void 0===m?We:m;return Le(Le({},e),{},{sort:f});case"SEARCH_UPDATED":var d=t.search;return Le(Le({},e),{},{search:d});case"TOTAL_UPDATED":var p=t.total;return Le(Le({},e),{},{total:p});case"TOGGLE_MODAL":var h=t.modal,y=t.enable;if(void 0===e.modals[h])return alert("The modal ".concat(h," doesn't exist.")),console.error("The modal ".concat(h," doesn't exist.")),e;void 0===y&&(y=!e.modals[h]);var g=Le({},e);return g.modals=Le({},g.modals),g.modals[h]=y,g;case"PUSH_BUSY":var v=t.status,b=void 0===v?"":v;return Le(Le({},e),{},{busy:++Ve>0,status:b});case"POP_BUSY":var E=t.status,R=void 0===E?"":E;return Le(Le({},e),{},{busy:--Ve>0,status:R});case"STATUS_UPDATED":var w=t.status,_=void 0===w?"":w;return Le(Le({},e),{},{status:_});case"SETTINGS_UPDATED":var k,O,x,P,T,S,A,j,I,C,D,M,U,B,L,N,F,G,q,z=t.settings,H=null!==(k=z.mfrh_auto_rename)&&void 0!==k&&k,Y=null!==(O=z.mfrh_on_upload)&&void 0!==O&&O,W=null!==(x=z.mfrh_rename_slug)&&void 0!==x&&x,V=null!==(P=z.mfrh_convert_to_ascii)&&void 0!==P&&P,$=null===(T=z.mfrh_update_posts)||void 0===T||T,J=null===(S=z.mfrh_update_postmeta)||void 0===S||S,X=null!==(A=z.mfrh_undo)&&void 0!==A&&A,Q=null!==(j=z.mfrh_move)&&void 0!==j&&j,K=null!==(I=z.mfrh_manual_rename)&&void 0!==I&&I,Z=null!==(C=z.mfrh_numbered_files)&&void 0!==C&&C,ee=null!==(D=z.mfrh_sync_alt)&&void 0!==D&&D,te=null!==(M=z.mfrh_sync_media_title)&&void 0!==M&&M,ne=null!==(U=z.mfrh_force_rename)&&void 0!==U&&U,re=null!==(B=z.mfrh_log)&&void 0!==B&&B,ae=null!==(L=z.mfrh_logsql)&&void 0!==L&&L,oe=null!==(N=z.mfrh_rename_guid)&&void 0!==N&&N,ce=null!==(F=z.mfrh_case_insensitive_check)&&void 0!==F&&F,le=null!==(G=z.mfrh_rename_on_save)&&void 0!==G&&G,ie=z.mfrh_acf_field_name,ue=null!==(q=z.mfrh_images_only)&&void 0!==q&&q,se=z.mfrh_posts_per_page?parseInt(z.mfrh_posts_per_page):10;return Le(Le({},e),{},{autoRename:H,onUpload:Y,renameSlug:W,convertToAscii:V,updatePosts:$,updatePostmeta:J,undo:X,move:Q,manualRename:K,numberedFiles:Z,syncAlt:ee,syncMedia_title:te,forceRename:ne,log:re,logsql:ae,renameGuid:oe,caseInsensitiveCheck:ce,renameOnSave:le,acfFieldName:ie,imagesOnly:ue,limit:se});case"ITEMS_SELECTED":var me=t.selectedItems;return Le(Le({},e),{},{selectedItems:me});default:return e}},Xe=Object(De.createContext)(),Qe=function(e){var t=e.children,n=Me(Object(De.useReducer)(Je,$e),2),o=n[0],c=n[1],l=o.filterBy,i=o.sort,u=o.search,s=o.page,f=o.limit,d=Object(De.useMemo)((function(){return[Object(a.D)("".concat(m,"/media"),{limit:f,skip:(s-1)*f,filterBy:l,orderBy:i.accessor,order:i.by,search:u}),{headers:{"X-WP-Nonce":h}}]}),[f,s,l,i,u]),p=Object(De.useMemo)((function(){return[Object(a.D)("".concat(m,"/stats"),{search:u}),{headers:{"X-WP-Nonce":h}}]}),[u]),y=Object(De.useMemo)((function(){return["".concat(m,"/all_settings/"),{headers:{"X-WP-Nonce":h}}]}),[]),g=Object(r.b)(d,a.F),v=g.data,b=g.mutate;Object(De.useEffect)((function(){c({type:"SET_ENTRIES_MUTATE",mutateEntries:b})}),[b]),Object(De.useEffect)((function(){c({type:"SET_STATS_MUTATE",mutateStats:P})}),[P]),Object(De.useEffect)((function(){c({type:"SET_SETTINGS_MUTATE",mutateSettings:D})}),[D]);var E=Object(a.H)(v,[],!0),R=E.busy,w=E.data,_=E.total,k=E.error;Object(De.useEffect)((function(){c({type:R?"PUSH_BUSY":"POP_BUSY"})}),[R]),Object(De.useEffect)((function(){c({type:"ENTRIES_UPDATED",entries:w})}),[w]),Object(De.useEffect)((function(){c({type:"TOTAL_UPDATED",total:_})}),[_]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:k})}),[k]);var O=Object(r.b)(p,a.F),x=O.data,P=O.mutate,T=Object(a.H)(x,Ye,!0),S=T.busy,A=T.data,j=T.error;Object(De.useEffect)((function(){c({type:S?"PUSH_BUSY":"POP_BUSY"})}),[S]),Object(De.useEffect)((function(){c({type:"STATS_UPDATED",stats:A})}),[A]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:j})}),[j]);var I=Object(r.b)(y,a.F),C=I.data,D=I.mutate,M=Object(a.H)(C,{},!0),U=M.busy,B=M.data,L=M.error;return Object(De.useEffect)((function(){c({type:U?"PUSH_BUSY":"POP_BUSY"})}),[U]),Object(De.useEffect)((function(){c({type:"SETTINGS_UPDATED",settings:B})}),[B]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:L})}),[L]),React.createElement(Xe.Provider,{value:[o,c]},t)},Ke=function(){var e={},t=Me(Object(De.useContext)(Xe),2),n=t[0],r=t[1];return e.setSelectedItems=function(e){r({type:"ITEMS_SELECTED",selectedItems:e})},e.setStatus=function(e){r({type:"STATUS_UPDATED",status:e})},e.updateOption=function(){var e=Ge(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"PUSH_BUSY"}),e.prev=1,e.next=4,Object(a.G)("".concat(m,"/update_option"),{nonce:h,json:{name:o,value:t}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),alert(e.t0);case 9:r({type:"POP_BUSY"}),n.mutateSettings();case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n){return e.apply(this,arguments)}}(),e.updateEntry=function(){var e=Ge(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"STATUS_UPDATED",status:"Updating..."}),r({type:"PUSH_BUSY"}),e.prev=2,e.next=5,Object(a.G)("".concat(m,"/update_media"),{nonce:h,json:Le({id:o},t)});case 5:if(e.sent.success){e.next=8;break}throw new Error("Failed to move the folder/gallery.");case 8:n.mutateEntries(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),alert(e.t0.message);case 14:return e.prev=14,r({type:"POP_BUSY"}),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),e.setPage=function(e){r({type:"PAGE_UPDATED",page:e})},e.setLimit=function(e){r({type:"LIMIT_UPDATED",limit:e})},e.setFilter=function(e){r({type:"FILTER_UPDATED",filter:e})},e.setSort=function(e){r({type:"SORT_UPDATED",sort:e})},e.setSearch=function(e){r({type:"SEARCH_UPDATED",search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:"TOGGLE_MODAL",modal:e,enable:t})},e.pushBusy=function(){r({type:"PUSH_BUSY"})},e.popBusy=function(){r({type:"POP_BUSY"})},Le(Le({},n),e)};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e){return function(e){if(Array.isArray(e))return lt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ct(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.")}()}function rt(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function at(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){rt(o,r,a,c,l,"next",e)}function l(e){rt(o,r,a,c,l,"throw",e)}c(void 0)}))}}function ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||ct(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var it=wp.element,ut=it.useState,st=it.useEffect,mt=it.useMemo,ft={width:40,height:40,objectFit:"cover"},dt=[{accessor:"thumbnail_url",title:l.THUMB,style:{width:16}},{accessor:"post_title",title:l.TITLE,sortable:!0,style:{width:"25%"}},{accessor:"post_parent",title:l.ATTACHED_TO,sortable:!0,style:{width:"25%"}},{accessor:"current_filename",title:l.FILENAME,sortable:!0}],pt=function(){var e=Ke(),t=e.apiErrors,n=e.busy,r=e.selectedItems,o=e.entries,c=e.stats,i=e.total,u=e.filterBy,s=e.search,f=e.status,d=e.sort,g=e.page,v=e.limit,b=e.modals,E=Ke(),R=E.setSelectedItems,w=E.setSearch,_=E.setStatus,k=E.setSort,O=E.setPage,x=E.setLimit,P=E.setFilter,T=E.mutateEntries,S=E.mutateStats,A=E.toggleModal,I=E.updateOption,C=E.updateEntry,D=ot(ut(!1),2),M=D[0],U=D[1],B=ot(ut(""),2),L=B[0],N=B[1],F=ot(ut(),2),G=F[0],q=F[1],z=Object(a.J)(),H=mt((function(){return o.map((function(e){return{id:e.ID,thumbnail_url:React.createElement("img",{src:e.thumbnail_url,style:ft}),post_title:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement(a.j,{icon:"pencil",width:"20",height:"20",color:a.z.blue,style:{marginLeft:"2px",cursor:"pointer"},onClick:function(){q(e),A("editTitle")}})),post_parent:React.createElement("div",{style:{maxHeight:35,overflow:"hidden"}},e.post_parent_title?e.post_parent_title:React.createElement("i",{style:{color:"#c1c1c1"}},"None")),current_filename:React.createElement(j,{entry:e,mutate:function(){T(),S()}})}}))}),[o]);st((function(){R([]),k(),O(1)}),[u,s]),st((function(){if(null!==z.busy&&(U(z.busy),!z.busy)){var e=z.getErrorCount();e>0&&N("The process has finished, but ".concat(e," error(s) occurred (check your console).")),z.reset(),R([]),T(),S()}}),[z.busy]);var Y=function(){var e=at(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/get_all_ids"),{nonce:h,json:{unlockedOnly:t}});case 2:if((n=e.sent).success){e.next=6;break}return alert(n.message),e.abrupt("return",[]);case 6:return e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),W=function(){var e=at(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/get_all_post_ids"),{nonce:h});case 2:if((t=e.sent).success){e.next=6;break}return alert(t.message),e.abrupt("return",[]);case 6:return e.abrupt("return",t.data);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Preparing..."),U(!0),e.next=4,W();case 4:if(!(t=e.sent)){e.next=11;break}return _("Auto attaching..."),n=Object(a.E)(t,20),r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(a.G)("".concat(m,"/auto_attach"),{nonce:h,json:{postIds:e},signal:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 11:U(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return _("Undoing..."),r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _("Undo Media ".concat(e)),t.next=3,Object(a.G)("".concat(m,"/undo"),{nonce:h,json:{mediaId:e},signal:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 16:U(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return _("Analyzing..."),r=Object(a.E)(n,20),o=r.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(a.G)("".concat(m,"/analyze"),{nonce:h,json:{mediaIds:e},signal:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(o),e.abrupt("return");case 17:U(!1);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o,c,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(l.length>0&&void 0!==l[0])||l[0],n=l.length>1&&void 0!==l[1]?l[1]:null,_("Preparing..."),U(!0),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,Y(t);case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=18;break}return _("".concat(t?"Locking..":"Unlocking...")),o=Object(a.E)(r,50),c=o.map((function(e){return function(){var e=at(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/set_lock"),{nonce:h,json:{mediaIds:r,lock:t},signal:n});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})),z.start(c),e.abrupt("return");case 18:U(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=15;break}return r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _("Renaming #".concat(e)),t.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:e},signal:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 15:U(!1);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=at(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C({post_title:t.post_title},t.ID);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){var e=at(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I(t,"mfrh_posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=React.createElement(React.Fragment,null,React.createElement("div",null,"All your posts, pages, products (and other post types) will be scanned, and if images are used in them, they will be attached. Currently, Featured Images and Product Galleries are supported. Should we start?"),!p&&React.createElement("div",{style:{marginTop:20}},React.createElement("b",null,"This feature is only available in the Pro version."))),te=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-file-renamer/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.q,{nekoErrors:[t]},React.createElement(a.i,{title:"Media File Renamer | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=mfrh_settings"}},"Settings"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},!p&&React.createElement(a.g,{footer:te},React.createElement(a.B,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Renamer. If you don't know how, give a try to ",React.createElement("a",{target:"_blank",href:"https://meow.click/blogvault"},"BlogVault"),". It is also highly recommanded to read the tutorial. Last but not least, check the ",React.createElement("b",null,"Pro Version"),", as it adds many features and also supports the development. This message is only displayed in the free version. Thank you!")),React.createElement(a.A,null,React.createElement(a.c,{onClick:function(){return J()}},"Analyze Library"),React.createElement(a.c,{onClick:function(){return A("autoAttach")}},"Auto Attach"),"pending"===u&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return Q(r)}},"Rename ",React.createElement("strong",null,r.length)," entries"),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0,r)}},"Lock ",React.createElement("strong",null,r.length)," entries")),y&&"renamed"===u&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return $(r)}},"Undo ",React.createElement("strong",null,r.length)," entries")),React.createElement("div",{style:{flex:1}},M&&React.createElement(a.s,{status:function(e){return"".concat(f," (").concat(e,"%)")},busy:M,value:z.value,max:z.max,onStopClick:z.stop})),!(n||M)&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){w(e)},value:s,onEnter:function(e){w(e)}}),!s&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),s&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.z.blue,onClick:function(){w("")}})),"all"===u&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0)}},"Lock ",React.createElement("strong",null,"All")),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!1)}},"Unlock ",React.createElement("strong",null,"All"))),("all"===u||"pending"===u)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return A("renameAll")}},"Rename ",React.createElement("strong",null,"All"))),y&&("all"===u||"renamed"===u)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"danger",onClick:function(){return A("undoAll")}},"Undo ",React.createElement("strong",null,"All")))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:u,busy:n||M,onChange:function(e){P(e),O(1)}},React.createElement(a.l,{title:l.PENDING,value:"pending",count:c.pending}),React.createElement(a.l,{title:"Renamed",value:"renamed",count:c.renamed}),React.createElement(a.l,{title:"Locked",value:"locked",count:c.locked}),React.createElement(a.l,{title:"All",value:"all",count:c.all})),React.createElement(a.r,{currentPage:g,limit:v,total:i,onClick:function(e){return O(e)}})),React.createElement(a.x,{busy:n||M,data:H,columns:dt,sort:d,onSortChange:function(e,t){k({accessor:e,by:t})},onSelect:function(e){R([].concat(nt(r),nt(e)))},onUnselect:function(e){R(nt(r.filter((function(t){return!e.includes(t)}))))},selectedItems:r}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:v,onChange:function(e){x(e),O(1),Z(e)}},React.createElement(a.p,{value:5,label:"5 items per page"}),React.createElement(a.p,{value:10,label:"10 items per page"}),React.createElement(a.p,{value:25,label:"25 items per page"}),React.createElement(a.p,{value:50,label:"50 items per page"}),React.createElement(a.p,{value:100,label:"100 items per page"}),React.createElement(a.p,{value:200,label:"200 items per page"})),React.createElement(a.r,{currentPage:g,limit:v,total:i,onClick:function(e){return O(e)}}))),React.createElement(a.o,{isOpen:b.autoAttach,onRequestClose:function(){return A("autoAttach",!1)},title:"Automatically attach your images to your posts",content:ee,ok:p?"Run":"I need the Pro Version",onOkClick:function(){A("autoAttach",!1),p&&V()},onCancelClick:function(){A("autoAttach",!1)}}),React.createElement(a.o,{isOpen:b.renameAll,onRequestClose:function(){return A("renameAll",!1)},title:"You are about to rename all your (unlocked) files",content:"Renaming files is a dangerous operation. Please make sure you made a backup or your entire WordPress install. Should we start?",onOkClick:function(){A("renameAll",!1),Q()},onCancelClick:function(){A("renameAll",!1)}}),React.createElement(a.o,{isOpen:b.undoAll,onRequestClose:function(){return A("undoAll",!1)},title:"You are about to undo the renaming for all your files",content:"Are you sure you would like to proceed?",onOkClick:function(){A("undoAll",!1),$()},onCancelClick:function(){A("undoAll",!1)}}),React.createElement(a.o,{isOpen:L,title:"Success",ok:"Close",content:L,onOkClick:function(){N(""),z.reset()}}),React.createElement(a.o,{isOpen:b.editTitle,onRequestClose:function(){return A("editTitle",!1)},title:"Edit the title",okOnEnter:!0,content:React.createElement(a.k,{autoFocus:!0,id:"mfrh_edit_title",name:"mfrh_edit_title",placeholder:"title...",value:null==G?void 0:G.post_title,onBlur:function(e){return q(et(et({},G),{},{post_title:e}))}}),onOkClick:function(){A("editTitle",!1),K(G)},onCancelClick:function(){A("editTitle",!1)}})))},ht=wp.element.render,yt={fetcher:a.F,revalidateOnFocus:!1};function gt(){Array.from(document.getElementsByClassName("mfrh-renamer-field")).forEach((function(e){var t=e.getAttribute("data-id");ht(React.createElement(j,{natural:!0,mediaId:t}),e)}))}document.addEventListener("DOMContentLoaded",(function(e){var t,n;new MutationObserver((function(){gt()})).observe(document.documentElement,{childList:!0,subtree:!0}),(t=document.getElementById("mfrh-admin-settings"))&&ht(React.createElement(r.a,{value:yt},React.createElement(Ce,null)),t),(n=document.getElementById("mfrh-media-rename"))&&ht(React.createElement(r.a,{value:yt},React.createElement(Qe,null,React.createElement(pt,null))),n),gt()}))}});
|
2 |
//# sourceMappingURL=index.js.map
|
1 |
+
!function(e){function t(t){for(var r,c,l=t[0],i=t[1],u=t[2],m=0,d=[];m<l.length;m++)c=l[m],Object.prototype.hasOwnProperty.call(a,c)&&a[c]&&d.push(a[c][0]),a[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(s&&s(t);d.length;)d.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var i=n[l];0!==a[i]&&(r=!1)}r&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},a={0:0},o=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="";var l=window.wpJsonMfrh=window.wpJsonMfrh||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;o.push([129,1]),n()}({0:function(e,t){e.exports=React},1:function(e,t,n){"use strict";var r=n(14);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(37);var o=n(49);n.d(t,"q",(function(){return o.a}));var c=n(50);n.d(t,"a",(function(){return c.a}));var l=n(51);n.d(t,"g",(function(){return l.a}));var i=n(52);n.d(t,"v",(function(){return i.a}));n(53);var u=n(38);n.d(t,"C",(function(){return u.b})),n.d(t,"f",(function(){return u.a}));var s=n(54);n.d(t,"d",(function(){return s.a}));var m=n(55);n.d(t,"e",(function(){return m.a}));var d=n(21);n.d(t,"k",(function(){return d.a}));n(56);var f=n(39);n.d(t,"u",(function(){return f.b})),n.d(t,"p",(function(){return f.a}));n(57),n(58),n(8),n(40),n(22);var p=n(59);n.d(t,"s",(function(){return p.a}));var h=n(60);n.d(t,"i",(function(){return h.a}));var y=n(23);n.d(t,"r",(function(){return y.a}));var g=n(10);n.d(t,"j",(function(){return g.a}));var v=n(16);n.d(t,"B",(function(){return v.a}));var b=n(41);n.d(t,"t",(function(){return b.b})),n.d(t,"l",(function(){return b.a}));var E=n(61);n.d(t,"h",(function(){return E.a}));var R=n(42);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(62),n(63),n(19);var w=n(24);n.d(t,"o",(function(){return w.a}));n(68);var _=n(69);n.d(t,"x",(function(){return _.a}));var k=n(44);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(45);var O=n(70);n.d(t,"A",(function(){return O.a}));var x=n(3);n.d(t,"z",(function(){return x.a}));var P=n(7);n.d(t,"J",(function(){return P.d})),n.d(t,"H",(function(){return P.b})),n.d(t,"I",(function(){return P.c}));var T=n(15);n.d(t,"G",(function(){return T.d})),n.d(t,"F",(function(){return T.c})),n.d(t,"E",(function(){return T.b})),n.d(t,"D",(function(){return T.a}));n(20)},120:function(e,t){e.exports=ReactDOM},129:function(e,t,n){"use strict";n.r(t);var r=n(12),a=n(1),o=wp.i18n.__,c={};c.RENAME=o("Rename","media-file-renamer"),c.MOVE=o("Move","media-file-renamer"),c.DASHBOARD=o("Dashboard","media-file-renamer"),c.PENDING=o("Pending","media-file-renamer"),c.RENAMED=o("Renamed","media-file-renamer"),c.ALL=o("All","media-file-renamer"),c.THUMB=o("Thumb","media-file-renamer"),c.TITLE=o("Title","media-file-renamer"),c.ATTACHED_TO=o("Attached To","media-file-renamer"),c.FILENAME=o("Filename","media-file-renamer");var l=c,i=mfrh_media_file_renamer.prefix,u=mfrh_media_file_renamer.domain,s=mfrh_media_file_renamer.rest_url.replace(/\/+$/,""),m=mfrh_media_file_renamer.api_url.replace(/\/+$/,""),d=mfrh_media_file_renamer.plugin_url.replace(/\/+$/,""),f="1"===mfrh_media_file_renamer.is_pro,p=f&&"1"===mfrh_media_file_renamer.is_registered,h=mfrh_media_file_renamer.rest_nonce,y="1"===mfrh_media_file_renamer.mfrh_undo,g="1"===mfrh_media_file_renamer.mfrh_move,v="1"===mfrh_media_file_renamer.mfrh_manual_rename;function b(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){b(o,r,a,c,l,"next",e)}function l(e){b(o,r,a,c,l,"throw",e)}c(void 0)}))}}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _,k,O,x,P,T=wp.element,S=T.useState,A=T.useEffect,j=function(e){var t=e.mutate,n=R(S(e.entry),2),r=n[0],o=n[1],c=R(S(!1),2),i=c[0],u=c[1],s=R(S(""),2),d=s[0],f=s[1],p=R(S(null),2),b=p[0],w=p[1],_=e.natural,k=void 0!==_&&_,O=Object(a.I)({concurrency:2}).runTask;A((function(){f(""),e.entry?o(e.entry):e.mediaId&&x(e.mediaId)}),[e.entry]);var x=function(){var e=E(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,O(E(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(a.G)("".concat(m,"/analyze"),{nonce:h,json:{mediaId:t}}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,o(n.data),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=E(regeneratorRuntime.mark((function e(t){var n,r,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<=220)){e.next=3;break}return f(t),e.abrupt("return");case 3:n=t.lastIndexOf("."),r=-1===n?"":".".concat(t.slice(n+1)),a=r.length>0?r.length:0,o="".concat(t.slice(0,220-a)).concat(r),f(o);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=E(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:r.ID}});case 3:t=e.sent,T(t.data),w(null),u((function(e){return e-1}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:r.ID,filename:d}});case 3:t=e.sent,T(t.data),w(null),f(""),u((function(e){return e-1}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/undo"),{nonce:h,json:{mediaId:r.ID}});case 3:t=e.sent,T(t.data,r.current_filename),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=E(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u((function(e){return e+1})),e.next=3,Object(a.G)("".concat(m,"/set_lock"),{nonce:h,json:{mediaId:r.ID,lock:!r.locked}});case 3:t=e.sent,T(t.data),u((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){var e=E(regeneratorRuntime.mark((function e(){var t,n,o,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log({entry:r}),t=r.metadata.file||"",n="/"+t.substring(0,t.lastIndexOf("/")),!(o=(o=(o=prompt("Where would you like to move this file (in the /uploads directory)?",n)).replace(/\/+$/,""))||"/")){e.next=13;break}return u((function(e){return e+1})),e.next=10,Object(a.G)("".concat(m,"/move"),{nonce:h,json:{mediaId:r.ID,newPath:o}});case 10:c=e.sent,T(c.data),u((function(e){return e-1}));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=!!d,B=U?d:b||(null==r?void 0:r.current_filename);return React.createElement(a.b,{busy:i},React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(a.k,{natural:k,readOnly:!v||i,value:B,onChange:P,onEnter:I,maxLength:220,style:{marginRight:0,flex:"auto"}}),!U&&React.createElement(a.j,{icon:null!=r&&r.locked?"lock":"lock-open",width:24,title:null!=r&&r.locked?"Unlock, to allow future actions":"Lock, to avoid future actions",style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:D}),U&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-26,marginRight:-22},color:null!=r&&r.locked?a.z.blue:"#5a5a5a82",onClick:function(){f("")}}),(null==r?void 0:r.proposed_filename_exists)&&React.createElement(a.j,{icon:"alert",color:"orange",tooltip:{text:"The ideal filename (".concat(r.proposed_filename,") already exists."),position:"left"}}),y&&!U&&(null==r?void 0:r.original_filename)&&React.createElement(a.j,{icon:"file-undo",title:"Rollback to original",color:a.z.red,onClick:C,onMouseEnter:function(){return w(null==r?void 0:r.original_filename)},onMouseLeave:function(){return w(null)}}),!U&&(null==r?void 0:r.proposed_filename)&&!(null!=r&&r.proposed_filename_exists)&&React.createElement(a.c,{style:{marginLeft:5},title:"Rename automatically",onMouseEnter:function(){return w(null==r?void 0:r.proposed_filename)},onMouseLeave:function(){return w(null)},onClick:j},"Auto Rename"),v&&U&&React.createElement(a.c,{style:{marginLeft:5},title:"Rename manually",onClick:I},l.RENAME),g&&React.createElement(a.c,{style:{marginLeft:5},title:"Move",onClick:M},l.MOVE)))},I=n(4);function C(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var D=I.a.div(_||(_=C(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),M=Object(I.a)(a.a)(k||(k=C(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),U=I.a.img(O||(O=C(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),B=I.a.div(x||(x=C(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n font-family: Lato;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),N=I.a.ul(P||(P=C(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function L(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(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.")}()}function F(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function G(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){F(o,r,a,c,l,"next",e)}function l(e){F(o,r,a,c,l,"throw",e)}c(void 0)}))}}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||z(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Y=wp.element,W=Y.useState,V=Y.useEffect,$="".concat(s,"/meow-common/v1"),J=function(e){var t=e.request,n=e.title,r=e.max,o=q(W(!1),2),c=o[0],l=o[1],i=q(W([]),2),u=i[0],s=i[1],m=u.length>0?u.reduce((function(e,t){return e+t})):0,d=u.length>0?Math.ceil(m/u.length):0,f=!u.length&&c;V((function(){c&&setTimeout(G(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.G)("".concat($,"/").concat(t),{nonce:h});case 3:r=(new Date).getTime(),o=r-n,s((function(e){return[].concat(L(e),[o])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[u]);return React.createElement(D,{style:{width:200,textAlign:"center"}},React.createElement(a.B,{h2:!0,style:{color:"white"}},n),React.createElement(a.h,{size:200,value:f?r:d,max:r},React.createElement("span",{style:{fontSize:20}},f?"START":d+" ms"),React.createElement("span",{style:{fontSize:12}},f?"YOUR ENGINE":u.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:c?"#cc3627":"#ccb027",onClick:function(){c||s([]),l(!c)}},c?"Stop":"Start"))};function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Z(o,r,a,c,l,"next",e)}function l(e){Z(o,r,a,c,l,"throw",e)}c(void 0)}))}}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ne(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var re=wp.element,ae=re.useState,oe=re.useEffect;m&&s&&d||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var ce="".concat(s,"/meow-common/v1"),le=React.createElement(D,null,React.createElement(a.B,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),ie=React.createElement(D,null,React.createElement(a.B,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.B,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),ue=React.createElement(D,null,React.createElement(a.B,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.B,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.B,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️ ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),se=["".concat(ce,"/all_settings/"),{headers:{"X-WP-Nonce":h}}],me=function(){var e=te(ae(!1),2),t=e[0],n=e[1],o=Object(r.b)(se,a.F),c=o.data,l=o.mutate,i=o.error,u=null==c?void 0:c.data,s=null==u?void 0:u.meowapps_hide_meowapps,m=null==u?void 0:u.force_sslverify,f=te(ae(!1),2),p=f[0],y=f[1],g=te(ae([]),2),v=g[0],b=g[1],E=te(ae(""),2),R=E[0],w=E[1];oe((function(){i&&!t&&(n(!0),console.error("Error from UseSWR",i.message))}),[i]),oe((function(){var e=document.getElementById("meow-common-phpinfo");w(e.innerHTML)}),[]);var _=function(){var e=ee(regeneratorRuntime.mark((function e(t,n){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=Q({},c.data))[n]=t,l(Q(Q({},c),{},{data:r}),!1),y(!0),e.next=6,Object(a.G)("".concat(ce,"/update_option"),{json:{name:n,value:t},nonce:h});case 6:o=e.sent,y(!1),o.success||alert(o.message),l();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),k=function(){var e=ee(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,Object(a.G)("".concat(ce,"/error_logs"),{nonce:h});case 3:t=e.sent,n=t&&t.data?t.data:[],b(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=React.createElement(a.v,{title:"Main Menu"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:s,onChange:_}))),x=React.createElement(a.v,{title:"SSL Verify"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.B,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:m,onChange:_})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},le,React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(M,{title:"Media Cleaner",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/media-cleaner.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(M,{title:"Media File Renamer",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/media-file-renamer.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(M,{title:"Contact Form Block",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress."))),React.createElement(M,{title:"Meow Analytics",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.f,{minimal:!0},React.createElement(M,{title:"Meow Gallery",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/meow-gallery.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(M,{title:"Meow Lightbox",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/meow-lightbox.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(M,{title:"Photo Engine",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/wplr-sync.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(M,{title:"Perfect Images + Retina",className:"primary"},React.createElement(U,{src:"".concat(d,"/common/img/wp-retina-2x.jpg")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images + Retina")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more.")))))),React.createElement(a.w,{title:"Performance"},ie,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(J,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(J,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(J,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},ue),React.createElement(a.w,{title:"PHP Info"},React.createElement(B,{dangerouslySetInnerHTML:{__html:R}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(D,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:k},"Load PHP Error Logs"),React.createElement(N,null,v.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.w,{title:"Settings"},React.createElement(a.a,{title:"Settings",className:"primary"},O,x))))))};function de(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function fe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){de(o,r,a,c,l,"next",e)}function l(e){de(o,r,a,c,l,"throw",e)}c(void 0)}))}}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ye=wp.element,ge=ye.useState,ve=ye.useEffect,be="".concat(s,"/meow-licenser/").concat(i,"/v1"),Ee=function(){var e=pe(ge(!1),2),t=e[0],n=e[1],r=pe(ge(null),2),o=r[0],c=r[1],l=pe(ge(null),2),i=l[0],u=l[1],s=pe(ge(""),2),m=s[0],d=s[1],y=p&&(!i||"valid"!==i.license),g=function(){var e=fe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.G)("".concat(be,"/get_license"),{nonce:h});case 5:t=e.sent,u(t.data),t.data.key&&d(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=fe(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(be,"/set_license"),{nonce:h,json:{serialKey:null}});case 3:e.sent.success&&(d(""),u(null),c("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=function(){var e=fe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,Object(a.G)("".concat(be,"/set_license"),{nonce:h,json:{serialKey:m}});case 3:(t=e.sent).success&&(u(t.data),t.data&&!t.data.issue&&c("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ve((function(){g()}),[]);var E=y?"Forced License":p?"Enabled":"Disabled",R=i&&"valid"===i.license,w="Your license is active. Thanks a lot for your support :)";R||(i?"no_activations_left"===i.issue?w=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===i.issue?w=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"Meow Apps Store"),"."):"missing"===i.issue?w="This license does not exist.":"disabled"===i.issue?w="This license has been disabled.":"item_name_mismatch"===i.issue?w="This license seems to be for a different plugin... isn't it? :)":(w=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:i})):w="Unknown error :(");var _=React.createElement(a.a,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://store.meowapps.com/"},"Meow Apps Store"),"."),k=React.createElement(a.a,{title:"Pro Version (".concat(E,")"),busy:t,className:"primary"},React.createElement(a.v,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.k,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:m,onChange:function(e){return d(e)},placeholder:""})),i&&!R&&React.createElement(a.m,null,w),i&&R&&React.createElement(a.n,null,w),!i&&React.createElement(a.B,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://store.meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.v,{contentAlign:"right"},i&&!R&&React.createElement(a.c,{className:"secondary",disabled:t||!m,onClick:b},"Retry to validate"),i&&i.key===m&&React.createElement(a.c,{className:"secondary",disabled:t||!m,onClick:v},"Remove License"),React.createElement(a.c,{disabled:t||!m||i&&i.key===m,onClick:b},"Validate License")),React.createElement(a.o,{isOpen:"licenseAdded"===o,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.o,{isOpen:"licenseRemoved"===o,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return f?k:_},Re=wp.element.render;function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oe(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function xe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Oe(o,r,a,c,l,"next",e)}function l(e){Oe(o,r,a,c,l,"throw",e)}c(void 0)}))}}function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&Re(React.createElement(me,null),t)})));var Se=wp.element,Ae=Se.useState,je=Se.useMemo,Ie={marginTop:10,background:"rgb(0, 72, 88)",padding:10,color:"rgb(58, 212, 58)",maxHeight:600,minHeight:200,display:"block",fontFamily:"monospace",fontSize:12,whiteSpace:"pre",overflowX:"auto",width:"calc(100vw - 276px)"},Ce=function(){var e,t,n=je((function(){return["".concat(m,"/all_settings/"),{headers:{"X-WP-Nonce":h}}]}),[m,h]),o=Object(r.b)(n,a.F),c=o.data,l=o.mutate,s=Object(a.H)(c,{},!0),d=s.busy,y=s.data,g=s.error,v=Pe(Ae(""),2),b=v[0],E=v[1],R=Pe(Ae(!1),2),w=R[0],_=R[1],k=d||w,O=null==y?void 0:y.mfrh_auto_rename,x=null==y?void 0:y.mfrh_on_upload,P=null==y?void 0:y.mfrh_rename_slug,T=null==y?void 0:y.mfrh_convert_to_ascii,S=null==y?void 0:y.mfrh_update_posts,A=null==y?void 0:y.mfrh_update_postmeta,j=null==y?void 0:y.mfrh_undo,I=null==y?void 0:y.mfrh_move,C=null==y?void 0:y.mfrh_manual_rename,D=null==y?void 0:y.mfrh_numbered_files,M=null==y?void 0:y.mfrh_sync_alt,U=null==y?void 0:y.mfrh_sync_media_title,B=null==y?void 0:y.mfrh_force_rename,N=null==y?void 0:y.mfrh_log,L=null==y?void 0:y.mfrh_logsql,F=null==y?void 0:y.mfrh_rename_guid,G=null==y?void 0:y.mfrh_case_insensitive_check,q=null==y?void 0:y.mfrh_rename_on_save,z=null!==(e=null==y?void 0:y.mfrh_acf_field_name)&&void 0!==e?e:null,H=null!==(t=null==y?void 0:y.mfrh_images_only)&&void 0!==t&&t,Y=null==y?void 0:y.mfrh_clean_uninstall,W=[{id:"media_title",value:"media_title",label:React.createElement("span",null,"Based on Media Title"),requirePro:!1},{id:"post_acf_field",value:"post_acf_field",label:React.createElement("span",null,"Based on Attached Post (ACF Field)"),requirePro:!1},{id:"post_title",value:"post_title",label:React.createElement("span",null,"Based on Attached Post Title"),requirePro:!p},{id:"alt_text",value:"alt_text",label:React.createElement("span",null,"Based on Alternative Text"),requirePro:!p},{id:"anonymize_md5",value:"anonymize_md5",label:React.createElement("span",null,"Anonymize with MD5"),requirePro:!p},{id:"none",value:"none",label:React.createElement("span",null,"Disable Automatic Rename"),requirePro:!1}],V=function(){var e=xe(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=_e({},c.data))[n]=t,l(_e(_e({},c),{},{data:r}),!1),_(!0),e.prev=4,e.next=7,Object(a.G)("".concat(m,"/update_option"),{nonce:h,json:{name:n,value:t}});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),alert(e.t0.message);case 12:return e.prev=12,_(!1),l(),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[4,9,12,16]])})));return function(t,n){return e.apply(this,arguments)}}(),$=function(){var e=xe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(!0),e.next=3,Object(a.G)("".concat(m,"/refresh_logs"),{nonce:h});case 3:(t=e.sent).success&&E(t.data),_(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=xe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(!0),e.next=3,Object(a.G)("".concat(m,"/clear_logs"),{nonce:h});case 3:(t=e.sent).success&&E(t.data),_(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=React.createElement(a.a,{busy:k,title:"Side Updates",className:"primary"},React.createElement(a.B,{p:!0,style:{marginTop:0}},"When the files are renamed, many links to them on your WordPress might be broken. Those options are updating the references to those files. ",React.createElement("strong",null,"Give it a try, every install is different and it might not work for certain kind of references.")),React.createElement(a.v,{title:"Posts"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_update_posts",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references to the renamed files in the ",React.createElement("strong",null,"content")," content and ",React.createElement("strong",null,"excerpt")," of the posts (pages and custom types included)."),value:"1",checked:S,onChange:V}))),React.createElement(a.v,{title:"Post Meta"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_update_postmeta",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"Update the references in the ",React.createElement("strong",null,"custom fields")," of the posts (including pages and custom types metadata)."),value:"1",checked:A,onChange:V})))),Q=React.createElement(a.v,{title:"Method"},React.createElement(a.u,{id:"mfrh_auto_rename",disabled:k,value:O,scrolldown:!0,name:"mfrh_auto_rename",description:"Attached Post includes all kinds of Post Types: Posts, Pages, Products, etc.",onChange:V},W.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),K=je((function(){return"post_acf_field"!==O?null:React.createElement(a.v,{title:"ACF Field Name"},React.createElement(a.k,{id:"mfrh_acf_field_name",name:"mfrh_acf_field_name",value:z,onBlur:V}))}),[O]),Z=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_images_only",label:"Enable",description:"Restricts the renaming to images (JPG and PNG). Nothing else will be renamed.",value:"1",checked:H,onChange:V}))),ee=React.createElement(a.v,{title:"On Upload"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_on_upload",disabled:k,label:"Enable",description:React.createElement(React.Fragment,null,React.createElement("span",null,"If your image has an EXIF title, it will be used to decide the filename. "),"post_title"===O&&React.createElement("span",null,"Note: The Attached Post Title ",React.createElement("u",null,"will not be used")," at the time of the upload due to WordPress API constraints.")),value:"1",checked:x,onChange:V}))),te=React.createElement(a.v,{title:"Slug/Permalink"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_slug",disabled:k,label:"Sync with filename",description:"Better to keep this un-checked as the link might have been referenced somewhere else.",value:"1",checked:P,onChange:V}))),ne=React.createElement(a.v,{title:"Transliteration"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_convert_to_ascii",disabled:k,label:"Enable (Recommended)",description:React.createElement(a.B,{p:!0},"Replace accents, emoticons, diacritics, umlauts, cyrillic and any kind of tricky characters by their ASCII equivalent.",React.createElement("br",null)," ",React.createElement("i",null,"Examples: tête → tete, schön → schon, Добро → dobro, etc.")),value:"1",requirePro:!p,checked:T,onChange:V}))),re=React.createElement(a.v,{title:"Undo"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_undo",disabled:k,label:"Enable",description:"An undo icon will be added to the UI. This allows to rollback to the original filename.",value:"1",checked:j,onChange:V}))),ae=React.createElement(a.v,{title:"Move"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_move",disabled:k,label:"Enable",description:"A move button will be added, and will allow you to move a file to another directory.",value:"1",checked:I,onChange:V,requirePro:!p}))),oe=React.createElement(a.v,{title:"Rename Field"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_manual_rename",disabled:k,label:"Enable",description:"An editable field will be added everywhere your files appear in the UI.",value:"1",checked:C,onChange:V}))),ce=React.createElement(a.v,{title:"Force Rename"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_force_rename",disabled:k,label:"Enable",description:"Update the references to the file even if the file renaming itself was not successful. You might want to use that option if your install is broken and you are trying to link your Media to files for which the filenames has been altered (after a migration for exemple)",value:"1",requirePro:!p,checked:B,onChange:V}))),le=React.createElement(a.v,{title:"Numbered Files"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_numbered_files",disabled:k,label:"Enable Numbering",description:"Identical filenames will be allowed by the plugin and a number will be appended automatically (myfile.jpg, myfile-2.jpg, myfile-3.jpg, etc).",requirePro:!p,value:"1",checked:D,onChange:V}))),ie=React.createElement(a.v,{title:"ALT Text"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_sync_alt",disabled:k||"alt_text"==O,label:React.createElement(a.B,null,"Synchronize"),description:"The ALT Text will be synchronized with the same source used for the filename.",requirePro:!p,value:"1",checked:M,onChange:V}))),ue=React.createElement(a.v,{title:"Media Title"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_sync_media_title",disabled:k||"media_title"===O,label:React.createElement(a.B,null,"Synchronize"),description:"The Media Title will be synchronized with the same source used for the filename.",requirePro:!p,value:"1",checked:U,onChange:V}))),se=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_log",label:"Enable",description:React.createElement(a.B,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:N,onChange:V}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:$},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:J},"Clear Logs")))),me=React.createElement(a.v,{title:"SQL Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_logsql",disabled:k,label:"Enable",description:React.createElement(a.B,{p:!0},"The files mfrh_sql.log and mfrh_sql_revert.log will be created in the /logs directory and will include the raw SQL queries which were run by the plugin. If there is an issue, the revert SQL file can help you."),requirePro:!p,value:"1",checked:L,onChange:V}))),de=React.createElement(a.v,{title:"GUID"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_guid",disabled:k,label:"Sync with filename",description:"The GUID will be renamed like the new filename. Better to keep this un-checked.",value:"1",checked:F,onChange:V}))),fe=React.createElement(a.v,{title:"Case Insensitive"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_case_insensitive_check",label:"Enable",value:"1",checked:G,onChange:V,description:React.createElement(React.Fragment,null,'This will consider the file such as "abc.jpg" and "ABC.JPG" as the same file. More information ',React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-file-renamer-faq-issues/"},"here"),". You should check this if you are on a Windows-based server.")}))),pe=React.createElement(a.v,{title:"Rename on Post Save"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_rename_on_save",disabled:k,label:"Enable (Unsafe)",description:"You can modify the titles of your media while editing a post but, of course, the plugin can't update the HTML at this stage. With this option, the plugin will update the filenames and HTML after that you saved the post.",value:"1",checked:q,onChange:V}))),he=React.createElement(a.v,{title:"Plugin Data"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"mfrh_clean_uninstall",label:"Delete all",description:"The database and all the options of the plugin will be removed on uninstall. This also includes the information about the plugin's trash.",value:"1",checked:Y,onChange:V})));return React.createElement(a.q,{nekoErrors:[g]},React.createElement(a.i,{title:"Media File Renamer | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=mfrh_dashboard"}},"Dashboard"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},React.createElement(a.g,null,React.createElement(a.B,{p:!0},"It works out of the box, the default settings are good for most installs. However, you should really have a look at the ",React.createElement("a",{href:"https://meowapps.com/plugin/media-file-renamer/"},"tutorial"),". If you are a SEO guru or someone who loves having a perfectly neat filesystem, it is recommended to use automatic renaming first, then to tweak specific files with manual renaming. The ",React.createElement("a",{href:"/wp-admin/upload.php?page=mfrh_dashboard"},"Renamer Dashboard")," makes it very easy.")),React.createElement(a.y,null,React.createElement(a.w,{title:"Basic"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Settings",className:"primary"},React.createElement(a.B,{h2:!0},"Automatic"),React.createElement(a.B,{p:!0},"This plugin's main goal is to make the process of optimizing your filenames entirely automatic. By default, your files will be named after the title of your media entry."),Q,K,React.createElement(a.B,{h2:!0},"Manual"),oe,React.createElement(a.B,{h2:!0},"Extra Options"),ee,Z)),React.createElement(a.f,{minimal:!0},X,React.createElement(a.a,{busy:k,title:"UI (Extra Features)",className:"primary"},re,ae)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.C,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Advanced Settings",className:"primary"},ne,le),React.createElement(a.a,{busy:k,title:"Fields Syncing",className:"primary"},te,de,ie,ue,React.createElement(a.B,{p:!0},"The fields in the database will be synchronized, but the data already written in your HTML will not be overwritten.")),React.createElement(a.a,{busy:k,title:"On Uninstall",className:"primary"},he)),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:k,title:"Developer Settings",className:"primary"},fe,ce,me,pe)))),React.createElement(a.w,{title:"License (Pro)"},React.createElement(Ee,{domain:u,prefix:i,isPro:f,isRegistered:p})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:k,className:"primary"},se),React.createElement("div",{style:Ie},b))))))},De=n(0);function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ue(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){Le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function Ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){Fe(o,r,a,c,l,"next",e)}function l(e){Fe(o,r,a,c,l,"throw",e)}c(void 0)}))}}var qe,ze,He,Ye={pending:"-",renamed:"-",locked:"-",all:"-"},We={accessor:"id",by:"asc"},Ve=0,$e={filterBy:"pending",sort:We,page:1,limit:10,search:"",busy:!1,stats:Ye,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,autoRename:!1,onUpload:!1,renameSlug:!1,convertToAscii:!1,updatePosts:!0,updatePostmeta:!0,undo:!1,move:!1,manualRename:!1,numberedFiles:!1,syncAlt:!1,syncMedia_title:!1,forceRename:!1,log:!1,logsql:!1,renameGuid:!1,caseInsensitiveCheck:!1,renameOnSave:!1,acfFieldName:null,imagesOnly:!1,modals:{renameAll:!1,undoAll:!1,editTitle:!1,autoAttach:!1},mutateEntries:(He=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return He.apply(this,arguments)}),mutateStats:(ze=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return ze.apply(this,arguments)}),mutateSettings:(qe=Ge(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return qe.apply(this,arguments)})},Je=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return Ne(Ne({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return Ne(Ne({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return Ne(Ne({},e),{},{apiErrors:a});case"PAGE_UPDATED":var o=t.page;return Ne(Ne({},e),{},{page:o});case"SET_ENTRIES_MUTATE":var c=t.mutateEntries;return Ne(Ne({},e),{},{mutateEntries:c});case"SET_STATS_MUTATE":var l=t.mutateStats;return Ne(Ne({},e),{},{mutateStats:l});case"SET_SETTINGS_MUTATE":var i=t.mutateSettings;return Ne(Ne({},e),{},{mutateSettings:i});case"LIMIT_UPDATED":var u=t.limit;return Ne(Ne({},e),{},{limit:u});case"FILTER_UPDATED":var s=t.filter;return Ne(Ne({},e),{},{filterBy:s});case"SORT_UPDATED":var m=t.sort,d=void 0===m?We:m;return Ne(Ne({},e),{},{sort:d});case"SEARCH_UPDATED":var f=t.search;return Ne(Ne({},e),{},{search:f});case"TOTAL_UPDATED":var p=t.total;return Ne(Ne({},e),{},{total:p});case"TOGGLE_MODAL":var h=t.modal,y=t.enable;if(void 0===e.modals[h])return alert("The modal ".concat(h," doesn't exist.")),console.error("The modal ".concat(h," doesn't exist.")),e;void 0===y&&(y=!e.modals[h]);var g=Ne({},e);return g.modals=Ne({},g.modals),g.modals[h]=y,g;case"PUSH_BUSY":var v=t.status,b=void 0===v?"":v;return Ne(Ne({},e),{},{busy:++Ve>0,status:b});case"POP_BUSY":var E=t.status,R=void 0===E?"":E;return Ne(Ne({},e),{},{busy:--Ve>0,status:R});case"STATUS_UPDATED":var w=t.status,_=void 0===w?"":w;return Ne(Ne({},e),{},{status:_});case"SETTINGS_UPDATED":var k,O,x,P,T,S,A,j,I,C,D,M,U,B,N,L,F,G,q,z=t.settings,H=null!==(k=z.mfrh_auto_rename)&&void 0!==k&&k,Y=null!==(O=z.mfrh_on_upload)&&void 0!==O&&O,W=null!==(x=z.mfrh_rename_slug)&&void 0!==x&&x,V=null!==(P=z.mfrh_convert_to_ascii)&&void 0!==P&&P,$=null===(T=z.mfrh_update_posts)||void 0===T||T,J=null===(S=z.mfrh_update_postmeta)||void 0===S||S,X=null!==(A=z.mfrh_undo)&&void 0!==A&&A,Q=null!==(j=z.mfrh_move)&&void 0!==j&&j,K=null!==(I=z.mfrh_manual_rename)&&void 0!==I&&I,Z=null!==(C=z.mfrh_numbered_files)&&void 0!==C&&C,ee=null!==(D=z.mfrh_sync_alt)&&void 0!==D&&D,te=null!==(M=z.mfrh_sync_media_title)&&void 0!==M&&M,ne=null!==(U=z.mfrh_force_rename)&&void 0!==U&&U,re=null!==(B=z.mfrh_log)&&void 0!==B&&B,ae=null!==(N=z.mfrh_logsql)&&void 0!==N&&N,oe=null!==(L=z.mfrh_rename_guid)&&void 0!==L&&L,ce=null!==(F=z.mfrh_case_insensitive_check)&&void 0!==F&&F,le=null!==(G=z.mfrh_rename_on_save)&&void 0!==G&&G,ie=z.mfrh_acf_field_name,ue=null!==(q=z.mfrh_images_only)&&void 0!==q&&q,se=z.mfrh_posts_per_page?parseInt(z.mfrh_posts_per_page):10;return Ne(Ne({},e),{},{autoRename:H,onUpload:Y,renameSlug:W,convertToAscii:V,updatePosts:$,updatePostmeta:J,undo:X,move:Q,manualRename:K,numberedFiles:Z,syncAlt:ee,syncMedia_title:te,forceRename:ne,log:re,logsql:ae,renameGuid:oe,caseInsensitiveCheck:ce,renameOnSave:le,acfFieldName:ie,imagesOnly:ue,limit:se});case"ITEMS_SELECTED":var me=t.selectedItems;return Ne(Ne({},e),{},{selectedItems:me});default:return e}},Xe=Object(De.createContext)(),Qe=function(e){var t=e.children,n=Me(Object(De.useReducer)(Je,$e),2),o=n[0],c=n[1],l=o.filterBy,i=o.sort,u=o.search,s=o.page,d=o.limit,f=Object(De.useMemo)((function(){return[Object(a.D)("".concat(m,"/media"),{limit:d,skip:(s-1)*d,filterBy:l,orderBy:i.accessor,order:i.by,search:u}),{headers:{"X-WP-Nonce":h}}]}),[d,s,l,i,u]),p=Object(De.useMemo)((function(){return[Object(a.D)("".concat(m,"/stats"),{search:u}),{headers:{"X-WP-Nonce":h}}]}),[u]),y=Object(De.useMemo)((function(){return["".concat(m,"/all_settings/"),{headers:{"X-WP-Nonce":h}}]}),[]),g=Object(r.b)(f,a.F),v=g.data,b=g.mutate;Object(De.useEffect)((function(){c({type:"SET_ENTRIES_MUTATE",mutateEntries:b})}),[b]),Object(De.useEffect)((function(){c({type:"SET_STATS_MUTATE",mutateStats:P})}),[P]),Object(De.useEffect)((function(){c({type:"SET_SETTINGS_MUTATE",mutateSettings:D})}),[D]);var E=Object(a.H)(v,[],!0),R=E.busy,w=E.data,_=E.total,k=E.error;Object(De.useEffect)((function(){c({type:R?"PUSH_BUSY":"POP_BUSY"})}),[R]),Object(De.useEffect)((function(){c({type:"ENTRIES_UPDATED",entries:w})}),[w]),Object(De.useEffect)((function(){c({type:"TOTAL_UPDATED",total:_})}),[_]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:k})}),[k]);var O=Object(r.b)(p,a.F),x=O.data,P=O.mutate,T=Object(a.H)(x,Ye,!0),S=T.busy,A=T.data,j=T.error;Object(De.useEffect)((function(){c({type:S?"PUSH_BUSY":"POP_BUSY"})}),[S]),Object(De.useEffect)((function(){c({type:"STATS_UPDATED",stats:A})}),[A]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:j})}),[j]);var I=Object(r.b)(y,a.F),C=I.data,D=I.mutate,M=Object(a.H)(C,{},!0),U=M.busy,B=M.data,N=M.error;return Object(De.useEffect)((function(){c({type:U?"PUSH_BUSY":"POP_BUSY"})}),[U]),Object(De.useEffect)((function(){c({type:"SETTINGS_UPDATED",settings:B})}),[B]),Object(De.useEffect)((function(){c({type:"ERROR_UPDATED",apiError:N})}),[N]),React.createElement(Xe.Provider,{value:[o,c]},t)},Ke=function(){var e={},t=Me(Object(De.useContext)(Xe),2),n=t[0],r=t[1];return e.setSelectedItems=function(e){r({type:"ITEMS_SELECTED",selectedItems:e})},e.setStatus=function(e){r({type:"STATUS_UPDATED",status:e})},e.updateOption=function(){var e=Ge(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"PUSH_BUSY"}),e.prev=1,e.next=4,Object(a.G)("".concat(m,"/update_option"),{nonce:h,json:{name:o,value:t}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),alert(e.t0);case 9:r({type:"POP_BUSY"}),n.mutateSettings();case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n){return e.apply(this,arguments)}}(),e.updateEntry=function(){var e=Ge(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r({type:"STATUS_UPDATED",status:"Updating..."}),r({type:"PUSH_BUSY"}),e.prev=2,e.next=5,Object(a.G)("".concat(m,"/update_media"),{nonce:h,json:Ne({id:o},t)});case 5:if(e.sent.success){e.next=8;break}throw new Error("Failed to move the folder/gallery.");case 8:n.mutateEntries(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),alert(e.t0.message);case 14:return e.prev=14,r({type:"POP_BUSY"}),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),e.setPage=function(e){r({type:"PAGE_UPDATED",page:e})},e.setLimit=function(e){r({type:"LIMIT_UPDATED",limit:e})},e.setFilter=function(e){r({type:"FILTER_UPDATED",filter:e})},e.setSort=function(e){r({type:"SORT_UPDATED",sort:e})},e.setSearch=function(e){r({type:"SEARCH_UPDATED",search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:"TOGGLE_MODAL",modal:e,enable:t})},e.pushBusy=function(){r({type:"PUSH_BUSY"})},e.popBusy=function(){r({type:"POP_BUSY"})},Ne(Ne({},n),e)};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e){return function(e){if(Array.isArray(e))return lt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ct(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.")}()}function rt(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function at(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){rt(o,r,a,c,l,"next",e)}function l(e){rt(o,r,a,c,l,"throw",e)}c(void 0)}))}}function ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],c=!0,l=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||ct(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var it=wp.element,ut=it.useState,st=it.useEffect,mt=it.useMemo,dt={width:40,height:40,objectFit:"cover"},ft=[{accessor:"thumbnail_url",title:l.THUMB,style:{width:16}},{accessor:"post_title",title:l.TITLE,sortable:!0,style:{width:"25%"}},{accessor:"post_parent",title:l.ATTACHED_TO,sortable:!0,style:{width:"25%"}},{accessor:"current_filename",title:l.FILENAME,sortable:!0}],pt=function(){var e=Ke(),t=e.apiErrors,n=e.busy,r=e.selectedItems,o=e.entries,c=e.stats,i=e.total,u=e.filterBy,s=e.search,d=e.status,f=e.sort,g=e.page,v=e.limit,b=e.modals,E=Ke(),R=E.setSelectedItems,w=E.setSearch,_=E.setStatus,k=E.setSort,O=E.setPage,x=E.setLimit,P=E.setFilter,T=E.mutateEntries,S=E.mutateStats,A=E.toggleModal,I=E.updateOption,C=E.updateEntry,D=ot(ut(!1),2),M=D[0],U=D[1],B=ot(ut(""),2),N=B[0],L=B[1],F=ot(ut(),2),G=F[0],q=F[1],z=Object(a.J)(),H=mt((function(){return o.map((function(e){return{id:e.ID,thumbnail_url:React.createElement("img",{src:e.thumbnail_url,style:dt}),post_title:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement(a.j,{icon:"pencil",width:"20",height:"20",color:a.z.blue,style:{marginLeft:"2px",cursor:"pointer"},onClick:function(){q(e),A("editTitle")}})),post_parent:React.createElement("div",{style:{maxHeight:35,overflow:"hidden"}},e.post_parent_title?e.post_parent_title:React.createElement("i",{style:{color:"#c1c1c1"}},"None")),current_filename:React.createElement(j,{entry:e,mutate:function(){T(),S()}})}}))}),[o]);st((function(){R([]),k(),O(1)}),[u,s]),st((function(){if(null!==z.busy&&(U(z.busy),!z.busy)){var e=z.getErrorCount();e>0&&L("The process has finished, but ".concat(e," error(s) occurred (check your console).")),z.reset(),R([]),T(),S()}}),[z.busy]);var Y=function(){var e=at(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/get_all_ids"),{nonce:h,json:{unlockedOnly:t}});case 2:if((n=e.sent).success){e.next=6;break}return alert(n.message),e.abrupt("return",[]);case 6:return e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),W=function(){var e=at(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/get_all_post_ids"),{nonce:h});case 2:if((t=e.sent).success){e.next=6;break}return alert(t.message),e.abrupt("return",[]);case 6:return e.abrupt("return",t.data);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _("Preparing..."),U(!0),e.next=4,W();case 4:if(!(t=e.sent)){e.next=11;break}return _("Auto attaching..."),n=Object(a.E)(t,20),r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(a.G)("".concat(m,"/auto_attach"),{nonce:h,json:{postIds:e},signal:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 11:U(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return _("Undoing..."),r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _("Undo Media ".concat(e)),t.next=3,Object(a.G)("".concat(m,"/undo"),{nonce:h,json:{mediaId:e},signal:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 16:U(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return _("Analyzing..."),r=Object(a.E)(n,20),o=r.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(a.G)("".concat(m,"/analyze"),{nonce:h,json:{mediaIds:e},signal:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(o),e.abrupt("return");case 17:U(!1);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o,c,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(l.length>0&&void 0!==l[0])||l[0],n=l.length>1&&void 0!==l[1]?l[1]:null,_("Preparing..."),U(!0),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,Y(t);case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=18;break}return _("".concat(t?"Locking..":"Unlocking...")),o=Object(a.E)(r,50),c=o.map((function(e){return function(){var e=at(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.G)("".concat(m,"/set_lock"),{nonce:h,json:{mediaIds:r,lock:t},signal:n});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})),z.start(c),e.abrupt("return");case 18:U(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=at(regeneratorRuntime.mark((function e(){var t,n,r,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,_("Preparing..."),U(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,Y(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=15;break}return r=n.map((function(e){return function(){var t=at(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _("Renaming #".concat(e)),t.next=3,Object(a.G)("".concat(m,"/rename"),{nonce:h,json:{mediaId:e},signal:n});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),z.start(r),e.abrupt("return");case 15:U(!1);case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=at(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C({post_title:t.post_title},t.ID);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){var e=at(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I(t,"mfrh_posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=React.createElement(React.Fragment,null,React.createElement("div",null,"All your posts, pages, products (and other post types) will be scanned, and if images are used in them, they will be attached. Currently, Featured Images and Product Galleries are supported. Should we start?"),!p&&React.createElement("div",{style:{marginTop:20}},React.createElement("b",null,"This feature is only available in the Pro version."))),te=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-file-renamer/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.q,{nekoErrors:[t]},React.createElement(a.i,{title:"Media File Renamer | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a.c,{className:"header",onClick:function(){return window.open("https://meowapps.com/media-file-renamer-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=mfrh_settings"}},"Settings"))),React.createElement(a.C,null,React.createElement(a.f,{full:!0},!p&&React.createElement(a.g,{footer:te},React.createElement(a.B,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Renamer. If you don't know how, give a try to ",React.createElement("a",{target:"_blank",href:"https://meow.click/blogvault"},"BlogVault"),". It is also highly recommanded to read the tutorial. Last but not least, check the ",React.createElement("b",null,"Pro Version"),", as it adds many features and also supports the development. This message is only displayed in the free version. Thank you!")),React.createElement(a.A,null,React.createElement(a.c,{onClick:function(){return J()}},"Analyze Library"),React.createElement(a.c,{onClick:function(){return A("autoAttach")}},"Auto Attach"),"pending"===u&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return Q(r)}},"Rename ",React.createElement("strong",null,r.length)," entries"),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0,r)}},"Lock ",React.createElement("strong",null,r.length)," entries")),y&&"renamed"===u&&r.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return $(r)}},"Undo ",React.createElement("strong",null,r.length)," entries")),React.createElement("div",{style:{flex:1}},M&&React.createElement(a.s,{status:function(e){return"".concat(d," (").concat(e,"%)")},busy:M,value:z.value,max:z.max,onStopClick:z.stop})),!(n||M)&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){w(e)},value:s,onEnter:function(e){w(e)}}),!s&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),s&&React.createElement(a.j,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.z.blue,onClick:function(){w("")}})),"all"===u&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return X(!0)}},"Lock ",React.createElement("strong",null,"All")),React.createElement(a.c,{className:"secondary",onClick:function(){return X(!1)}},"Unlock ",React.createElement("strong",null,"All"))),("all"===u||"pending"===u)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return A("renameAll")}},"Rename ",React.createElement("strong",null,"All"))),y&&("all"===u||"renamed"===u)&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"danger",onClick:function(){return A("undoAll")}},"Undo ",React.createElement("strong",null,"All")))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:u,busy:n||M,onChange:function(e){P(e),O(1)}},React.createElement(a.l,{title:l.PENDING,value:"pending",count:c.pending}),React.createElement(a.l,{title:"Renamed",value:"renamed",count:c.renamed}),React.createElement(a.l,{title:"Locked",value:"locked",count:c.locked}),React.createElement(a.l,{title:"All",value:"all",count:c.all})),React.createElement(a.r,{currentPage:g,limit:v,total:i,onClick:function(e){return O(e)}})),React.createElement(a.x,{busy:n||M,data:H,columns:ft,sort:f,onSortChange:function(e,t){k({accessor:e,by:t})},onSelect:function(e){R([].concat(nt(r),nt(e)))},onUnselect:function(e){R(nt(r.filter((function(t){return!e.includes(t)}))))},selectedItems:r}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:v,onChange:function(e){x(e),O(1),Z(e)}},React.createElement(a.p,{value:5,label:"5 items per page"}),React.createElement(a.p,{value:10,label:"10 items per page"}),React.createElement(a.p,{value:25,label:"25 items per page"}),React.createElement(a.p,{value:50,label:"50 items per page"}),React.createElement(a.p,{value:100,label:"100 items per page"}),React.createElement(a.p,{value:200,label:"200 items per page"})),React.createElement(a.r,{currentPage:g,limit:v,total:i,onClick:function(e){return O(e)}}))),React.createElement(a.o,{isOpen:b.autoAttach,onRequestClose:function(){return A("autoAttach",!1)},title:"Automatically attach your images to your posts",content:ee,ok:p?"Run":"I need the Pro Version",onOkClick:function(){A("autoAttach",!1),p&&V()},onCancelClick:function(){A("autoAttach",!1)}}),React.createElement(a.o,{isOpen:b.renameAll,onRequestClose:function(){return A("renameAll",!1)},title:"You are about to rename all your (unlocked) files",content:"Renaming files is a dangerous operation. Please make sure you made a backup or your entire WordPress install. Should we start?",onOkClick:function(){A("renameAll",!1),Q()},onCancelClick:function(){A("renameAll",!1)}}),React.createElement(a.o,{isOpen:b.undoAll,onRequestClose:function(){return A("undoAll",!1)},title:"You are about to undo the renaming for all your files",content:"Are you sure you would like to proceed?",onOkClick:function(){A("undoAll",!1),$()},onCancelClick:function(){A("undoAll",!1)}}),React.createElement(a.o,{isOpen:N,title:"Success",ok:"Close",content:N,onOkClick:function(){L(""),z.reset()}}),React.createElement(a.o,{isOpen:b.editTitle,onRequestClose:function(){return A("editTitle",!1)},title:"Edit the title",okOnEnter:!0,content:React.createElement(a.k,{autoFocus:!0,id:"mfrh_edit_title",name:"mfrh_edit_title",placeholder:"title...",value:null==G?void 0:G.post_title,onBlur:function(e){return q(et(et({},G),{},{post_title:e}))}}),onOkClick:function(){A("editTitle",!1),K(G)},onCancelClick:function(){A("editTitle",!1)}})))},ht=wp.element.render,yt={fetcher:a.F,revalidateOnFocus:!1};function gt(){Array.from(document.getElementsByClassName("mfrh-renamer-field")).forEach((function(e){var t=e.getAttribute("data-id");ht(React.createElement(j,{natural:!0,mediaId:t}),e)}))}document.addEventListener("DOMContentLoaded",(function(e){var t,n;new MutationObserver((function(){gt()})).observe(document.documentElement,{childList:!0,subtree:!0}),(t=document.getElementById("mfrh-admin-settings"))&&ht(React.createElement(r.a,{value:yt},React.createElement(Ce,null)),t),(n=document.getElementById("mfrh-media-rename"))&&ht(React.createElement(r.a,{value:yt},React.createElement(Qe,null,React.createElement(pt,null))),n),gt()}))}});
|
2 |
//# sourceMappingURL=index.js.map
|
classes/admin.php
CHANGED
@@ -90,6 +90,7 @@ class Meow_MFRH_Admin extends MeowCommon_Admin {
|
|
90 |
'mfrh_acf_field_name' => false,
|
91 |
'mfrh_images_only' => false,
|
92 |
'mfrh_posts_per_page' => 10,
|
|
|
93 |
);
|
94 |
}
|
95 |
|
90 |
'mfrh_acf_field_name' => false,
|
91 |
'mfrh_images_only' => false,
|
92 |
'mfrh_posts_per_page' => 10,
|
93 |
+
'mfrh_clean_uninstall' => false,
|
94 |
);
|
95 |
}
|
96 |
|
classes/core.php
CHANGED
@@ -293,7 +293,9 @@ SQL;
|
|
293 |
}
|
294 |
|
295 |
if ( !empty( $manual_filename ) ) {
|
296 |
-
|
|
|
|
|
297 |
$output['manual'] = true;
|
298 |
}
|
299 |
else {
|
293 |
}
|
294 |
|
295 |
if ( !empty( $manual_filename ) ) {
|
296 |
+
// Through the new_filename to rename, even it is manual.
|
297 |
+
// To validate the filename (i.g. space will be “-“), use the $manual_filename as the first argument $text.
|
298 |
+
$new_filename = $this->new_filename($manual_filename, $old_filename, null, $post);
|
299 |
$output['manual'] = true;
|
300 |
}
|
301 |
else {
|
media-file-renamer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Media File Renamer
|
4 |
Plugin URI: https://meowapps.com
|
5 |
Description: Renames your media files for better SEO and a nicer filesystem (automatically or manually).
|
6 |
-
Version: 5.2.
|
7 |
Author: Jordy Meow
|
8 |
Author URI: https://meowapps.com
|
9 |
Text Domain: media-file-renamer
|
@@ -14,7 +14,7 @@ Originally developed for two of my websites:
|
|
14 |
- Haikyo (https://haikyo.org)
|
15 |
*/
|
16 |
|
17 |
-
define( 'MFRH_VERSION', '5.2.
|
18 |
define( 'MFRH_PREFIX', 'mfrh' );
|
19 |
define( 'MFRH_DOMAIN', 'media-file-renamer' );
|
20 |
define( 'MFRH_ENTRY', __FILE__ );
|
3 |
Plugin Name: Media File Renamer
|
4 |
Plugin URI: https://meowapps.com
|
5 |
Description: Renames your media files for better SEO and a nicer filesystem (automatically or manually).
|
6 |
+
Version: 5.2.8
|
7 |
Author: Jordy Meow
|
8 |
Author URI: https://meowapps.com
|
9 |
Text Domain: media-file-renamer
|
14 |
- Haikyo (https://haikyo.org)
|
15 |
*/
|
16 |
|
17 |
+
define( 'MFRH_VERSION', '5.2.8' );
|
18 |
define( 'MFRH_PREFIX', 'mfrh' );
|
19 |
define( 'MFRH_DOMAIN', 'media-file-renamer' );
|
20 |
define( 'MFRH_ENTRY', __FILE__ );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://commerce.coinbase.com/checkout/d047546a-77a8-41c8-9ea9-4a95
|
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 7.0
|
8 |
-
Stable tag: 5.2.
|
9 |
|
10 |
Renames your media files for better SEO and a nicer filesystem (automatically or manually).
|
11 |
|
@@ -67,6 +67,10 @@ The plugin can be tweaked in many ways, there are many actions and filters avail
|
|
67 |
|
68 |
== Changelog ==
|
69 |
|
|
|
|
|
|
|
|
|
70 |
= 5.2.7 (2021/09/03) =
|
71 |
* Fix: Security update: access controls to the REST API and the options enforced.
|
72 |
* Updated: Dependencies update.
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.8
|
7 |
Requires PHP: 7.0
|
8 |
+
Stable tag: 5.2.8
|
9 |
|
10 |
Renames your media files for better SEO and a nicer filesystem (automatically or manually).
|
11 |
|
67 |
|
68 |
== Changelog ==
|
69 |
|
70 |
+
= 5.2.8 (2021/09/07) =
|
71 |
+
* Add: Option to clean the plugin data on uninstall.
|
72 |
+
* Add: Manual Rename now goes through the cleaning flow to make sure everything is clean and nice.
|
73 |
+
|
74 |
= 5.2.7 (2021/09/03) =
|
75 |
* Fix: Security update: access controls to the REST API and the options enforced.
|
76 |
* Updated: Dependencies update.
|
uninstall.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
|
6 |
+
if ( !get_option( 'mfrh_clean_uninstall', false ) ) {
|
7 |
+
return;
|
8 |
+
}
|
9 |
+
|
10 |
+
global $wpdb;
|
11 |
+
$options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'mfrh_%'" );
|
12 |
+
foreach ( $options as $option ) {
|
13 |
+
delete_option( $option->option_name );
|
14 |
+
}
|