Media Cleaner - Version 6.3.8

Version Description

(2022/06/13) = * Fix: The links and thumbnails were broken in the Dashboard Trash. * Info: New plugin the the family! It is simply called Database Cleaner, and it aims to be... the best Database Cleaner! You can find it here.

Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 Media Cleaner
Version 6.3.8
Comparing to
See all releases

Code changes from version 6.3.7 to 6.3.8

Files changed (5) hide show
  1. app/index.js +1 -1
  2. classes/rest.php +16 -0
  3. common/ratings.php +20 -15
  4. media-cleaner.php +2 -2
  5. readme.txt +5 -2
app/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e){function t(t){for(var r,o,i=t[0],l=t[1],s=t[2],m=0,p=[];m<i.length;m++)o=i[m],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==a[l]&&(r=!1)}r&&(c.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={0:0},c=[];function o(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,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var i=window.wpJsonWpmc=window.wpJsonWpmc||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;c.push([140,1]),n()}({0:function(e,t){e.exports=React},131:function(e,t){e.exports=ReactDOM},140:function(e,t,n){"use strict";n.r(t);var r=n(12),a=n(2),c=wpmc_media_cleaner.prefix,o=wpmc_media_cleaner.domain,i=wpmc_media_cleaner.rest_url.replace(/\/+$/,""),l=wpmc_media_cleaner.api_url.replace(/\/+$/,""),s=wpmc_media_cleaner.plugin_url.replace(/\/+$/,""),u="1"===wpmc_media_cleaner.is_pro,m=u&&"1"===wpmc_media_cleaner.is_registered,p=wpmc_media_cleaner.rest_nonce,f=n(4);function d(){var e=v(["\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"]);return d=function(){return e},e}function h(){var e=v(["\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"]);return h=function(){return e},e}function y(){var e=v(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]);return y=function(){return e},e}function b(){var e=v(["\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"]);return b=function(){return e},e}function g(){var e=v(["\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"]);return g=function(){return e},e}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=f.a.div(g()),R=Object(f.a)(a.a)(b()),w=f.a.img(y()),_=f.a.div(h()),k=f.a.ul(d());function x(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(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 O(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function S(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){O(c,r,a,o,i,"next",e)}function i(e){O(c,r,a,o,i,"throw",e)}o(void 0)}))}}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||A(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 A(e,t){if(e){if("string"==typeof e)return P(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)?P(e,t):void 0}}function P(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 j=wp.element,C=j.useState,I=j.useEffect,D="".concat(i,"/meow-common/v1"),M=function(e){var t=e.request,n=e.title,r=e.max,c=T(C(!1),2),o=c[0],i=c[1],l=T(C([]),2),s=l[0],u=l[1],m=s.length>0?s.reduce((function(e,t){return e+t})):0,f=s.length>0?Math.ceil(m/s.length):0,d=!s.length&&o;I((function(){o&&setTimeout(S(regeneratorRuntime.mark((function e(){var n,r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.F)("".concat(D,"/").concat(t),{nonce:p});case 3:r=(new Date).getTime(),c=r-n,u((function(e){return[].concat(x(e),[c])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[s]);return React.createElement(E,{style:{width:200,textAlign:"center"}},React.createElement(a.A,{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":s.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:o?"#cc3627":"#ccb027",onClick:function(){o||u([]),i(!o)}},o?"Stop":"Start"))};function B(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){U(c,r,a,o,i,"next",e)}function i(e){U(c,r,a,o,i,"throw",e)}o(void 0)}))}}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q(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 q(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 q(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 W=wp.element,H=W.useState,G=W.useEffect;l&&i&&s||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var Y="".concat(i,"/meow-common/v1"),V=React.createElement(E,null,React.createElement(a.A,{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"),".")),$=React.createElement(E,null,React.createElement(a.A,{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.A,{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"),".")),X=React.createElement(E,null,React.createElement(a.A,{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.A,{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.A,{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"))))),J=["".concat(Y,"/all_settings/"),{headers:{"X-WP-Nonce":p}}],K=function(){var e=z(H(!1),2),t=e[0],n=e[1],c=Object(r.b)(J,a.E),o=c.data,i=c.mutate,l=c.error,u=null==o?void 0:o.data,m=null==u?void 0:u.meowapps_hide_meowapps,f=null==u?void 0:u.force_sslverify,d=z(H(!1),2),h=d[0],y=d[1],b=z(H([]),2),g=b[0],v=b[1],x=z(H(""),2),O=x[0],S=x[1];G((function(){l&&!t&&(n(!0),console.error("Error from UseSWR",l.message))}),[l]),G((function(){var e=document.getElementById("meow-common-phpinfo");S(e.innerHTML)}),[]);var T=function(){var e=L(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=N({},o.data))[n]=t,i(N(N({},o),{},{data:r}),!1),y(!0),e.next=6,Object(a.F)("".concat(Y,"/update_option"),{json:{name:n,value:t},nonce:p});case 6:c=e.sent,y(!1),c.success||alert(c.message),i();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),A=function(){var e=L(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.F)("".concat(Y,"/error_logs"),{nonce:p});case 3:t=e.sent,n=t&&t.data?t.data:[],v(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=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.A,{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:h,checked:m,onChange:T}))),j=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.A,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:h,checked:f,onChange:T})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},V,React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(R,{title:"Media Cleaner",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/media-cleaner.png")}),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(R,{title:"Database Cleaner",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(R,{title:"Media File Renamer",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/media-file-renamer.png")}),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(R,{title:"Social Engine",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(R,{title:"Meow Analytics",className:"primary"},React.createElement(w,{src:"".concat(s,"/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(R,{title:"Photo Engine",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/wplr-sync.png")}),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(R,{title:"Meow Gallery",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/meow-gallery.png")}),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(R,{title:"Meow Lightbox",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/meow-lightbox.png")}),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(R,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/wp-retina-2x.png")}),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(R,{title:"Contact Form Block",className:"primary"},React.createElement(w,{src:"".concat(s,"/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(a.w,{title:"Performance"},$,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(M,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(M,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(M,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},X),React.createElement(a.w,{title:"PHP Info"},React.createElement(_,{dangerouslySetInnerHTML:{__html:O}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(E,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:A},"Load PHP Error Logs"),React.createElement(k,null,g.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"},P,j))))))};function Q(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Z(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Q(c,r,a,o,i,"next",e)}function i(e){Q(c,r,a,o,i,"throw",e)}o(void 0)}))}}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(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}var ne=wp.element,re=ne.useState,ae=ne.useEffect,ce="".concat(i,"/meow-licenser/").concat(c,"/v1"),oe=function(){var e=ee(re(!1),2),t=e[0],n=e[1],r=ee(re(!1),2),c=r[0],o=r[1],i=ee(re(null),2),l=i[0],s=i[1],f=ee(re(null),2),d=f[0],h=f[1],y=ee(re(""),2),b=y[0],g=y[1],v=m&&(!d||"valid"!==d.license),E=function(){var e=Z(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.F)("".concat(ce,"/get_license"),{nonce:p});case 5:t=e.sent,h(t.data),t.data.key&&g(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=Z(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.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:null}});case 3:e.sent.success&&(g(""),h(null),s("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=Z(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.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:b,override:!0}});case 3:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=Z(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==b){e.next=5;break}return o(!0),h(null),g(""),e.abrupt("return");case 5:return n(!0),e.next=8,Object(a.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:b}});case 8:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ae((function(){E()}),[]);var k=v?"Forced License":m?"Enabled":"Disabled",x=v||d&&"valid"===d.license,O="Your license is active. Thanks a lot for your support :)";v&&d&&d.check_url&&(O=React.createElement(React.Fragment,null,React.createElement("span",null,O),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:d.check_url+"&cache="+642e3*Math.random()},"here"),"."))),x||(d?"no_activations_left"===d.issue?O=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://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===d.issue?O=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://meowapps.com"},"Meow Apps Store"),"."):"missing"===d.issue?O="This license does not exist.":"disabled"===d.issue?O="This license has been disabled.":"item_name_mismatch"===d.issue?O="This license seems to be for a different plugin... isn't it? :)":"forced"===d.issue?O="ABC":(O=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:d})):O="Unknown error :(");var S=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://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://meowapps.com/"},"Meow Apps Store"),"."),T=React.createElement(a.a,{title:"Pro Version (".concat(k,")"),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:b,onChange:function(e){return g(e)},placeholder:""})),d&&!x&&React.createElement(a.m,null,O),d&&x&&React.createElement(a.n,null,O),!d&&React.createElement(a.A,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://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"},d&&!x&&React.createElement(a.c,{className:"secondary",disabled:t||!b,onClick:_},"Retry to validate"),d&&d.key===b&&React.createElement(a.c,{className:"secondary",disabled:t||!b,onClick:R},"Remove License"),React.createElement(a.c,{disabled:t||!b||d&&d.key===b,onClick:_},"Validate License"),c&&!x&&React.createElement(a.c,{disabled:t||!b||d&&d.key===b,onClick:w,className:"danger"},"Force License")),React.createElement(a.o,{isOpen:"licenseAdded"===l,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"===l,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return u?T:S},ie=wp.element.render;function le(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){ue(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){me(c,r,a,o,i,"next",e)}function i(e){me(c,r,a,o,i,"throw",e)}o(void 0)}))}}function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return de(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 de(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 de(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&&ie(React.createElement(K,null),t)})));var he=wp.element,ye=he.useState,be=he.useMemo,ge={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)"},ve=function(){var e=be((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),t=Object(r.b)(e,a.E),n=t.data,i=t.mutate,s=Object(a.G)(n,{},!0),f=s.busy,d=s.data,h=s.error,y=fe(ye(!1),2),b=y[0],g=y[1],v=fe(ye(""),2),E=v[0],R=v[1],w=fe(ye(),2),_=w[0],k=w[1],x=f||b,O=null==d?void 0:d.wpmc_content,S=null==d?void 0:d.wpmc_filesystem_content,T=null==d?void 0:d.wpmc_media_library,A=null==d?void 0:d.wpmc_live_content,P=null==d?void 0:d.wpmc_debuglogs,j=null==d?void 0:d.wpmc_images_only,C=null==d?void 0:d.wpmc_attach_is_use,I=null==d?void 0:d.wpmc_thumbnails_only,D=null==d?void 0:d.wpmc_dirs_filter,M=null==d?void 0:d.wpmc_files_filter,B=null==d?void 0:d.wpmc_hide_thumbnails,N=null==d?void 0:d.wpmc_hide_warning,F=null==d?void 0:d.wpmc_medias_buffer,U=null==d?void 0:d.wpmc_posts_buffer,L=null==d?void 0:d.wpmc_analysis_buffer,z=null==d?void 0:d.wpmc_file_op_buffer,q=null==d?void 0:d.wpmc_delay,W=null==d?void 0:d.wpmc_shortcodes_disabled,H=null==d?void 0:d.wpmc_clean_uninstall,G=function(){var e=pe(regeneratorRuntime.mark((function e(t,r){var c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(c=se({},n.data))[r]=t,i(se(se({},n),{},{data:c}),!1),g(!0),e.prev=4,e.next=7,Object(a.F)("".concat(l,"/update_option"),{json:{name:r,value:t},nonce:p});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,g(!1),i(),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)}}(),Y=function(){var e=pe(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/reset_db"),{nonce:p});case 3:k("resetDb"),g(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=pe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/refresh_logs"),{nonce:p});case 3:(t=e.sent).success&&R(t.data),g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=pe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/clear_logs"),{nonce:p});case 3:(t=e.sent).success&&R(t.data),g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=React.createElement(a.v,{title:"Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_content",label:"Check",description:"Checks if the media entries are used by the content (Posts, Pages and other Post Types, Metadata, Widgets, etc). Pagebuilders are only supported in the Pro Version.",value:"1",checked:O,onChange:G}))),J=React.createElement(a.v,{title:"Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_filesystem_content",label:"Check",description:"Checks if the files are used by the content (Posts, Pages and other Post Types, Metadata, Widgets, etc).",value:"1",checked:S,onChange:G}))),K=React.createElement(a.v,{title:"Media Library"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_media_library",label:"Check",description:"Checks if the files are properly registered in the Media Library.",value:"1",checked:T,onChange:G}))),Q=React.createElement(a.v,{title:"Live Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_live_content",label:"Check",description:"The live version of the site will be also analyzed (as if a visitor was loading it). It increases the accuracy of the results but slows down the speed dramatically.",value:"1",requirePro:!m,checked:A,onChange:G}))),Z=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_images_only",label:"Enable",description:"Restricts the scan to images. Nothing else will be scanned.",value:"1",checked:j,onChange:G}))),ee=React.createElement(a.v,{title:"Attached Images"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_attach_is_use",label:"Consider as In Use",description:React.createElement(React.Fragment,null,"If a media entry is attached (in the Media Library, it is the ",React.createElement("b",null,"Uploaded To")," field), it will be considered as being used."),value:"1",checked:C,onChange:G}))),te=React.createElement(a.v,{title:"Thumbnails Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_thumbnails_only",label:"Enable",description:"Restricts Media Cleaner to scan thumbnails. With WordPress, those filenames contain the resolution.",value:"1",checked:I,onChange:G}))),ne=React.createElement(a.v,{title:"Directories Filter"},React.createElement(a.k,{id:"wpmc_dirs_filter",name:"wpmc_dirs_filter",value:D,placeholder:"/regex/",onEnter:G,onBlur:G})),re=React.createElement(a.v,{title:"Files Filter"},React.createElement(a.k,{id:"wpmc_files_filter",name:"wpmc_files_filter",value:M,placeholder:"/regex/",onEnter:G,onBlur:G})),ae=React.createElement(a.v,{title:"Thumbnails"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_hide_thumbnails",label:"Hide",description:"If you prefer not to see the thumbnails.",value:"1",checked:B,onChange:G}))),ce=React.createElement(a.v,{title:"Warning Message"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_hide_warning",label:"Hide",description:"Have you read it twice? If yes, hide it :)",requirePro:!m,value:"1",checked:N,onChange:G}))),ie=React.createElement(a.v,{title:"Plugin Data"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_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:H,onChange:G}))),le=React.createElement(a.v,{title:"Medias Buffer"},React.createElement(a.k,{id:"wpmc_medias_buffer",type:"number",value:F,min:"1",max:"1000",onEnter:G,onBlur:G,description:"The number of media entries to read at a time. This is fast, so the value should be between 50 and 1000."})),ue=React.createElement(a.v,{title:"Posts Buffer"},React.createElement(a.k,{id:"wpmc_posts_buffer",type:"number",value:U,min:"1",max:"100",onEnter:G,onBlur:G,description:"The number of posts (and any other post types) to analyze at a time. This is the most intense part of the process. Recommended value is between 1 (slow server) and 20 (excellent server)."})),me=React.createElement(a.v,{title:"Analysis Buffer"},React.createElement(a.k,{id:"wpmc_analysis_buffer",type:"number",value:L,min:"1",max:"1000",onEnter:G,onBlur:G,description:"The number of media entries or files to analyze at a time. This is the main part of the process, but is is much faster than analyzing each post. Recommended value is between 20 (slow server) and 1000 (excellent server)."})),de=React.createElement(a.v,{title:"File Operation Buffer"},React.createElement(a.k,{id:"wpmc_file_op_buffer",type:"number",value:z,min:"1",max:"100",onEnter:G,onBlur:G,description:"The number of media entries or files to delete at a time. This highly depends on your server, it is normally quite fast. Recommended value is between 5 (slow server) and 100 (excellent server). "})),he=React.createElement(a.v,{title:"Delay (in ms)"},React.createElement(a.k,{id:"wpmc_delay",type:"number",value:q,min:"0",max:"20000",onEnter:G,onBlur:G,description:"Time to wait between each request (in milliseconds). The overall process is intensive so this gives the chance to your server to chill out a bit. A very good server doesn't need it, but a slow/shared hosting might even reject requests if they are too fast and frequent. Recommended value is actually 0, 100 for safety, 2000 or 5000 if your hosting is kind of cheap."})),ve=React.createElement(a.v,{title:"Shortcodes"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_shortcodes_disabled",label:"Disable Analysis",description:"Resolving shortcodes increase accuracy, but makes the process slower and takes more memory.",value:"1",checked:W,onChange:G}))),Ee=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_debuglogs",label:"Enable",description:React.createElement(a.A,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:P,onChange:G}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:V},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:$},"Clear Logs"))));return React.createElement(a.q,{nekoErrors:[h]},React.createElement(a.o,{isOpen:"resetDb"===_,onRequestClose:function(){k(null)},title:"Done!",content:"The Media Cleaner's database has been deleted. It will be re-created automatically next time you visit the Media Cleaner Dashboard.",onOkClick:function(){k(null)}}),React.createElement(a.i,{title:"Media Cleaner | 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-cleaner-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=wpmc_dashboard"}},"Dashboard"))),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(a.g,{footer:React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return location.href="upload.php?page=wpmc_dashboard"}},"Access Media Cleaner Dashboard"),React.createElement(a.c,{className:"danger",onClick:Y},"Delete Cleaner DB"))},React.createElement(a.A,{p:!0},"There are two kinds of scan. Usually, the ",React.createElement("b",null,"Media Library")," should be scanned first for images which are not used (Content = Check). Then, the ",React.createElement("b",null,"Filesystem")," should be scanned for images which aren't registered in the Media Library (Media Library = Check). Check the ",React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-cleaner-tutorial/"},"tutorial")," tutorial for more information. If you wish to clean your ",React.createElement("b",null,"Database"),", try ",React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner"),", you will love it! 💕")),React.createElement(a.y,{keepTabOnReload:!0},React.createElement(a.w,{title:"Media Library Scan"},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Scanning",className:"primary"},X,Q,(O||A)&&React.createElement(a.A,{p:!0},"If you would like Media Cleaner to analyze your Media Library for broken entries, uncheck everything above."),!O&&!A&&React.createElement(a.A,{p:!0},React.createElement("b",null,"Since Content and Live Content are not checked, Media Cleaner will analyze your Media Library for ",React.createElement("u",null,"broken entries"),".")))),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Filters",className:"primary"},Z),React.createElement(a.a,{busy:x,title:"Extra Rules",className:"primary"},ee)))),React.createElement(a.w,{title:"Filesystem Scan",requirePro:!m},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Scanning",className:"primary"},K,J,Q,React.createElement(a.A,{p:!0},"If none of the checks above are selected, you will get the list of all your files."))),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Filters",className:"primary"},te,ne,re)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"UI & Logs",className:"primary"},ae,ce),React.createElement(a.a,{busy:x,title:"On Uninstall",className:"primary"},ie)),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Advanced Settings",className:"primary"},le,ue,me,de,he,ve)))),React.createElement(a.w,{title:"License"},React.createElement(oe,{domain:o,prefix:c,isPro:u,isRegistered:m})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:x,className:"primary"},Ee),React.createElement("div",{style:ge},E))))))},Ee=n(0);function Re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return we(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 we(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 we(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 _e(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 ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){xe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xe(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,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Oe(c,r,a,o,i,"next",e)}function i(e){Oe(c,r,a,o,i,"throw",e)}o(void 0)}))}}var Te,Ae,Pe,je={issues:"-",ignored:"-",trash:"-"},Ce={accessor:"size",by:"desc"},Ie=0,De={filterBy:"issues",sort:Ce,page:1,limit:10,search:"",busy:!1,stats:je,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,method:"media",content:!0,mediaLibrary:!1,hideThumbnails:!1,postsBuffer:5,mediasBuffer:100,analysisBuffer:100,fileOpBuffer:20,delay:100,modals:{deleteAll:!1,trashAll:!1,recoverAll:!1},mutateEntries:(Pe=Se(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 Pe.apply(this,arguments)}),mutateStats:(Ae=Se(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 Ae.apply(this,arguments)}),mutateSettings:(Te=Se(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 Te.apply(this,arguments)})},Me=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return ke(ke({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return ke(ke({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return ke(ke({},e),{},{apiErrors:a});case"PAGE_UPDATED":var c=t.page;return ke(ke({},e),{},{page:c});case"SET_ENTRIES_MUTATE":var o=t.mutateEntries;return ke(ke({},e),{},{mutateEntries:o});case"SET_STATS_MUTATE":var i=t.mutateStats;return ke(ke({},e),{},{mutateStats:i});case"SET_SETTINGS_MUTATE":var l=t.mutateSettings;return ke(ke({},e),{},{mutateSettings:l});case"LIMIT_UPDATED":var s=t.limit;return ke(ke({},e),{},{limit:s});case"FILTER_UPDATED":var u=t.filter;return ke(ke({},e),{},{filterBy:u});case"SORT_UPDATED":var m=t.sort,p=void 0===m?Ce:m;return ke(ke({},e),{},{sort:p});case"SEARCH_UPDATED":var f=t.search;return ke(ke({},e),{},{search:f});case"TOTAL_UPDATED":var d=t.total;return ke(ke({},e),{},{total:d});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 b=ke({},e);return b.modals=ke({},b.modals),b.modals[h]=y,b;case"PUSH_BUSY":var g=t.status,v=void 0===g?"":g;return ke(ke({},e),{},{busy:++Ie>0,status:v});case"POP_BUSY":var E=t.status,R=void 0===E?"":E;return ke(ke({},e),{},{busy:--Ie>0,status:R});case"STATUS_UPDATED":var w=t.status,_=void 0===w?"":w;return ke(ke({},e),{},{status:_});case"SETTINGS_UPDATED":var k=t.settings,x=k.wpmc_method,O="files"===k.wpmc_method?k.wpmc_filesystem_content:k.wpmc_content,S="files"===k.wpmc_method&&(null==k?void 0:k.wpmc_media_library),T=k.wpmc_hide_thumbnails,A=k.wpmc_posts_buffer?parseInt(k.wpmc_posts_buffer):5,P=k.wpmc_medias_buffer?parseInt(k.wpmc_medias_buffer):100,j=k.wpmc_analysis_buffer?parseInt(k.wpmc_analysis_buffer):100,C=k.wpmc_file_op_buffer?parseInt(k.wpmc_file_op_buffer):20,I=k.wpmc_delay?parseInt(k.wpmc_delay):0,D=k.wpmc_posts_per_page?parseInt(k.wpmc_posts_per_page):10;return ke(ke({},e),{},{method:x,content:O,mediaLibrary:S,hideThumbnails:T,postsBuffer:A,mediasBuffer:P,analysisBuffer:j,fileOpBuffer:C,delay:I,limit:D});case"ITEMS_SELECTED":var M=t.selectedItems;return ke(ke({},e),{},{selectedItems:M});default:return e}},Be=Object(Ee.createContext)(),Ne=function(e){var t=e.children,n=Re(Object(Ee.useReducer)(Me,De),2),c=n[0],o=n[1],i=c.filterBy,s=c.sort,u=c.search,m=c.page,f=c.limit,d=Object(Ee.useMemo)((function(){return[Object(a.C)("".concat(l,"/entries"),{limit:f,skip:(m-1)*f,filterBy:i,orderBy:s.accessor,order:s.by,search:u}),{headers:{"X-WP-Nonce":p}}]}),[i,s,u,m,f,l,p,a.C]),h=Object(Ee.useMemo)((function(){return[Object(a.C)("".concat(l,"/stats"),{search:u}),{headers:{"X-WP-Nonce":p}}]}),[u,l,p,a.C]),y=Object(Ee.useMemo)((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),b=Object(r.b)(d,a.E),g=b.data,v=b.mutate,E=Object(a.G)(g,[],!0),R=E.busy,w=E.data,_=E.total,k=E.error;Object(Ee.useEffect)((function(){o({type:"SET_ENTRIES_MUTATE",mutateEntries:v})}),[v]),Object(Ee.useEffect)((function(){o({type:R?"PUSH_BUSY":"POP_BUSY"})}),[R]),Object(Ee.useEffect)((function(){o({type:"ENTRIES_UPDATED",entries:w})}),[w]),Object(Ee.useEffect)((function(){o({type:"TOTAL_UPDATED",total:_})}),[_]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:k})}),[k]);var x=Object(r.b)(h,a.E),O=x.data,S=x.mutate,T=Object(a.G)(O,je,!0),A=T.busy,P=T.data,j=T.error;Object(Ee.useEffect)((function(){o({type:"SET_STATS_MUTATE",mutateStats:S})}),[S]),Object(Ee.useEffect)((function(){o({type:A?"PUSH_BUSY":"POP_BUSY"})}),[A]),Object(Ee.useEffect)((function(){o({type:"STATS_UPDATED",stats:P})}),[P]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:j})}),[j]);var C=Object(r.b)(y,a.E),I=C.data,D=C.mutate,M=Object(a.G)(I,{},!0),B=M.busy,N=M.data,F=M.error;return Object(Ee.useEffect)((function(){o({type:"SET_SETTINGS_MUTATE",mutateSettings:D})}),[D]),Object(Ee.useEffect)((function(){o({type:B?"PUSH_BUSY":"POP_BUSY"})}),[B]),Object(Ee.useEffect)((function(){o({type:"SETTINGS_UPDATED",settings:N})}),[N]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:F})}),[F]),React.createElement(Be.Provider,{value:[c,o]},t)},Fe=function(){var e={},t=Re(Object(Ee.useContext)(Be),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=Se(regeneratorRuntime.mark((function e(t,c){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.F)("".concat(l,"/update_option"),{json:{name:c,value:t},nonce:p});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.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"})},ke(ke({},n),e)};function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Le(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 Le(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 Le(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 ze=wp.element,qe=ze.useState,We=ze.useMemo,He={borderLeft:"4px solid #007bba"},Ge={borderLeft:"4px solid #f1ad31"},Ye={borderLeft:"4px solid #d85960"},Ve=function(){var e=We((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),t=Ue(qe(!1),2),n=(t[0],t[1],Object(r.b)(e,a.E).data),c=Object(a.G)(n,{wpmc_hide_warning:!0},!0).data,o=c.wpmc_method,i="files"===c.wpmc_method?c.wpmc_filesystem_content:c.wpmc_content,s="files"===c.wpmc_method&&(null==c?void 0:c.wpmc_media_library),u=c.wpmc_hide_warning,f=c.incompatible_plugins,d=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-cleaner/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-cleaner-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(React.Fragment,null,"media"===o&&!i&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your Media Library for broken entries.")),"media"===o&&i&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your Media Library for entries which aren't used in your content.")),"files"===o&&i&&s&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your physical directories for files which are not registered in the Media Library or not used directly in your content.")),"files"===o&&!i&&s&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your physical directories for files which are not registered in the Media Library.")),!u&&React.createElement(a.g,{style:Ge},React.createElement(a.A,{p:!0},React.createElement("p",null,React.createElement("b",null,React.createElement("span",{style:{color:"red"}},"This is important.")," Backup your DB and your /uploads directory before using Media Cleaner.")," The deleted files will be temporarily moved to the ",React.createElement("i",null,"uploads/wpmc-trash")," directory. After testing your site, you can check the ",React.createElement("i",null,"Trash")," in order to empty it or to recover your files. That said, you still must have a backup! If you don't know how, give a try to this: ",React.createElement("a",{href:"http://meow.click/blogvault",target:"_blank"},"BlogVault"),"."),React.createElement("p",null,React.createElement("b",null,React.createElement("span",{style:{color:"red"}},"Please be considerate.")," Don't blame Media Cleaner if it deleted too many (or not enough) of your files.")," WordPress being a very dynamic and pluggable system, it is impossible to predict all the situations in which your files are used. Please do not post a bad review because it broke your install; if you have a proper backup, there is no risk! You can disable this big warning in the options if you have the Pro Version. Read this warning twice. Media Cleaner is awesome and constantly gets better so I sincerely hope you will enjoy it. Thank you :)"))),!m&&React.createElement(a.g,{footer:d},React.createElement(a.A,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Cleaner. 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!")),f&&f.length>0&&React.createElement(a.g,{style:Ye},React.createElement(a.A,{p:!0,style:{fontSize:15}},React.createElement("p",null,"Important note about the following plugin(s) which you are using:"),React.createElement("ul",null,f.map((function(e){return React.createElement("li",null,"- ",e)}))),React.createElement("p",null,"They require additional checks which are only implemented in ",React.createElement("a",{target:"_blank",href:"//meowapps.com/plugin/media-cleaner"},"Media Cleaner Pro"),"."))))},$e=function(e){return new Promise((function(t){return setTimeout(t,e)}))};function Xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=tt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,o=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,c=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw c}}}}function Ke(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||tt(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 Qe(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Ze(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Qe(c,r,a,o,i,"next",e)}function i(e){Qe(c,r,a,o,i,"throw",e)}o(void 0)}))}}function et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||tt(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 tt(e,t){if(e){if("string"==typeof e)return nt(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)?nt(e,t):void 0}}function nt(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 rt=wp.element,at=rt.useState,ct=rt.useEffect,ot=rt.useMemo,it=[{id:"media",value:"media",label:"Media Library",requirePro:!1},{id:"files",value:"files",label:"Filesystem",requirePro:!m}],lt={width:40,height:40,objectFit:"cover"},st={NO_CONTENT:"Not found in content",ORPHAN_MEDIA:"Not attached file",ORPHAN_FILE:"Not in library",ORPHAN_RETINA:"Orphan @2x",ORPHAN_WEBP:"Orphan WebP"},ut=function(){var e,t=Fe(),n=t.apiErrors,r=t.busy,c=t.selectedItems,o=t.entries,i=t.stats,s=t.total,u=t.filterBy,m=t.search,f=t.status,d=t.sort,h=t.page,y=t.limit,b=t.method,g=t.content,v=t.mediaLibrary,E=t.hideThumbnails,R=t.postsBuffer,w=t.mediasBuffer,_=t.analysisBuffer,k=t.fileOpBuffer,x=t.delay,O=t.modals,S=Fe(),T=S.setSelectedItems,A=S.setSearch,P=S.setStatus,j=S.setSort,C=S.setPage,I=S.setLimit,D=S.setFilter,M=S.mutateEntries,B=S.mutateStats,N=S.pushBusy,F=S.popBusy,U=S.toggleModal,L=S.updateOption,z=et(at(1),2),q=z[0],W=z[1],H=et(at(1),2),G=H[0],Y=H[1],V=et(at(""),2),$=V[0],X=V[1],J=Object(a.H)(),K=ot((function(){return o.map((function(e){return{id:e.id,thumbnail_url:React.createElement(React.Fragment,null,"ORPHAN_MEDIA"!==e.issue&&React.createElement("a",{href:e.image_url,title:"Open Image",target:"_blank"},React.createElement("img",{src:e.thumbnail_url,style:lt}))),type:React.createElement("span",null,0==e.type&&"Filesystem",1==e.type&&React.createElement("a",{href:"/wp-admin/post.php?post=".concat(e.postId,"&action=edit")},"ID ",e.postId)),path:React.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.title&&React.createElement("a",{href:"/wp-admin/post.php?post=".concat(e.postId,"&action=edit")},React.createElement("span",null,e.title)),React.createElement("span",null,e.path)),issue:React.createElement("span",null,st[e.issue]?st[e.issue]:e.issue),size:React.createElement("span",null,(e.size/1e3).toFixed(2)," KB")}}))}),[o]),Q=[{accessor:"type",title:"Origin",sortable:!0},{accessor:"path",title:"Title & Path",sortable:!0},{accessor:"issue",title:"Issue",sortable:!0},{accessor:"size",title:"Size",sortable:!0}];E||Q.unshift({accessor:"thumbnail_url",title:"",style:{width:16}}),ct((function(){T([]),j(),C(1)}),[u]);var Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(e=null!==e?e:J.getErrorCount())>0&&X("The process has finished, but ".concat(e," error(s) occurred.")),J.reset(),T([]),M(),B()},ee=function(){var e=Ze(regeneratorRuntime.mark((function e(t){var n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:null,e.next=3,Object(a.F)("".concat(l,"/all_ids"),{json:{source:t,search:n},nonce:p});case 3:if((r=e.sent).success){e.next=7;break}return alert(r.message),e.abrupt("return",[]);case 7:return e.abrupt("return",r.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=Ze(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(x>0)){e.next=3;break}return e.next=3,$e(x);case 3:return e.next=5,Object(a.F)("".concat(l,"/count"),{json:{source:t},nonce:p});case 5:return n=e.sent,e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ne=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:null,n=s.length>1&&void 0!==s[1]&&s[1],r=s.length>2&&void 0!==s[2]?s[2]:null,P("Getting IDs..."),N(),!t){e.next=9;break}e.t0=t,e.next=12;break;case 9:return e.next=11,ee(n?"trash":"issues",r);case 11:e.t0=e.sent;case 12:if(!(c=e.t0)){e.next=20;break}return P(n?"Emptying...":"Deleting..."),o=Object(a.D)(c,k),i=o.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/delete"),{json:{entryIds:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=19,J.start(i);case 19:Z();case 20:F(),P();case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,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,P("Getting IDs..."),N(),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,ee("trash");case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return r=Object(a.D)(n,k),c=r.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(P("Recovering..."),!(x>0)){t.next=4;break}return t.next=4,$e(x);case 4:return t.next=6,Object(a.F)("".concat(l,"/recover"),{json:{entryIds:e},signal:n,nonce:p});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=16,J.start(c);case 16:Z();case 17:F(),P();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(i.length>0&&void 0!==i[0])||i[0],n=i.length>1&&void 0!==i[1]?i[1]:null,P("Getting IDs..."),N(),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,ee("issues");case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=19;break}return P("".concat(t?"Ignoring...":"Undoing...")),c=Object(a.D)(r,_),o=c.map((function(e){return function(){var n=Ze(regeneratorRuntime.mark((function n(r){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(x>0)){n.next=3;break}return n.next=3,$e(x);case 3:return n.next=5,Object(a.F)("".concat(l,"/set_ignore"),{json:{entryIds:e,ignore:t},signal:r,nonce:p});case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()})),e.next=18,J.start(o);case 18:Z();case 19:F(),P();case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=Ze(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L(t,"wpmc_posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=Ze(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:J.stop();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){oe(),Z(),F(),P()},le=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i,s,u,m,f,d,h,y,E,k,O,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,N(),T([]),W(1),Y(3+(g?1:0)+("files"===b&&v?1:0)),P("Resetting issues..."),e.next=8,Object(a.F)("".concat(l,"/reset_issues"),{nonce:p});case 8:if(W((function(e){return e+1})),!g){e.next=22;break}return P("Extract from content..."),e.next=13,te("posts");case 13:for(n=e.sent,r=[],c=0;c<n;c+=R)r.push(c);return o=r.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/extract_references"),{json:{source:"content",limit:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=19,J.start(o);case 19:t+=J.getErrorCount(),J.reset(),W((function(e){return e+1}));case 22:if("files"!==b||!v){e.next=35;break}return P("Extract from library..."),e.next=26,te("medias");case 26:for(i=e.sent,s=[],u=0;u<i;u+=R)s.push(u);return m=s.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/extract_references"),{json:{source:"media",limit:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=32,J.start(m);case 32:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1}));case 35:if(f=[],"media"!==b){e.next=51;break}return P("Listing media..."),e.next=40,te("medias");case 40:for(d=e.sent,h=[],y=0;y<d;y+=w)h.push(y);return E=h.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/retrieve_medias"),{json:{limit:e},signal:n,nonce:p});case 5:return(r=t.sent).data&&(f=[].concat(Ke(f),Ke(r.data.results))),t.abrupt("return",r);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=46,J.start(E);case 46:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1})),e.next=62;break;case 51:if("files"!==b){e.next=61;break}return P("Listing files..."),k=function(){var e=Ze(regeneratorRuntime.mark((function e(t,n){var r,c,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.F)("".concat(l,"/retrieve_files"),{json:{path:t},signal:n,nonce:p});case 2:r=e.sent,c=r.data,o=Je(c.results);try{for(s=function(){var e=i.value;"dir"===e.type?J.addTask(Ze(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(e.path,n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))):f.push(e.path)},o.s();!(i=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=56,J.start([function(){var e=Ze(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k("",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()]);case 56:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1})),e.next=62;break;case 61:alert("This method is not known!");case 62:if(!f){e.next=69;break}return P("Matching with content..."),O=Object(a.D)(f,_),S=O.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/check_targets"),{json:{method:b,targets:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=68,J.start(S);case 68:t+=J.getErrorCount();case 69:Z(t),F(),P();case 72:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return React.createElement(a.q,{nekoErrors:[n]},React.createElement(a.i,{title:"Media Cleaner | 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-cleaner-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=wpmc_settings"}},"Settings"))),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(Ve,null),React.createElement(a.z,null,!c.length&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"play",disabled:r,onClick:function(){return le()}},"Scan"),!f&&React.createElement(a.u,{id:"wpmc_method",scrolldown:!0,disabled:r,name:"wpmc_method",style:{width:200},onChange:L,value:b},it.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),c.length>0&&React.createElement(a.c,{disabled:r,onClick:function(){return T([])}},"Unselect All"),f&&React.createElement("div",{style:(e={display:"flex",fontFamily:"Lato",padding:"0 10px",flexDirection:"column",fontWeight:600,width:200},Xe(e,"flexDirection","column"),Xe(e,"height",30),Xe(e,"lineHeight","16px"),Xe(e,"justifyContent","center"),Xe(e,"textTransform","uppercase"),e)},React.createElement("div",{style:{color:"#144675",fontSize:17}},"STEP ".concat(q,"/").concat(G)),React.createElement("div",{style:{color:"#007bba"}},f)),!r&&"issues"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return ae(!0,c)}},"Ignore ",React.createElement("strong",null,c.length)," entries"),React.createElement(a.c,{className:"danger",onClick:function(){return ne(c)}},"Delete ",React.createElement("strong",null,c.length)," entries")),!r&&"ignored"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return ae(!1,c)}},"Undo ",React.createElement("strong",null,c.length)," entries")),!r&&"trash"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"delete",className:"secondary",onClick:function(){return re(c)}},"Recover ",React.createElement("strong",null,c.length)," entries")),React.createElement("div",{style:{flex:1}},f&&React.createElement(a.s,{status:function(e){return"".concat(J.max?"".concat(e,"%"):"+=")},busy:J.busy,value:J.value,max:J.max,onStopClick:J.stop})),!r&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){A(e)},onEnter:function(e){A(e)},value:m,onReset:function(){A("")}}),!m&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"})),!r&&"issues"===u&&i.issues>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"delete",className:"danger",onClick:function(){return U("deleteAll")}},"Delete ",React.createElement("strong",null,"All"))),!r&&"trash"===u&&i.trash>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return U("recoverAll")}},"Recover ",React.createElement("strong",null,"All")),React.createElement(a.c,{icon:"delete",className:"danger",onClick:function(){return U("trashAll")}},"Empty Trash"))),React.createElement("p",null,"There are ",React.createElement("b",null,i.issues," issue",i.issues>1?"s":"")," with your files, accounting for ",React.createElement("b",null,(i.issues_size/1e6).toFixed(2)," MB"),". Your trash contains ",React.createElement("b",null,(i.trash_size/1e6).toFixed(2)," MB"),"."),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:u,busy:r,onChange:function(e){D(e),C(1)}},React.createElement(a.l,{title:"Issues",value:"issues",count:i.issues}),React.createElement(a.l,{title:"Ignored",value:"ignored",count:i.ignored}),React.createElement(a.l,{title:"Trash",value:"trash",count:i.trash})),React.createElement(a.r,{currentPage:h,limit:y,total:s,onClick:function(e){return C(e)}})),React.createElement(a.x,{busy:r,data:K,columns:Q,sort:d,onSortChange:function(e,t){j({accessor:e,by:t})},onSelect:function(e){T([].concat(Ke(c),Ke(e)))},onUnselect:function(e){T(Ke(c.filter((function(t){return!e.includes(t)}))))},selectedItems:c}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:y,onChange:function(e){I(e),C(1),ce(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:h,limit:y,total:s,onClick:function(e){return C(e)}}))),React.createElement(a.o,{isOpen:O.deleteAll,onRequestClose:function(){return U("deleteAll",!1)},title:"Delete All",content:React.createElement("span",null,"If you continue, ",React.createElement("b",null,s," issue",s<2?"":"s"," will be deleted"),". Make absolutely sure you have a backup of your site."),onOkClick:function(){U("deleteAll",!1),ne(null,!1,m)},onCancelClick:function(){U("deleteAll",!1)}}),React.createElement(a.o,{isOpen:O.trashAll,onRequestClose:function(){return U("trashAll",!1)},title:"Delete All",content:React.createElement("span",null,"If you continue, ",React.createElement("b",null,"the trash will be entirely emptied"),". Make absolutely sure you have a backup of your site."),onOkClick:function(){U("trashAll",!1),ne(null,!0)},onCancelClick:function(){U("trashAll",!1)}}),React.createElement(a.o,{isOpen:O.recoverAll,onRequestClose:function(){return U("recoverAll",!1)},title:"Recover All",content:"Are you sure you really want to recover all the files from the trash?",onOkClick:function(){U("recoverAll",!1),re()},onCancelClick:function(){U("recoverAll",!1)}}),React.createElement(a.o,{isOpen:J.error,onRequestClose:ie,title:"Error",content:J.error?J.error.message:"N/A",customButtons:React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){J.resume()}},"Skip"),React.createElement(a.c,{className:"primary",onClick:function(){J.setAlwaysSkip(),J.resume()}},"Always Skip"),React.createElement(a.c,{className:"danger",onClick:ie},"Stop"))}),React.createElement(a.o,{isOpen:$,title:"Finished",ok:"Close",content:$,onOkClick:function(){X(""),J.reset()}})))},mt=wp.element.render,pt={fetcher:a.E,revalidateOnFocus:!1};document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("wpmc-admin-settings");t&&mt(React.createElement(r.a,{value:pt},React.createElement(ve,null)),t),(t=document.getElementById("wpmc-dashboard"))&&mt(React.createElement(r.a,{value:pt},React.createElement(Ne,null,React.createElement(ut,null))),t)}))},2:function(e,t,n){"use strict";var r=n(15);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(39);var c=n(51);n.d(t,"q",(function(){return c.a}));var o=n(52);n.d(t,"a",(function(){return o.a}));var i=n(53);n.d(t,"g",(function(){return i.a}));var l=n(54);n.d(t,"v",(function(){return l.a}));n(55);var s=n(40);n.d(t,"B",(function(){return s.b})),n.d(t,"f",(function(){return s.a}));var u=n(56);n.d(t,"d",(function(){return u.a}));var m=n(57);n.d(t,"e",(function(){return m.a}));var p=n(23);n.d(t,"k",(function(){return p.a}));n(58);var f=n(41);n.d(t,"u",(function(){return f.b})),n.d(t,"p",(function(){return f.a}));n(59),n(60),n(9),n(42),n(24);var d=n(61);n.d(t,"s",(function(){return d.a}));var h=n(62);n.d(t,"i",(function(){return h.a}));var y=n(25);n.d(t,"r",(function(){return y.a}));var b=n(6);n.d(t,"j",(function(){return b.a}));var g=n(17);n.d(t,"A",(function(){return g.a}));var v=n(43);n.d(t,"t",(function(){return v.b})),n.d(t,"l",(function(){return v.a}));var E=n(63);n.d(t,"h",(function(){return E.a}));var R=n(44);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(64),n(26),n(20),n(16);var w=n(27);n.d(t,"o",(function(){return w.a}));n(69);var _=n(28);n.d(t,"x",(function(){return _.a}));var k=n(46);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(47);var x=n(70);n.d(t,"z",(function(){return x.a}));n(3);var O=n(8);n.d(t,"H",(function(){return O.c})),n.d(t,"G",(function(){return O.b}));var S=n(14);n.d(t,"F",(function(){return S.d})),n.d(t,"E",(function(){return S.c})),n.d(t,"D",(function(){return S.b})),n.d(t,"C",(function(){return S.a}));n(21)}});
2
  //# sourceMappingURL=index.js.map
1
+ !function(e){function t(t){for(var r,o,i=t[0],l=t[1],s=t[2],m=0,p=[];m<i.length;m++)o=i[m],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(u&&u(t);p.length;)p.shift()();return c.push.apply(c,s||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==a[l]&&(r=!1)}r&&(c.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={0:0},c=[];function o(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,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var i=window.wpJsonWpmc=window.wpJsonWpmc||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var s=0;s<i.length;s++)t(i[s]);var u=l;c.push([140,1]),n()}({0:function(e,t){e.exports=React},131:function(e,t){e.exports=ReactDOM},140:function(e,t,n){"use strict";n.r(t);var r=n(12),a=n(2),c=wpmc_media_cleaner.prefix,o=wpmc_media_cleaner.domain,i=wpmc_media_cleaner.rest_url.replace(/\/+$/,""),l=wpmc_media_cleaner.api_url.replace(/\/+$/,""),s=wpmc_media_cleaner.plugin_url.replace(/\/+$/,""),u="1"===wpmc_media_cleaner.is_pro,m=u&&"1"===wpmc_media_cleaner.is_registered,p=wpmc_media_cleaner.rest_nonce,f=n(4);function d(){var e=v(["\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"]);return d=function(){return e},e}function h(){var e=v(["\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"]);return h=function(){return e},e}function y(){var e=v(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]);return y=function(){return e},e}function b(){var e=v(["\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"]);return b=function(){return e},e}function g(){var e=v(["\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"]);return g=function(){return e},e}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var E=f.a.div(g()),R=Object(f.a)(a.a)(b()),w=f.a.img(y()),_=f.a.div(h()),k=f.a.ul(d());function x(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||A(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 O(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function S(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){O(c,r,a,o,i,"next",e)}function i(e){O(c,r,a,o,i,"throw",e)}o(void 0)}))}}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||A(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 A(e,t){if(e){if("string"==typeof e)return P(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)?P(e,t):void 0}}function P(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 j=wp.element,C=j.useState,D=j.useEffect,I="".concat(i,"/meow-common/v1"),M=function(e){var t=e.request,n=e.title,r=e.max,c=T(C(!1),2),o=c[0],i=c[1],l=T(C([]),2),s=l[0],u=l[1],m=s.length>0?s.reduce((function(e,t){return e+t})):0,f=s.length>0?Math.ceil(m/s.length):0,d=!s.length&&o;D((function(){o&&setTimeout(S(regeneratorRuntime.mark((function e(){var n,r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,Object(a.F)("".concat(I,"/").concat(t),{nonce:p});case 3:r=(new Date).getTime(),c=r-n,u((function(e){return[].concat(x(e),[c])}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[s]);return React.createElement(E,{style:{width:200,textAlign:"center"}},React.createElement(a.A,{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":s.length+" requests")),React.createElement(a.c,{style:{width:"100%",marginTop:10},color:o?"#cc3627":"#ccb027",onClick:function(){o||u([]),i(!o)}},o?"Stop":"Start"))};function B(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){U(c,r,a,o,i,"next",e)}function i(e){U(c,r,a,o,i,"throw",e)}o(void 0)}))}}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return q(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 q(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 q(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 W=wp.element,H=W.useState,G=W.useEffect;l&&i&&s||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var Y="".concat(i,"/meow-common/v1"),V=React.createElement(E,null,React.createElement(a.A,{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"),".")),$=React.createElement(E,null,React.createElement(a.A,{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.A,{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"),".")),X=React.createElement(E,null,React.createElement(a.A,{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.A,{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.A,{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"))))),J=["".concat(Y,"/all_settings/"),{headers:{"X-WP-Nonce":p}}],K=function(){var e=z(H(!1),2),t=e[0],n=e[1],c=Object(r.b)(J,a.E),o=c.data,i=c.mutate,l=c.error,u=null==o?void 0:o.data,m=null==u?void 0:u.meowapps_hide_meowapps,f=null==u?void 0:u.force_sslverify,d=z(H(!1),2),h=d[0],y=d[1],b=z(H([]),2),g=b[0],v=b[1],x=z(H(""),2),O=x[0],S=x[1];G((function(){l&&!t&&(n(!0),console.error("Error from UseSWR",l.message))}),[l]),G((function(){var e=document.getElementById("meow-common-phpinfo");S(e.innerHTML)}),[]);var T=function(){var e=L(regeneratorRuntime.mark((function e(t,n){var r,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=N({},o.data))[n]=t,i(N(N({},o),{},{data:r}),!1),y(!0),e.next=6,Object(a.F)("".concat(Y,"/update_option"),{json:{name:n,value:t},nonce:p});case 6:c=e.sent,y(!1),c.success||alert(c.message),i();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),A=function(){var e=L(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.F)("".concat(Y,"/error_logs"),{nonce:p});case 3:t=e.sent,n=t&&t.data?t.data:[],v(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=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.A,{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:h,checked:m,onChange:T}))),j=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.A,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:h,checked:f,onChange:T})));return React.createElement(a.q,{showRestError:t},React.createElement(a.i,{title:"The Dashboard"}),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(a.y,null,React.createElement(a.w,{title:"Meow Apps"},V,React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(R,{title:"Media Cleaner",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/media-cleaner.png")}),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(R,{title:"Database Cleaner",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(R,{title:"Media File Renamer",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/media-file-renamer.png")}),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(R,{title:"Social Engine",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(R,{title:"Meow Analytics",className:"primary"},React.createElement(w,{src:"".concat(s,"/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(R,{title:"Photo Engine",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/wplr-sync.png")}),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(R,{title:"Meow Gallery",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/meow-gallery.png")}),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(R,{title:"Meow Lightbox",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/meow-lightbox.png")}),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(R,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(w,{src:"".concat(s,"/common/img/wp-retina-2x.png")}),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(R,{title:"Contact Form Block",className:"primary"},React.createElement(w,{src:"".concat(s,"/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(a.w,{title:"Performance"},$,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(M,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(M,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(M,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.w,{title:"Recommendations"},X),React.createElement(a.w,{title:"PHP Info"},React.createElement(_,{dangerouslySetInnerHTML:{__html:O}})),React.createElement(a.w,{title:"PHP Error Logs"},React.createElement(E,null,React.createElement(a.c,{style:{marginBottom:10},color:"#ccb027",onClick:A},"Load PHP Error Logs"),React.createElement(k,null,g.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"},P,j))))))};function Q(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Z(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Q(c,r,a,o,i,"next",e)}function i(e){Q(c,r,a,o,i,"throw",e)}o(void 0)}))}}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(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}var ne=wp.element,re=ne.useState,ae=ne.useEffect,ce="".concat(i,"/meow-licenser/").concat(c,"/v1"),oe=function(){var e=ee(re(!1),2),t=e[0],n=e[1],r=ee(re(!1),2),c=r[0],o=r[1],i=ee(re(null),2),l=i[0],s=i[1],f=ee(re(null),2),d=f[0],h=f[1],y=ee(re(""),2),b=y[0],g=y[1],v=m&&(!d||"valid"!==d.license),E=function(){var e=Z(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,Object(a.F)("".concat(ce,"/get_license"),{nonce:p});case 5:t=e.sent,h(t.data),t.data.key&&g(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=Z(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.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:null}});case 3:e.sent.success&&(g(""),h(null),s("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=Z(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.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:b,override:!0}});case 3:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=Z(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==b){e.next=5;break}return o(!0),h(null),g(""),e.abrupt("return");case 5:return n(!0),e.next=8,Object(a.F)("".concat(ce,"/set_license"),{nonce:p,json:{serialKey:b}});case 8:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&s("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ae((function(){E()}),[]);var k=v?"Forced License":m?"Enabled":"Disabled",x=v||d&&"valid"===d.license,O="Your license is active. Thanks a lot for your support :)";v&&d&&d.check_url&&(O=React.createElement(React.Fragment,null,React.createElement("span",null,O),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:d.check_url+"&cache="+642e3*Math.random()},"here"),"."))),x||(d?"no_activations_left"===d.issue?O=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://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===d.issue?O=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://meowapps.com"},"Meow Apps Store"),"."):"missing"===d.issue?O="This license does not exist.":"disabled"===d.issue?O="This license has been disabled.":"item_name_mismatch"===d.issue?O="This license seems to be for a different plugin... isn't it? :)":"forced"===d.issue?O="ABC":(O=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:d})):O="Unknown error :(");var S=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://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://meowapps.com/"},"Meow Apps Store"),"."),T=React.createElement(a.a,{title:"Pro Version (".concat(k,")"),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:b,onChange:function(e){return g(e)},placeholder:""})),d&&!x&&React.createElement(a.m,null,O),d&&x&&React.createElement(a.n,null,O),!d&&React.createElement(a.A,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://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"},d&&!x&&React.createElement(a.c,{className:"secondary",disabled:t||!b,onClick:_},"Retry to validate"),d&&d.key===b&&React.createElement(a.c,{className:"secondary",disabled:t||!b,onClick:R},"Remove License"),React.createElement(a.c,{disabled:t||!b||d&&d.key===b,onClick:_},"Validate License"),c&&!x&&React.createElement(a.c,{disabled:t||!b||d&&d.key===b,onClick:w,className:"danger"},"Force License")),React.createElement(a.o,{isOpen:"licenseAdded"===l,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"===l,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return u?T:S},ie=wp.element.render;function le(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){ue(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function pe(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){me(c,r,a,o,i,"next",e)}function i(e){me(c,r,a,o,i,"throw",e)}o(void 0)}))}}function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return de(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 de(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 de(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&&ie(React.createElement(K,null),t)})));var he=wp.element,ye=he.useState,be=he.useMemo,ge={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)"},ve=function(){var e=be((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),t=Object(r.b)(e,a.E),n=t.data,i=t.mutate,s=Object(a.G)(n,{},!0),f=s.busy,d=s.data,h=s.error,y=fe(ye(!1),2),b=y[0],g=y[1],v=fe(ye(""),2),E=v[0],R=v[1],w=fe(ye(),2),_=w[0],k=w[1],x=f||b,O=null==d?void 0:d.wpmc_content,S=null==d?void 0:d.wpmc_filesystem_content,T=null==d?void 0:d.wpmc_media_library,A=null==d?void 0:d.wpmc_live_content,P=null==d?void 0:d.wpmc_debuglogs,j=null==d?void 0:d.wpmc_images_only,C=null==d?void 0:d.wpmc_attach_is_use,D=null==d?void 0:d.wpmc_thumbnails_only,I=null==d?void 0:d.wpmc_dirs_filter,M=null==d?void 0:d.wpmc_files_filter,B=null==d?void 0:d.wpmc_hide_thumbnails,N=null==d?void 0:d.wpmc_hide_warning,F=null==d?void 0:d.wpmc_medias_buffer,U=null==d?void 0:d.wpmc_posts_buffer,L=null==d?void 0:d.wpmc_analysis_buffer,z=null==d?void 0:d.wpmc_file_op_buffer,q=null==d?void 0:d.wpmc_delay,W=null==d?void 0:d.wpmc_shortcodes_disabled,H=null==d?void 0:d.wpmc_clean_uninstall,G=function(){var e=pe(regeneratorRuntime.mark((function e(t,r){var c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(c=se({},n.data))[r]=t,i(se(se({},n),{},{data:c}),!1),g(!0),e.prev=4,e.next=7,Object(a.F)("".concat(l,"/update_option"),{json:{name:r,value:t},nonce:p});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,g(!1),i(),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)}}(),Y=function(){var e=pe(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/reset_db"),{nonce:p});case 3:k("resetDb"),g(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=pe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/refresh_logs"),{nonce:p});case 3:(t=e.sent).success&&R(t.data),g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=pe(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,Object(a.F)("".concat(l,"/clear_logs"),{nonce:p});case 3:(t=e.sent).success&&R(t.data),g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=React.createElement(a.v,{title:"Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_content",label:"Check",description:"Checks if the media entries are used by the content (Posts, Pages and other Post Types, Metadata, Widgets, etc). Pagebuilders are only supported in the Pro Version.",value:"1",checked:O,onChange:G}))),J=React.createElement(a.v,{title:"Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_filesystem_content",label:"Check",description:"Checks if the files are used by the content (Posts, Pages and other Post Types, Metadata, Widgets, etc).",value:"1",checked:S,onChange:G}))),K=React.createElement(a.v,{title:"Media Library"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_media_library",label:"Check",description:"Checks if the files are properly registered in the Media Library.",value:"1",checked:T,onChange:G}))),Q=React.createElement(a.v,{title:"Live Content"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_live_content",label:"Check",description:"The live version of the site will be also analyzed (as if a visitor was loading it). It increases the accuracy of the results but slows down the speed dramatically.",value:"1",requirePro:!m,checked:A,onChange:G}))),Z=React.createElement(a.v,{title:"Images Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_images_only",label:"Enable",description:"Restricts the scan to images. Nothing else will be scanned.",value:"1",checked:j,onChange:G}))),ee=React.createElement(a.v,{title:"Attached Images"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_attach_is_use",label:"Consider as In Use",description:React.createElement(React.Fragment,null,"If a media entry is attached (in the Media Library, it is the ",React.createElement("b",null,"Uploaded To")," field), it will be considered as being used."),value:"1",checked:C,onChange:G}))),te=React.createElement(a.v,{title:"Thumbnails Only"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_thumbnails_only",label:"Enable",description:"Restricts Media Cleaner to scan thumbnails. With WordPress, those filenames contain the resolution.",value:"1",checked:D,onChange:G}))),ne=React.createElement(a.v,{title:"Directories Filter"},React.createElement(a.k,{id:"wpmc_dirs_filter",name:"wpmc_dirs_filter",value:I,placeholder:"/regex/",onEnter:G,onBlur:G})),re=React.createElement(a.v,{title:"Files Filter"},React.createElement(a.k,{id:"wpmc_files_filter",name:"wpmc_files_filter",value:M,placeholder:"/regex/",onEnter:G,onBlur:G})),ae=React.createElement(a.v,{title:"Thumbnails"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_hide_thumbnails",label:"Hide",description:"If you prefer not to see the thumbnails.",value:"1",checked:B,onChange:G}))),ce=React.createElement(a.v,{title:"Warning Message"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_hide_warning",label:"Hide",description:"Have you read it twice? If yes, hide it :)",requirePro:!m,value:"1",checked:N,onChange:G}))),ie=React.createElement(a.v,{title:"Plugin Data"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_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:H,onChange:G}))),le=React.createElement(a.v,{title:"Medias Buffer"},React.createElement(a.k,{id:"wpmc_medias_buffer",type:"number",value:F,min:"1",max:"1000",onEnter:G,onBlur:G,description:"The number of media entries to read at a time. This is fast, so the value should be between 50 and 1000."})),ue=React.createElement(a.v,{title:"Posts Buffer"},React.createElement(a.k,{id:"wpmc_posts_buffer",type:"number",value:U,min:"1",max:"100",onEnter:G,onBlur:G,description:"The number of posts (and any other post types) to analyze at a time. This is the most intense part of the process. Recommended value is between 1 (slow server) and 20 (excellent server)."})),me=React.createElement(a.v,{title:"Analysis Buffer"},React.createElement(a.k,{id:"wpmc_analysis_buffer",type:"number",value:L,min:"1",max:"1000",onEnter:G,onBlur:G,description:"The number of media entries or files to analyze at a time. This is the main part of the process, but is is much faster than analyzing each post. Recommended value is between 20 (slow server) and 1000 (excellent server)."})),de=React.createElement(a.v,{title:"File Operation Buffer"},React.createElement(a.k,{id:"wpmc_file_op_buffer",type:"number",value:z,min:"1",max:"100",onEnter:G,onBlur:G,description:"The number of media entries or files to delete at a time. This highly depends on your server, it is normally quite fast. Recommended value is between 5 (slow server) and 100 (excellent server). "})),he=React.createElement(a.v,{title:"Delay (in ms)"},React.createElement(a.k,{id:"wpmc_delay",type:"number",value:q,min:"0",max:"20000",onEnter:G,onBlur:G,description:"Time to wait between each request (in milliseconds). The overall process is intensive so this gives the chance to your server to chill out a bit. A very good server doesn't need it, but a slow/shared hosting might even reject requests if they are too fast and frequent. Recommended value is actually 0, 100 for safety, 2000 or 5000 if your hosting is kind of cheap."})),ve=React.createElement(a.v,{title:"Shortcodes"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_shortcodes_disabled",label:"Disable Analysis",description:"Resolving shortcodes increase accuracy, but makes the process slower and takes more memory.",value:"1",checked:W,onChange:G}))),Ee=React.createElement(a.v,{title:"Logs"},React.createElement(a.e,{max:"1"},React.createElement(a.d,{id:"wpmc_debuglogs",label:"Enable",description:React.createElement(a.A,{p:!0},"Simple logging that explains which actions has been run."),value:"1",checked:P,onChange:G}),React.createElement("div",{style:{marginTop:20}},React.createElement(a.c,{onClick:V},"Refresh Logs"),React.createElement(a.c,{className:"danger",onClick:$},"Clear Logs"))));return React.createElement(a.q,{nekoErrors:[h]},React.createElement(a.o,{isOpen:"resetDb"===_,onRequestClose:function(){k(null)},title:"Done!",content:"The Media Cleaner's database has been deleted. It will be re-created automatically next time you visit the Media Cleaner Dashboard.",onOkClick:function(){k(null)}}),React.createElement(a.i,{title:"Media Cleaner | 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-cleaner-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{className:"header",icon:"dashboard",onClick:function(){return location.href="upload.php?page=wpmc_dashboard"}},"Dashboard"))),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(a.g,{footer:React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return location.href="upload.php?page=wpmc_dashboard"}},"Access Media Cleaner Dashboard"),React.createElement(a.c,{className:"danger",onClick:Y},"Delete Cleaner DB"))},React.createElement(a.A,{p:!0},"There are two kinds of scan. Usually, the ",React.createElement("b",null,"Media Library")," should be scanned first for images which are not used (Content = Check). Then, the ",React.createElement("b",null,"Filesystem")," should be scanned for images which aren't registered in the Media Library (Media Library = Check). Check the ",React.createElement("a",{target:"_blank",href:"https://meowapps.com/media-cleaner-tutorial/"},"tutorial")," tutorial for more information. If you wish to clean your ",React.createElement("b",null,"Database"),", try ",React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner"),", you will love it! 💕")),React.createElement(a.y,{keepTabOnReload:!0},React.createElement(a.w,{title:"Media Library Scan"},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Scanning",className:"primary"},X,Q,(O||A)&&React.createElement(a.A,{p:!0},"If you would like Media Cleaner to analyze your Media Library for broken entries, uncheck everything above."),!O&&!A&&React.createElement(a.A,{p:!0},React.createElement("b",null,"Since Content and Live Content are not checked, Media Cleaner will analyze your Media Library for ",React.createElement("u",null,"broken entries"),".")))),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Filters",className:"primary"},Z),React.createElement(a.a,{busy:x,title:"Extra Rules",className:"primary"},ee)))),React.createElement(a.w,{title:"Filesystem Scan",requirePro:!m},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Scanning",className:"primary"},K,J,Q,React.createElement(a.A,{p:!0},"If none of the checks above are selected, you will get the list of all your files."))),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Filters",className:"primary"},te,ne,re)))),React.createElement(a.w,{title:"Advanced"},React.createElement(a.B,null,React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"UI & Logs",className:"primary"},ae,ce),React.createElement(a.a,{busy:x,title:"On Uninstall",className:"primary"},ie)),React.createElement(a.f,{minimal:!0},React.createElement(a.a,{busy:x,title:"Advanced Settings",className:"primary"},le,ue,me,de,he,ve)))),React.createElement(a.w,{title:"License"},React.createElement(oe,{domain:o,prefix:c,isPro:u,isRegistered:m})),React.createElement(a.w,{title:"Logs & Debug"},React.createElement(a.a,{busy:x,className:"primary"},Ee),React.createElement("div",{style:ge},E))))))},Ee=n(0);function Re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return we(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 we(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 we(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 _e(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 ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){xe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xe(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,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Se(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Oe(c,r,a,o,i,"next",e)}function i(e){Oe(c,r,a,o,i,"throw",e)}o(void 0)}))}}var Te,Ae,Pe,je={issues:"-",ignored:"-",trash:"-"},Ce={accessor:"size",by:"desc"},De=0,Ie={filterBy:"issues",sort:Ce,page:1,limit:10,search:"",busy:!1,stats:je,apiErrors:null,status:"",entries:[],selectedItems:[],total:0,method:"media",content:!0,mediaLibrary:!1,hideThumbnails:!1,postsBuffer:5,mediasBuffer:100,analysisBuffer:100,fileOpBuffer:20,delay:100,modals:{deleteAll:!1,trashAll:!1,recoverAll:!1},mutateEntries:(Pe=Se(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 Pe.apply(this,arguments)}),mutateStats:(Ae=Se(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 Ae.apply(this,arguments)}),mutateSettings:(Te=Se(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 Te.apply(this,arguments)})},Me=function(e,t){switch(t.type){case"ENTRIES_UPDATED":var n=t.entries;return ke(ke({},e),{},{entries:n});case"STATS_UPDATED":var r=t.stats;return ke(ke({},e),{},{stats:r});case"ERROR_UPDATED":var a=t.apiErrors;return ke(ke({},e),{},{apiErrors:a});case"PAGE_UPDATED":var c=t.page;return ke(ke({},e),{},{page:c});case"SET_ENTRIES_MUTATE":var o=t.mutateEntries;return ke(ke({},e),{},{mutateEntries:o});case"SET_STATS_MUTATE":var i=t.mutateStats;return ke(ke({},e),{},{mutateStats:i});case"SET_SETTINGS_MUTATE":var l=t.mutateSettings;return ke(ke({},e),{},{mutateSettings:l});case"LIMIT_UPDATED":var s=t.limit;return ke(ke({},e),{},{limit:s});case"FILTER_UPDATED":var u=t.filter;return ke(ke({},e),{},{filterBy:u});case"SORT_UPDATED":var m=t.sort,p=void 0===m?Ce:m;return ke(ke({},e),{},{sort:p});case"SEARCH_UPDATED":var f=t.search;return ke(ke({},e),{},{search:f});case"TOTAL_UPDATED":var d=t.total;return ke(ke({},e),{},{total:d});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 b=ke({},e);return b.modals=ke({},b.modals),b.modals[h]=y,b;case"PUSH_BUSY":var g=t.status,v=void 0===g?"":g;return ke(ke({},e),{},{busy:++De>0,status:v});case"POP_BUSY":var E=t.status,R=void 0===E?"":E;return ke(ke({},e),{},{busy:--De>0,status:R});case"STATUS_UPDATED":var w=t.status,_=void 0===w?"":w;return ke(ke({},e),{},{status:_});case"SETTINGS_UPDATED":var k=t.settings,x=k.wpmc_method,O="files"===k.wpmc_method?k.wpmc_filesystem_content:k.wpmc_content,S="files"===k.wpmc_method&&(null==k?void 0:k.wpmc_media_library),T=k.wpmc_hide_thumbnails,A=k.wpmc_posts_buffer?parseInt(k.wpmc_posts_buffer):5,P=k.wpmc_medias_buffer?parseInt(k.wpmc_medias_buffer):100,j=k.wpmc_analysis_buffer?parseInt(k.wpmc_analysis_buffer):100,C=k.wpmc_file_op_buffer?parseInt(k.wpmc_file_op_buffer):20,D=k.wpmc_delay?parseInt(k.wpmc_delay):0,I=k.wpmc_posts_per_page?parseInt(k.wpmc_posts_per_page):10;return ke(ke({},e),{},{method:x,content:O,mediaLibrary:S,hideThumbnails:T,postsBuffer:A,mediasBuffer:P,analysisBuffer:j,fileOpBuffer:C,delay:D,limit:I});case"ITEMS_SELECTED":var M=t.selectedItems;return ke(ke({},e),{},{selectedItems:M});default:return e}},Be=Object(Ee.createContext)(),Ne=function(e){var t=e.children,n=Re(Object(Ee.useReducer)(Me,Ie),2),c=n[0],o=n[1],i=c.filterBy,s=c.sort,u=c.search,m=c.page,f=c.limit,d=Object(Ee.useMemo)((function(){return[Object(a.C)("".concat(l,"/entries"),{limit:f,skip:(m-1)*f,filterBy:i,orderBy:s.accessor,order:s.by,search:u}),{headers:{"X-WP-Nonce":p}}]}),[i,s,u,m,f,l,p,a.C]),h=Object(Ee.useMemo)((function(){return[Object(a.C)("".concat(l,"/stats"),{search:u}),{headers:{"X-WP-Nonce":p}}]}),[u,l,p,a.C]),y=Object(Ee.useMemo)((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),b=Object(r.b)(d,a.E),g=b.data,v=b.mutate,E=Object(a.G)(g,[],!0),R=E.busy,w=E.data,_=E.total,k=E.error;Object(Ee.useEffect)((function(){o({type:"SET_ENTRIES_MUTATE",mutateEntries:v})}),[v]),Object(Ee.useEffect)((function(){o({type:R?"PUSH_BUSY":"POP_BUSY"})}),[R]),Object(Ee.useEffect)((function(){o({type:"ENTRIES_UPDATED",entries:w})}),[w]),Object(Ee.useEffect)((function(){o({type:"TOTAL_UPDATED",total:_})}),[_]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:k})}),[k]);var x=Object(r.b)(h,a.E),O=x.data,S=x.mutate,T=Object(a.G)(O,je,!0),A=T.busy,P=T.data,j=T.error;Object(Ee.useEffect)((function(){o({type:"SET_STATS_MUTATE",mutateStats:S})}),[S]),Object(Ee.useEffect)((function(){o({type:A?"PUSH_BUSY":"POP_BUSY"})}),[A]),Object(Ee.useEffect)((function(){o({type:"STATS_UPDATED",stats:P})}),[P]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:j})}),[j]);var C=Object(r.b)(y,a.E),D=C.data,I=C.mutate,M=Object(a.G)(D,{},!0),B=M.busy,N=M.data,F=M.error;return Object(Ee.useEffect)((function(){o({type:"SET_SETTINGS_MUTATE",mutateSettings:I})}),[I]),Object(Ee.useEffect)((function(){o({type:B?"PUSH_BUSY":"POP_BUSY"})}),[B]),Object(Ee.useEffect)((function(){o({type:"SETTINGS_UPDATED",settings:N})}),[N]),Object(Ee.useEffect)((function(){o({type:"ERROR_UPDATED",apiError:F})}),[F]),React.createElement(Be.Provider,{value:[c,o]},t)},Fe=function(){var e={},t=Re(Object(Ee.useContext)(Be),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=Se(regeneratorRuntime.mark((function e(t,c){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.F)("".concat(l,"/update_option"),{json:{name:c,value:t},nonce:p});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.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"})},ke(ke({},n),e)};function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Le(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 Le(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 Le(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 ze=wp.element,qe=ze.useState,We=ze.useMemo,He={borderLeft:"4px solid #007bba"},Ge={borderLeft:"4px solid #f1ad31"},Ye={borderLeft:"4px solid #d85960"},Ve=function(){var e=We((function(){return["".concat(l,"/all_settings/"),{headers:{"X-WP-Nonce":p}}]}),[l,p]),t=Ue(qe(!1),2),n=(t[0],t[1],Object(r.b)(e,a.E).data),c=Object(a.G)(n,{wpmc_hide_warning:!0},!0).data,o=c.wpmc_method,i="files"===c.wpmc_method?c.wpmc_filesystem_content:c.wpmc_content,s="files"===c.wpmc_method&&(null==c?void 0:c.wpmc_media_library),u=c.wpmc_hide_warning,f=c.incompatible_plugins,d=React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/media-cleaner/","_blank")}},"Get the Pro Version"),React.createElement(a.c,{className:"primary",onClick:function(){return window.open("https://meowapps.com/media-cleaner-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(React.Fragment,null,"media"===o&&!i&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your Media Library for broken entries.")),"media"===o&&i&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your Media Library for entries which aren't used in your content.")),"files"===o&&i&&s&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your physical directories for files which are not registered in the Media Library or not used directly in your content.")),"files"===o&&!i&&s&&React.createElement(a.g,{style:He},React.createElement(a.A,{p:!0,style:{fontSize:15}},"Media Cleaner will scan your physical directories for files which are not registered in the Media Library.")),!u&&React.createElement(a.g,{style:Ge},React.createElement(a.A,{p:!0},React.createElement("p",null,React.createElement("b",null,React.createElement("span",{style:{color:"red"}},"This is important.")," Backup your DB and your /uploads directory before using Media Cleaner.")," The deleted files will be temporarily moved to the ",React.createElement("i",null,"uploads/wpmc-trash")," directory. After testing your site, you can check the ",React.createElement("i",null,"Trash")," in order to empty it or to recover your files. That said, you still must have a backup! If you don't know how, give a try to this: ",React.createElement("a",{href:"http://meow.click/blogvault",target:"_blank"},"BlogVault"),"."),React.createElement("p",null,React.createElement("b",null,React.createElement("span",{style:{color:"red"}},"Please be considerate.")," Don't blame Media Cleaner if it deleted too many (or not enough) of your files.")," WordPress being a very dynamic and pluggable system, it is impossible to predict all the situations in which your files are used. Please do not post a bad review because it broke your install; if you have a proper backup, there is no risk! You can disable this big warning in the options if you have the Pro Version. Read this warning twice. Media Cleaner is awesome and constantly gets better so I sincerely hope you will enjoy it. Thank you :)"))),!m&&React.createElement(a.g,{footer:d},React.createElement(a.A,{p:!0},"You must ",React.createElement("b",null,"backup the uploads folder and DB")," before using the Cleaner. 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!")),f&&f.length>0&&React.createElement(a.g,{style:Ye},React.createElement(a.A,{p:!0,style:{fontSize:15}},React.createElement("p",null,"Important note about the following plugin(s) which you are using:"),React.createElement("ul",null,f.map((function(e){return React.createElement("li",null,"- ",e)}))),React.createElement("p",null,"They require additional checks which are only implemented in ",React.createElement("a",{target:"_blank",href:"//meowapps.com/plugin/media-cleaner"},"Media Cleaner Pro"),"."))))},$e=function(e){return new Promise((function(t){return setTimeout(t,e)}))};function Xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=tt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,o=!0,i=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,c=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw c}}}}function Ke(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||tt(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 Qe(e,t,n,r,a,c,o){try{var i=e[c](o),l=i.value}catch(e){return void n(e)}i.done?t(l):Promise.resolve(l).then(r,a)}function Ze(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function o(e){Qe(c,r,a,o,i,"next",e)}function i(e){Qe(c,r,a,o,i,"throw",e)}o(void 0)}))}}function et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}(e,t)||tt(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 tt(e,t){if(e){if("string"==typeof e)return nt(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)?nt(e,t):void 0}}function nt(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 rt=wp.element,at=rt.useState,ct=rt.useEffect,ot=rt.useMemo,it=[{id:"media",value:"media",label:"Media Library",requirePro:!1},{id:"files",value:"files",label:"Filesystem",requirePro:!m}],lt={width:40,height:40,objectFit:"cover"},st={NO_CONTENT:"Not found in content",ORPHAN_MEDIA:"Not attached file",ORPHAN_FILE:"Not in library",ORPHAN_RETINA:"Orphan @2x",ORPHAN_WEBP:"Orphan WebP"},ut=function(){var e,t=Fe(),n=t.apiErrors,r=t.busy,c=t.selectedItems,o=t.entries,i=t.stats,s=t.total,u=t.filterBy,m=t.search,f=t.status,d=t.sort,h=t.page,y=t.limit,b=t.method,g=t.content,v=t.mediaLibrary,E=t.hideThumbnails,R=t.postsBuffer,w=t.mediasBuffer,_=t.analysisBuffer,k=t.fileOpBuffer,x=t.delay,O=t.modals,S=Fe(),T=S.setSelectedItems,A=S.setSearch,P=S.setStatus,j=S.setSort,C=S.setPage,D=S.setLimit,I=S.setFilter,M=S.mutateEntries,B=S.mutateStats,N=S.pushBusy,F=S.popBusy,U=S.toggleModal,L=S.updateOption,z=et(at(1),2),q=z[0],W=z[1],H=et(at(1),2),G=H[0],Y=H[1],V=et(at(""),2),$=V[0],X=V[1],J=Object(a.H)(),K=ot((function(){return o.map((function(e){var t="trash"===u?e.image_url:"/wp-admin/post.php?post=".concat(e.postId,"&action=edit");return console.log({x:e}),{id:e.id,thumbnail_url:React.createElement(React.Fragment,null,"ORPHAN_MEDIA"!==e.issue&&React.createElement("a",{href:e.image_url,title:"Open Image",target:"_blank"},React.createElement("img",{src:e.thumbnail_url,style:lt}))),type:React.createElement("span",null,0==e.type&&"Filesystem",1==e.type&&React.createElement("a",{href:t,target:"_blank"},"ID ",e.postId)),path:React.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.title&&React.createElement("a",{href:t,target:"_blank"},React.createElement("span",null,e.title)),React.createElement("span",null,e.path)),issue:React.createElement("span",null,st[e.issue]?st[e.issue]:e.issue),size:React.createElement("span",null,(e.size/1e3).toFixed(2)," KB")}}))}),[o]),Q=[{accessor:"type",title:"Origin",sortable:!0},{accessor:"path",title:"Title & Path",sortable:!0},{accessor:"issue",title:"Issue",sortable:!0},{accessor:"size",title:"Size",sortable:!0}];E||Q.unshift({accessor:"thumbnail_url",title:"",style:{width:16}}),ct((function(){T([]),j(),C(1)}),[u]);var Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(e=null!==e?e:J.getErrorCount())>0&&X("The process has finished, but ".concat(e," error(s) occurred.")),J.reset(),T([]),M(),B()},ee=function(){var e=Ze(regeneratorRuntime.mark((function e(t){var n,r,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:null,e.next=3,Object(a.F)("".concat(l,"/all_ids"),{json:{source:t,search:n},nonce:p});case 3:if((r=e.sent).success){e.next=7;break}return alert(r.message),e.abrupt("return",[]);case 7:return e.abrupt("return",r.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(){var e=Ze(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(x>0)){e.next=3;break}return e.next=3,$e(x);case 3:return e.next=5,Object(a.F)("".concat(l,"/count"),{json:{source:t},nonce:p});case 5:return n=e.sent,e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ne=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:null,n=s.length>1&&void 0!==s[1]&&s[1],r=s.length>2&&void 0!==s[2]?s[2]:null,P("Getting IDs..."),N(),!t){e.next=9;break}e.t0=t,e.next=12;break;case 9:return e.next=11,ee(n?"trash":"issues",r);case 11:e.t0=e.sent;case 12:if(!(c=e.t0)){e.next=20;break}return P(n?"Emptying...":"Deleting..."),o=Object(a.D)(c,k),i=o.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/delete"),{json:{entryIds:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=19,J.start(i);case 19:Z();case 20:F(),P();case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,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,P("Getting IDs..."),N(),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,ee("trash");case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=17;break}return r=Object(a.D)(n,k),c=r.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(P("Recovering..."),!(x>0)){t.next=4;break}return t.next=4,$e(x);case 4:return t.next=6,Object(a.F)("".concat(l,"/recover"),{json:{entryIds:e},signal:n,nonce:p});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=16,J.start(c);case 16:Z();case 17:F(),P();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(i.length>0&&void 0!==i[0])||i[0],n=i.length>1&&void 0!==i[1]?i[1]:null,P("Getting IDs..."),N(),!n){e.next=8;break}e.t0=n,e.next=11;break;case 8:return e.next=10,ee("issues");case 10:e.t0=e.sent;case 11:if(!(r=e.t0)){e.next=19;break}return P("".concat(t?"Ignoring...":"Undoing...")),c=Object(a.D)(r,_),o=c.map((function(e){return function(){var n=Ze(regeneratorRuntime.mark((function n(r){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(x>0)){n.next=3;break}return n.next=3,$e(x);case 3:return n.next=5,Object(a.F)("".concat(l,"/set_ignore"),{json:{entryIds:e,ignore:t},signal:r,nonce:p});case 5:return n.abrupt("return",n.sent);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()})),e.next=18,J.start(o);case 18:Z();case 19:F(),P();case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(){var e=Ze(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:L(t,"wpmc_posts_per_page");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=Ze(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:J.stop();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){oe(),Z(),F(),P()},le=function(){var e=Ze(regeneratorRuntime.mark((function e(){var t,n,r,c,o,i,s,u,m,f,d,h,y,E,k,O,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=0,N(),T([]),W(1),Y(3+(g?1:0)+("files"===b&&v?1:0)),P("Resetting issues..."),e.next=8,Object(a.F)("".concat(l,"/reset_issues"),{nonce:p});case 8:if(W((function(e){return e+1})),!g){e.next=22;break}return P("Extract from content..."),e.next=13,te("posts");case 13:for(n=e.sent,r=[],c=0;c<n;c+=R)r.push(c);return o=r.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/extract_references"),{json:{source:"content",limit:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=19,J.start(o);case 19:t+=J.getErrorCount(),J.reset(),W((function(e){return e+1}));case 22:if("files"!==b||!v){e.next=35;break}return P("Extract from library..."),e.next=26,te("medias");case 26:for(i=e.sent,s=[],u=0;u<i;u+=R)s.push(u);return m=s.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/extract_references"),{json:{source:"media",limit:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=32,J.start(m);case 32:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1}));case 35:if(f=[],"media"!==b){e.next=51;break}return P("Listing media..."),e.next=40,te("medias");case 40:for(d=e.sent,h=[],y=0;y<d;y+=w)h.push(y);return E=h.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/retrieve_medias"),{json:{limit:e},signal:n,nonce:p});case 5:return(r=t.sent).data&&(f=[].concat(Ke(f),Ke(r.data.results))),t.abrupt("return",r);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=46,J.start(E);case 46:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1})),e.next=62;break;case 51:if("files"!==b){e.next=61;break}return P("Listing files..."),k=function(){var e=Ze(regeneratorRuntime.mark((function e(t,n){var r,c,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(a.F)("".concat(l,"/retrieve_files"),{json:{path:t},signal:n,nonce:p});case 2:r=e.sent,c=r.data,o=Je(c.results);try{for(s=function(){var e=i.value;"dir"===e.type?J.addTask(Ze(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(e.path,n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))):f.push(e.path)},o.s();!(i=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=56,J.start([function(){var e=Ze(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k("",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()]);case 56:J.reset(),t+=J.getErrorCount(),W((function(e){return e+1})),e.next=62;break;case 61:alert("This method is not known!");case 62:if(!f){e.next=69;break}return P("Matching with content..."),O=Object(a.D)(f,_),S=O.map((function(e){return function(){var t=Ze(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x>0)){t.next=3;break}return t.next=3,$e(x);case 3:return t.next=5,Object(a.F)("".concat(l,"/check_targets"),{json:{method:b,targets:e},signal:n,nonce:p});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=68,J.start(S);case 68:t+=J.getErrorCount();case 69:Z(t),F(),P();case 72:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return React.createElement(a.q,{nekoErrors:[n]},React.createElement(a.i,{title:"Media Cleaner | 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-cleaner-tutorial/","_blank")}},"Tutorial"),React.createElement(a.c,{icon:"cog",className:"header",onClick:function(){return location.href="admin.php?page=wpmc_settings"}},"Settings"))),React.createElement(a.B,null,React.createElement(a.f,{full:!0},React.createElement(Ve,null),React.createElement(a.z,null,!c.length&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"play",disabled:r,onClick:function(){return le()}},"Scan"),!f&&React.createElement(a.u,{id:"wpmc_method",scrolldown:!0,disabled:r,name:"wpmc_method",style:{width:200},onChange:L,value:b},it.map((function(e){return React.createElement(a.p,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),c.length>0&&React.createElement(a.c,{disabled:r,onClick:function(){return T([])}},"Unselect All"),f&&React.createElement("div",{style:(e={display:"flex",fontFamily:"Lato",padding:"0 10px",flexDirection:"column",fontWeight:600,width:200},Xe(e,"flexDirection","column"),Xe(e,"height",30),Xe(e,"lineHeight","16px"),Xe(e,"justifyContent","center"),Xe(e,"textTransform","uppercase"),e)},React.createElement("div",{style:{color:"#144675",fontSize:17}},"STEP ".concat(q,"/").concat(G)),React.createElement("div",{style:{color:"#007bba"}},f)),!r&&"issues"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return ae(!0,c)}},"Ignore ",React.createElement("strong",null,c.length)," entries"),React.createElement(a.c,{className:"danger",onClick:function(){return ne(c)}},"Delete ",React.createElement("strong",null,c.length)," entries")),!r&&"ignored"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"secondary",onClick:function(){return ae(!1,c)}},"Undo ",React.createElement("strong",null,c.length)," entries")),!r&&"trash"===u&&c.length>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"delete",className:"secondary",onClick:function(){return re(c)}},"Recover ",React.createElement("strong",null,c.length)," entries")),React.createElement("div",{style:{flex:1}},f&&React.createElement(a.s,{status:function(e){return"".concat(J.max?"".concat(e,"%"):"+=")},busy:J.busy,value:J.value,max:J.max,onStopClick:J.stop})),!r&&React.createElement(React.Fragment,null,React.createElement(a.k,{onBlur:function(e){A(e)},onEnter:function(e){A(e)},value:m,onReset:function(){A("")}}),!m&&React.createElement(a.j,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"})),!r&&"issues"===u&&i.issues>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{icon:"delete",className:"danger",onClick:function(){return U("deleteAll")}},"Delete ",React.createElement("strong",null,"All"))),!r&&"trash"===u&&i.trash>0&&React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){return U("recoverAll")}},"Recover ",React.createElement("strong",null,"All")),React.createElement(a.c,{icon:"delete",className:"danger",onClick:function(){return U("trashAll")}},"Empty Trash"))),React.createElement("p",null,"There are ",React.createElement("b",null,i.issues," issue",i.issues>1?"s":"")," with your files, accounting for ",React.createElement("b",null,(i.issues_size/1e6).toFixed(2)," MB"),". Your trash contains ",React.createElement("b",null,(i.trash_size/1e6).toFixed(2)," MB"),"."),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.t,{value:u,busy:r,onChange:function(e){I(e),C(1)}},React.createElement(a.l,{title:"Issues",value:"issues",count:i.issues}),React.createElement(a.l,{title:"Ignored",value:"ignored",count:i.ignored}),React.createElement(a.l,{title:"Trash",value:"trash",count:i.trash})),React.createElement(a.r,{currentPage:h,limit:y,total:s,onClick:function(e){return C(e)}})),React.createElement(a.x,{busy:r,data:K,columns:Q,sort:d,onSortChange:function(e,t){j({accessor:e,by:t})},onSelect:function(e){T([].concat(Ke(c),Ke(e)))},onUnselect:function(e){T(Ke(c.filter((function(t){return!e.includes(t)}))))},selectedItems:c}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.u,{scrolldown:!0,value:y,onChange:function(e){D(e),C(1),ce(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:h,limit:y,total:s,onClick:function(e){return C(e)}}))),React.createElement(a.o,{isOpen:O.deleteAll,onRequestClose:function(){return U("deleteAll",!1)},title:"Delete All",content:React.createElement("span",null,"If you continue, ",React.createElement("b",null,s," issue",s<2?"":"s"," will be deleted"),". Make absolutely sure you have a backup of your site."),onOkClick:function(){U("deleteAll",!1),ne(null,!1,m)},onCancelClick:function(){U("deleteAll",!1)}}),React.createElement(a.o,{isOpen:O.trashAll,onRequestClose:function(){return U("trashAll",!1)},title:"Delete All",content:React.createElement("span",null,"If you continue, ",React.createElement("b",null,"the trash will be entirely emptied"),". Make absolutely sure you have a backup of your site."),onOkClick:function(){U("trashAll",!1),ne(null,!0)},onCancelClick:function(){U("trashAll",!1)}}),React.createElement(a.o,{isOpen:O.recoverAll,onRequestClose:function(){return U("recoverAll",!1)},title:"Recover All",content:"Are you sure you really want to recover all the files from the trash?",onOkClick:function(){U("recoverAll",!1),re()},onCancelClick:function(){U("recoverAll",!1)}}),React.createElement(a.o,{isOpen:J.error,onRequestClose:ie,title:"Error",content:J.error?J.error.message:"N/A",customButtons:React.createElement(React.Fragment,null,React.createElement(a.c,{className:"primary",onClick:function(){J.resume()}},"Skip"),React.createElement(a.c,{className:"primary",onClick:function(){J.setAlwaysSkip(),J.resume()}},"Always Skip"),React.createElement(a.c,{className:"danger",onClick:ie},"Stop"))}),React.createElement(a.o,{isOpen:$,title:"Finished",ok:"Close",content:$,onOkClick:function(){X(""),J.reset()}})))},mt=wp.element.render,pt={fetcher:a.E,revalidateOnFocus:!1};document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("wpmc-admin-settings");t&&mt(React.createElement(r.a,{value:pt},React.createElement(ve,null)),t),(t=document.getElementById("wpmc-dashboard"))&&mt(React.createElement(r.a,{value:pt},React.createElement(Ne,null,React.createElement(ut,null))),t)}))},2:function(e,t,n){"use strict";var r=n(15);n.d(t,"b",(function(){return r.a}));var a=n(11);n.d(t,"c",(function(){return a.a}));n(39);var c=n(51);n.d(t,"q",(function(){return c.a}));var o=n(52);n.d(t,"a",(function(){return o.a}));var i=n(53);n.d(t,"g",(function(){return i.a}));var l=n(54);n.d(t,"v",(function(){return l.a}));n(55);var s=n(40);n.d(t,"B",(function(){return s.b})),n.d(t,"f",(function(){return s.a}));var u=n(56);n.d(t,"d",(function(){return u.a}));var m=n(57);n.d(t,"e",(function(){return m.a}));var p=n(23);n.d(t,"k",(function(){return p.a}));n(58);var f=n(41);n.d(t,"u",(function(){return f.b})),n.d(t,"p",(function(){return f.a}));n(59),n(60),n(9),n(42),n(24);var d=n(61);n.d(t,"s",(function(){return d.a}));var h=n(62);n.d(t,"i",(function(){return h.a}));var y=n(25);n.d(t,"r",(function(){return y.a}));var b=n(6);n.d(t,"j",(function(){return b.a}));var g=n(17);n.d(t,"A",(function(){return g.a}));var v=n(43);n.d(t,"t",(function(){return v.b})),n.d(t,"l",(function(){return v.a}));var E=n(63);n.d(t,"h",(function(){return E.a}));var R=n(44);n.d(t,"m",(function(){return R.a})),n.d(t,"n",(function(){return R.b}));n(64),n(26),n(20),n(16);var w=n(27);n.d(t,"o",(function(){return w.a}));n(69);var _=n(28);n.d(t,"x",(function(){return _.a}));var k=n(46);n.d(t,"y",(function(){return k.b})),n.d(t,"w",(function(){return k.a}));n(47);var x=n(70);n.d(t,"z",(function(){return x.a}));n(3);var O=n(8);n.d(t,"H",(function(){return O.c})),n.d(t,"G",(function(){return O.b}));var S=n(14);n.d(t,"F",(function(){return S.d})),n.d(t,"E",(function(){return S.c})),n.d(t,"D",(function(){return S.b})),n.d(t,"C",(function(){return S.a}));n(21)}});
2
  //# sourceMappingURL=index.js.map
classes/rest.php CHANGED
@@ -463,10 +463,26 @@ class Meow_WPMC_Rest
463
  $attachment_src_large = wp_get_attachment_image_src( $entry->postId, 'large' );
464
  $thumbnail = empty( $attachment_src ) ? null : $attachment_src[0];
465
  $image = empty( $attachment_src_large ) ? null : $attachment_src_large[0];
 
466
  if ( $filterBy == 'trash' && !empty( $thumbnail ) ) {
467
  $new_url = $this->core->clean_url( $thumbnail );
468
  $thumbnail = htmlspecialchars( trailingslashit( $base ) . $new_url, ENT_QUOTES );
469
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  $entry->thumbnail_url = $thumbnail;
471
  $entry->image_url = $image;
472
  $entry->title = get_the_title( $entry->postId );
463
  $attachment_src_large = wp_get_attachment_image_src( $entry->postId, 'large' );
464
  $thumbnail = empty( $attachment_src ) ? null : $attachment_src[0];
465
  $image = empty( $attachment_src_large ) ? null : $attachment_src_large[0];
466
+ // This was working when the Post Type" was attachment"
467
  if ( $filterBy == 'trash' && !empty( $thumbnail ) ) {
468
  $new_url = $this->core->clean_url( $thumbnail );
469
  $thumbnail = htmlspecialchars( trailingslashit( $base ) . $new_url, ENT_QUOTES );
470
  }
471
+ if ( $filterBy == 'trash' && empty( $thumbnail ) ) {
472
+ $file = get_post_meta( $entry->postId, '_wp_attached_file', true );
473
+ $featured_image = wp_get_attachment_metadata( $entry->postId );
474
+ $thumbnail = "";
475
+ $image = htmlspecialchars( trailingslashit( $base ) . $file, ENT_QUOTES );
476
+ if ( isset( $featured_image['sizes']['thumbnail']['file'] ) ) {
477
+ $path = pathinfo( $file );
478
+ $thumbnail = $featured_image['sizes']['thumbnail']['file'];
479
+ $thumbnail = htmlspecialchars( trailingslashit( $base ) .
480
+ trailingslashit( $path['dirname'] ) . $thumbnail, ENT_QUOTES );
481
+ }
482
+ else {
483
+ $thumbnail = $image;
484
+ }
485
+ }
486
  $entry->thumbnail_url = $thumbnail;
487
  $entry->image_url = $image;
488
  $entry->title = get_the_title( $entry->postId );
common/ratings.php CHANGED
@@ -62,30 +62,35 @@ if ( !class_exists( 'MeowCommon_Ratings' ) ) {
62
  $html .= '<p style="font-size: 100%;">';
63
  $html .= sprintf(
64
  // translators: %1$s is a plugin nicename, %2$s is a short url (slug)
65
- __( 'You have been using <b>%1$s</b> for some time now. Thank you! Could you kindly share your opinion with me, along with, maybe, features you would like to see implemented? Then, please <a style="font-weight: bold; color: #b926ff;" target="_blank" href="https://wordpress.org/support/plugin/%2$s/reviews/?rate=5#new-post">write a little review</a>. That will also bring me joy and motivation! I will get back to you :)', $this->domain ),
66
- $this->nice_name_from_file( $this->mainfile ),
67
- $this->nice_short_url_from_file( $this->mainfile )
68
  );
69
- $html .= '<p>
70
- <form method="post" action="" style="float: right;">
71
- <input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
72
- <input type="submit" name="submit" id="submit" class="button button-red" value="'
73
- . __( 'Never remind me!', $this->domain ) . '">
 
 
 
 
74
  </form>
75
- <form method="post" action="" style="float: right; margin-right: 10px;">
 
76
  <input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
77
  <input type="submit" name="submit" id="submit" class="button button-primary" value="'
78
- . __( 'Remind me in a few weeks...', $this->domain ) . '">
79
  </form>
80
- <form method="post" action="" style="float: right; margin-right: 10px;">
81
- <input type="hidden" name="' . $this->prefix . '_did_it" value="true">
82
- <input type="submit" name="submit" id="submit" class="button button-primary" value="'
83
- . __( 'Yes, I did it!', $this->domain ) . '">
84
  </form>
85
  <div style="clear: both;"></div>
86
- </p>';
87
  $html .= '</div>';
88
  wp_kses_post( $html );
 
89
  }
90
 
91
  function nice_short_url_from_file( $file ) {
62
  $html .= '<p style="font-size: 100%;">';
63
  $html .= sprintf(
64
  // translators: %1$s is a plugin nicename, %2$s is a short url (slug)
65
+ __( '<h2 class="title">You have been using <b>%1$s</b> for some time now! Thank you 💕</h2>Could you take one minute and write a <b>little review</b> for me? That would <b>really</b> bring me joy and motivation 🥰<br />In the review, don\'t hesitate to share your feature requests and remarks. I will try my best!
66
+ ', $this->domain ), $this->nice_name_from_file( $this->mainfile )
 
67
  );
68
+ $html .= '<div style="padding: 20px 0 12px 0; display: flex; align-items: center;">
69
+ <a target="_blank" class="button button-primary" style="float: left; margin-right: 10px;"
70
+ href="https://wordpress.org/support/plugin/' . $this->nice_short_url_from_file( $this->mainfile ) . '/reviews/?rate=5#new-post">
71
+ ✍🏼 Yes, let\'s write it now!
72
+ </a>
73
+ <form method="post" action="" style="margin-right: 10px;">
74
+ <input type="hidden" name="' . $this->prefix . '_did_it" value="true">
75
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="'
76
+ . __( '🥰 I did it', $this->domain ) . '">
77
  </form>
78
+ <div style="flex: auto;"></div>
79
+ <form method="post" action="" style="margin-right: 10px;">
80
  <input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
81
  <input type="submit" name="submit" id="submit" class="button button-primary" value="'
82
+ . __( 'Remind me later', $this->domain ) . '">
83
  </form>
84
+ <form method="post" action="">
85
+ <input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
86
+ <input type="submit" name="submit" id="submit" class="button-link" style="font-size: small;" value="'
87
+ . __( 'Hide this', $this->domain ) . '">
88
  </form>
89
  <div style="clear: both;"></div>
90
+ </div>';
91
  $html .= '</div>';
92
  wp_kses_post( $html );
93
+ echo $html;
94
  }
95
 
96
  function nice_short_url_from_file( $file ) {
media-cleaner.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Media Cleaner
4
  Plugin URI: https://meowapps.com
5
  Description: Clean your WordPress from unused or broken media entries and files.
6
- Version: 6.3.7
7
  Author: Jordy Meow
8
  Author URI: https://jordymeow.com
9
  Text Domain: media-cleaner
@@ -14,7 +14,7 @@ Originally developed for two of my websites:
14
  */
15
 
16
  if ( !defined( 'WPMC_VERSION' ) ) {
17
- define( 'WPMC_VERSION', '6.3.7' );
18
  define( 'WPMC_PREFIX', 'wpmc' );
19
  define( 'WPMC_DOMAIN', 'media-cleaner' );
20
  define( 'WPMC_ENTRY', __FILE__ );
3
  Plugin Name: Media Cleaner
4
  Plugin URI: https://meowapps.com
5
  Description: Clean your WordPress from unused or broken media entries and files.
6
+ Version: 6.3.8
7
  Author: Jordy Meow
8
  Author URI: https://jordymeow.com
9
  Text Domain: media-cleaner
14
  */
15
 
16
  if ( !defined( 'WPMC_VERSION' ) ) {
17
+ define( 'WPMC_VERSION', '6.3.8' );
18
  define( 'WPMC_PREFIX', 'wpmc' );
19
  define( 'WPMC_DOMAIN', 'media-cleaner' );
20
  define( 'WPMC_ENTRY', __FILE__ );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://meowapps.com/donation/
5
  Requires at least: 5.0
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
- Stable tag: 6.3.7
9
 
10
  Clean your WordPress from unused files, broken media entries. Powerful engine and beautiful UI!
11
 
@@ -79,6 +79,10 @@ To make everything perfect, you will also need to clean and optimize your databa
79
 
80
  == Changelog ==
81
 
 
 
 
 
82
  = 6.3.7 (2022/06/07) =
83
  * Fix: Better support for filters for filesystem scan (and a little optimization as well).
84
  * Fix: Better support for backgrounds/overlays in elementor.
@@ -90,7 +94,6 @@ To make everything perfect, you will also need to clean and optimize your databa
90
  = 6.3.5 (2022/05/05) =
91
  * Fix: There were a few warnings related to undeclared arrays.
92
  * Add: Support for Metabox.
93
- * Info: New plugin the the family! 🎉 It is simply called Database Cleaner, and it aims to be... the best Database Cleaner! You can find it [here](https://wordpress.org/plugins/database-cleaner).
94
 
95
  = 6.3.4 (2022/04/29) =
96
  * Fix: Issue with Elementor.
5
  Requires at least: 5.0
6
  Tested up to: 6.0
7
  Requires PHP: 7.0
8
+ Stable tag: 6.3.8
9
 
10
  Clean your WordPress from unused files, broken media entries. Powerful engine and beautiful UI!
11
 
79
 
80
  == Changelog ==
81
 
82
+ = 6.3.8 (2022/06/13) =
83
+ * Fix: The links and thumbnails were broken in the Dashboard Trash.
84
+ * Info: New plugin the the family! 🎉 It is simply called Database Cleaner, and it aims to be... the best Database Cleaner! You can find it [here](https://wordpress.org/plugins/database-cleaner).
85
+
86
  = 6.3.7 (2022/06/07) =
87
  * Fix: Better support for filters for filesystem scan (and a little optimization as well).
88
  * Fix: Better support for backgrounds/overlays in elementor.
94
  = 6.3.5 (2022/05/05) =
95
  * Fix: There were a few warnings related to undeclared arrays.
96
  * Add: Support for Metabox.
 
97
 
98
  = 6.3.4 (2022/04/29) =
99
  * Fix: Issue with Elementor.