Simple 301 Redirects - Version 2.0.6

Version Description

  • 19/10/2021 =
  • Added: CSV Import/Export option
  • Few minor bug fix and improvements
Download this release

Release Info

Developer re_enter_rupok
Plugin Icon 128x128 Simple 301 Redirects
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

assets/css/simple-301-redirects.css CHANGED
File without changes
assets/images/close.svg CHANGED
File without changes
assets/images/icon-arrow.svg CHANGED
File without changes
assets/images/icon-copy.svg CHANGED
File without changes
assets/images/icon-delete.svg CHANGED
File without changes
assets/images/icon-doc.svg CHANGED
File without changes
assets/images/icon-lock.svg CHANGED
File without changes
assets/images/logo.svg CHANGED
File without changes
assets/images/pointing-down.svg CHANGED
File without changes
assets/js/simple-301-redirects.core.min.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'react-dom', 'wp-i18n', 'wp-polyfill'), 'version' => 'ff51b68248fb472c9b3347f3e02ec0fc');
1
+ <?php return array('dependencies' => array('react', 'react-dom', 'wp-i18n', 'wp-polyfill'), 'version' => 'd587d386c8c9a1032e7d0ce98fb63c9d');
assets/js/simple-301-redirects.core.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t,r){e.exports=r(16)},function(e,t,r){e.exports=r(14)()},function(e,t,r){"use strict";var n=r(5),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:l,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:s,isStream:function(e){return c(e)&&s(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,a){e[a]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(4);function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(a(t)+"="+a(e))})))})),i=o.join("&")}if(i){var c=e.indexOf("#");-1!==c&&(e=e.slice(0,c)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(4),a=r(22),i={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=r(9)),c),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(i)})),e.exports=l}).call(this,r(21))},function(e,t,r){"use strict";var n=r(4),a=r(23),i=r(25),o=r(6),c=r(26),l=r(29),s=r(30),u=r(10);e.exports=function(e){return new Promise((function(t,r){var d=e.data,p=e.headers;n.isFormData(d)&&delete p["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(f+":"+h)}var y=c(e.baseURL,e.url);if(m.open(e.method.toUpperCase(),o(y,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,m.onreadystatechange=function(){if(m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in m?l(m.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m};a(t,r,i),m=null}},m.onabort=function(){m&&(r(u("Request aborted",e,"ECONNABORTED",m)),m=null)},m.onerror=function(){r(u("Network Error",e,null,m)),m=null},m.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,"ECONNABORTED",m)),m=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||s(y))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}if("setRequestHeader"in m&&n.forEach(p,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete p[t]:m.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),e.responseType)try{m.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){m&&(m.abort(),r(e),m=null)})),d||(d=null),m.send(d)}))}},function(e,t,r){"use strict";var n=r(24);e.exports=function(e,t,r,a,i){var o=new Error(e);return n(o,t,r,a,i)}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t){t=t||{};var r={},a=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],c=["validateStatus"];function l(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function s(a){n.isUndefined(t[a])?n.isUndefined(e[a])||(r[a]=l(void 0,e[a])):r[a]=l(e[a],t[a])}n.forEach(a,(function(e){n.isUndefined(t[e])||(r[e]=l(void 0,t[e]))})),n.forEach(i,s),n.forEach(o,(function(a){n.isUndefined(t[a])?n.isUndefined(e[a])||(r[a]=l(void 0,e[a])):r[a]=l(void 0,t[a])})),n.forEach(c,(function(n){n in t?r[n]=l(e[n],t[n]):n in e&&(r[n]=l(void 0,e[n]))}));var u=a.concat(i).concat(o).concat(c),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return n.forEach(d,s),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t){e.exports=window.ReactDOM},function(e,t,r){"use strict";var n=r(15);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=r(4),a=r(5),i=r(17),o=r(11);function c(e){var t=new i(e),r=a(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var l=c(r(8));l.Axios=i,l.create=function(e){return c(o(l.defaults,e))},l.Cancel=r(12),l.CancelToken=r(31),l.isCancel=r(7),l.all=function(e){return Promise.all(e)},l.spread=r(32),l.isAxiosError=r(33),e.exports=l,e.exports.default=l},function(e,t,r){"use strict";var n=r(4),a=r(6),i=r(18),o=r(19),c=r(11);function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=c(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[o,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},l.prototype.getUri=function(e){return e=c(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(c(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(c(n||{},{method:e,url:t,data:r}))}})),e.exports=l},function(e,t,r){"use strict";var n=r(4);function a(){this.handlers=[]}a.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},function(e,t,r){"use strict";var n=r(4),a=r(20),i=r(7),o=r(8);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=a(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var l,s=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?s=l.concat(s):d=-1,s.length&&m())}function m(){if(!u){var e=c(p);u=!0;for(var t=s.length;t;){for(l=s,s=[];++d<t;)l&&l[d].run();d=-1,t=s.length}l=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new f(e,t)),1!==s.length||u||c(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=h,a.addListener=h,a.once=h,a.off=h,a.removeListener=h,a.removeAllListeners=h,a.emit=h,a.prependListener=h,a.prependOnceListener=h,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t,r){var a=r.config.validateStatus;r.status&&a&&!a(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,a){return e.config=t,r&&(e.code=r),e.request=n,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(4);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,a,i,o){var c=[];c.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&c.push("expires="+new Date(r).toGMTString()),n.isString(a)&&c.push("path="+a),n.isString(i)&&c.push("domain="+i),!0===o&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(27),a=r(28);e.exports=function(e,t){return e&&!n(t)?a(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(4),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,o={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(o[t]&&a.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(4);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function a(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=a(window.location.href),function(t){var r=n.isString(t)?a(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(12);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";r.r(t);var n=r(0),a=r.n(n),i=r(13),o=r.n(i),c=r(3),l=r.n(c),s=r(1),u=r(2),d=r.n(u),p=window.Simple301Redirects,m=p.s3r_nonce,f=p.plugin_root_url,h=(p.plugin_root_path,p.site_url),y=(p.route_path,p.is_betterlinks_activated),b=p.hide_btl_notice,_=function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},v=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/activate_plugin"),t.append("security",m),t.append("basename",e),d.a.post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))};function g(e){return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__topbar"},a.a.createElement("div",{className:"simple301redirects__topbar__logo"},a.a.createElement("img",{width:"40",src:f+"assets/images/logo.svg",alt:"logo"})),a.a.createElement("h3",{className:"simple301redirects__topbar__title"},Object(s.__)("Simple 301 Redirects","simple-301-redirects"))))}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e){var t=E(Object(n.useState)(""),2),r=t[0],i=t[1],o=E(Object(n.useState)(!1),2),c=o[0],l=o[1],u=E(Object(n.useState)(!1),2),p=u[0],f=u[1];return Object(n.useEffect)((function(){var e=new FormData;return e.append("action","simple301redirects/admin/get_wildcard"),e.append("security",m),d.a.post(ajaxurl,e).then((function(e){l("true"==e.data.data),f(!0)}),(function(e){console.log(e)}))}),[]),a.a.createElement(a.a.Fragment,null,p&&a.a.createElement("div",{className:"simple301redirects__wildcards"},a.a.createElement("input",{type:"checkbox",name:"wildcard",id:"wildcard",defaultChecked:c,onChange:function(){return function(e){i("Saving..."),l(e);var t=new FormData;return t.append("action","simple301redirects/admin/wildcard"),t.append("security",m),t.append("toggle",e),d.a.post(ajaxurl,t).then((function(e){e.data.success&&setTimeout((function(){i("Saved!"),setTimeout((function(){i("")}),3e3)}),1e3)}),(function(e){console.log(e)}))}(!c)}}),a.a.createElement("label",{htmlFor:"wildcard"},Object(s.__)("Use Wildcards?","simple-301-redirects")," ",r)))}function O(e,t,r,n,a,i,o){try{var c=e[i](o),l=c.value}catch(e){return void r(e)}c.done?t(l):Promise.resolve(l).then(n,a)}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}g.propTypes={},g.defaultProps={},j.propTypes={},j.defaultProps={};var x={label:l.a.string};function k(e){var t,r,i=e.label,o=(t=Object(n.useState)(i),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}(t,r)||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.")}()),c=o[0],l=o[1],s=function(){var e,t=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l("Installing..."),("betterlinks",t=void 0,t=new FormData,t.append("action","simple301redirects/admin/install_plugin"),t.append("security",m),t.append("slug","betterlinks"),d.a.post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))).then((function(e){l(e.data)})).then((function(){l(c+" Activating..."),v("betterlinks/betterlinks.php").then((function(e){l(e.data),setTimeout((function(){window.location.reload()}),1e3)}))}));case 2:case"end":return e.stop()}var t}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){O(i,n,a,o,c,"next",e)}function c(e){O(i,n,a,o,c,"throw",e)}o(void 0)}))});return function(){return t.apply(this,arguments)}}();return a.a.createElement(a.a.Fragment,null,a.a.createElement("button",{onClick:s},c))}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}k.propTypes=x,k.defaultProps={label:""};var T=function(e){var t,r,i=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(t,r)||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.")}()),o=i[0],c=i[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement("button",{className:"simple301redirects__icon__button",onClick:function(){return t=h,"/"===(r=e.request)[0]&&(r=r.substring(1)),/^((http|https|ftp):\/\/)/.test(r)?_(r):_(t+r),c(!0),void window.setTimeout((function(){c(!1)}),3e3);var t,r}},o?a.a.createElement("span",{className:"dashicons dashicons-yes"}):a.a.createElement("img",{src:f+"assets/images/icon-copy.svg",alt:"copy"})))};function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var N=function(e){var t,r,i=e.localClickHandler,o=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(e,t):void 0}}(t,r)||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.")}()),c=o[0],l=o[1],s=Object(n.useRef)(null),u=Object(n.useRef)(null),d=Object(n.useRef)(null),p=Object(n.useRef)(null),m=Object(n.useRef)(null);return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"Simple301Redirects__loading-dock",ref:s},a.a.createElement("svg",{id:"Simple301Redirects__load-b",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:p},a.a.createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),a.a.createElement("svg",{id:"Simple301Redirects__load",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:d},a.a.createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),a.a.createElement("button",{className:"Simple301Redirects__loading__button__submit",ref:u,onClick:function(){return i("update"),void(c||(l(!0),u.current.classList.remove("Simple301Redirects__return"),u.current.blur(),s.current.classList.add("Simple301Redirects__loaded"),d.current.style.display="initial",p.current.style.display="initial",setTimeout((function(){d.current.style.opacity=1}),225),setTimeout((function(){p.current.style.opacity=1}),350),setTimeout((function(){s.current.classList.remove("Simple301Redirects__loaded"),d.current.style.display="none",p.current.style.display="none",d.current.style.opacity=0,p.current.style.opacity=0,u.current.classList.add("Simple301Redirects__popout"),u.current.innerHTML="",setTimeout((function(){m.current.style.display="block"}),150)}),1450),setTimeout((function(){u.current.classList.remove("Simple301Redirects__popout"),u.current.classList.add("Simple301Redirects__return"),u.current.innerHTML="Update",m.current.style.display="none",l(!1)}),2e3)))}},"Update"),a.a.createElement("svg",{id:"Simple301Redirects__check",style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",ref:m},a.a.createElement("path",{fill:"#FFFFFF",d:"M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z"}))))};function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(e,t):void 0}}(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 L(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var P={request:l.a.string,destination:l.a.string,isNewLink:l.a.bool,clickHandler:l.a.func};function I(e){var t=e.request,r=e.destination,i=e.isNewLink,o=e.clickHandler,c=C(Object(n.useState)(""),2),l=c[0],u=c[1],d=C(Object(n.useState)(""),2),p=d[0],m=d[1];Object(n.useEffect)((function(){u(t),m(r)}),[t,r]);var h=C(Object(n.useState)(!1),2),b=h[0],_=h[1],v=function(e){"update"==e?g(l,p,e):"delete"==e?!0===confirm("Delete This Redirect?")&&g(l,p,e):(g(l,p,e),u(""),m(""))},g=function(e,r,n){if(e&&r){var a=(l=r,(c=e)in(i={})?Object.defineProperty(i,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[c]=l,i);t&&(a.oldKey=t),o(n,a)}else _(!0);var i,c,l},E=function(e){"Enter"===e.key&&v(""==t||""==r?"new":"update")};return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__managelinks__item"},a.a.createElement("div",{className:"simple301redirects__managelinks__item__inner"},a.a.createElement("div",{className:"simple301redirects__managelinks__item__request"},a.a.createElement("input",{className:b&&""==l?"error":"",type:"text",name:"request",value:l,onChange:function(e){return u(e.target.value)},onKeyPress:E,required:!0})),a.a.createElement("div",{className:"simple301redirects__managelinks__item__icon"},a.a.createElement("img",{width:"25",src:f+"assets/images/icon-arrow.svg",alt:"doc"})),a.a.createElement("div",{className:"simple301redirects__managelinks__item__destination"},a.a.createElement("textarea",{className:b&&""==p?"error":"",value:p,onChange:function(e){return m(e.target.value)},onKeyPress:E,rows:"1",required:!0}))),a.a.createElement("div",{className:"simple301redirects__managelinks__item__control"},i?a.a.createElement("button",{className:"simple301redirects__button primary__button",onClick:function(){return v("new")}},Object(s.__)("Add New","simple-301-redirects")):a.a.createElement(a.a.Fragment,null,a.a.createElement(T,{request:l}),a.a.createElement(N,{localClickHandler:v}),!y&&a.a.createElement("div",{className:"simple301redirects__button lock__button s3r-tooltip"},a.a.createElement("img",{width:"15",src:f+"assets/images/icon-lock.svg",alt:"local"}),a.a.createElement("span",null,Object(s.__)("3/1 CLICKS","simple-301-redirects")),a.a.createElement("div",{className:"s3r-tooltiptext-wrapper"},a.a.createElement("div",{className:"s3r-tooltiptext"},Object(s.__)("To see Analytics data","simple-301-redirects")," ",a.a.createElement(k,{label:Object(s.__)("Install BetterLinks","simple-301-redirects")})))),a.a.createElement("button",{className:"simple301redirects__icon__button delete__button",onClick:function(){return v("delete")}},a.a.createElement("img",{src:f+"assets/images/icon-delete.svg",alt:"delete"}))))))}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(e,t):void 0}}(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 B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M(e){var t=q(Object(n.useState)({}),2),r=t[0],i=t[1];Object(n.useEffect)((function(){return d.a.get(ajaxurl,{params:{action:"simple301redirects/admin/fetch_all_links",security:m}}).then((function(e){e.data&&i(e.data.data)}),(function(e){console.log(e)}))}),[]);var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"new"==e?c(t):"update"==e?l(t):"delete"==e&&u(t)},c=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/create_new_link"),t.append("security",m),t.append("key",Object.keys(e)),t.append("value",Object.values(e)),d.a.post(ajaxurl,t).then((function(t){t.data&&i(F(F({},r),e))}),(function(e){console.log(e)}))},l=function(e){var t=q(Object.keys(e),1)[0],r=q(Object.values(e),2),n=r[0],a=r[1],o=new FormData;return o.append("action","simple301redirects/admin/update_link"),o.append("security",m),o.append("key",t),o.append("value",n),o.append("oldKey",a),d.a.post(ajaxurl,o).then((function(e){e.data&&setTimeout((function(){i(e.data.data)}),2e3)}),(function(e){console.log(e)}))},u=function(e){var t=q(Object.keys(e),1)[0],n=new FormData;return n.append("action","simple301redirects/admin/delete_link"),n.append("security",m),n.append("key",t),d.a.post(ajaxurl,n).then((function(e){e.data&&(delete r[t],i(F({},r)))}),(function(e){console.log(e)}))};return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__managelinks ".concat(y?"simple301redirects__managelinks--activated-btl":"")},a.a.createElement("div",{className:"simple301redirects__managelinks__info"},a.a.createElement("div",{className:"simple301redirects__managelinks__info__inner"},a.a.createElement("div",{className:"simple301redirects__managelinks__info__request"},a.a.createElement("h4",null,Object(s.__)("Request","simple-301-redirects")),a.a.createElement("p",null,"example: /old-page/")),a.a.createElement("div",{className:"simple301redirects__managelinks__info__destination"},a.a.createElement("h4",null,Object(s.__)("Destination","simple-301-redirects")),a.a.createElement("p",null,"example: ".concat(h,"/new-page/"))))),Object.entries(r).map((function(e,t){var r=q(e,2),n=r[0],i=r[1];return a.a.createElement(I,{request:n,destination:i,clickHandler:o,key:t})})),a.a.createElement(I,{isNewLink:!0,clickHandler:o}),a.a.createElement(j,null)))}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $(e){var t,r,i=(t=Object(n.useState)(b),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(e,t):void 0}}(t,r)||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.")}()),o=i[0],c=i[1];return a.a.createElement(a.a.Fragment,null,!y&&!o&&a.a.createElement("div",{className:"simple301redirects__betterlinks"},a.a.createElement("button",{onClick:function(){var e=new FormData;return e.append("action","simple301redirects/admin/hide_notice"),e.append("security",m),e.append("hide",!0),d.a.post(ajaxurl,e).then((function(e){c(!0)}),(function(e){console.log(e)}))},className:"simple301redirects__betterlinks__close__button"},a.a.createElement("img",{width:"20",src:f+"assets/images/close.svg",alt:"logo"})),a.a.createElement("div",{className:"simple301redirects__betterlinks__content"},a.a.createElement("h3",null,Object(s.__)("BetterLinks – Shorten, Track and Manage any URL","simple-301-redirects")),a.a.createElement("h4",null,Object(s.__)("Install BetterLinks to get the best out of Simple 301 Redirects and get access to more advanced features. Check out the features below","simple-301-redirects"),a.a.createElement("img",{width:"18",style:{transform:"translateY(6px) scale(1.5)",marginLeft:8},src:f+"assets/images/pointing-down.svg",alt:"logo"})),a.a.createElement("ul",null,a.a.createElement("li",null,Object(s.__)("Easy-to-use & Simple Link Shortener","simple-301-redirects")),a.a.createElement("li",null,Object(s.__)("Create attractive looking links instantly","simple-301-redirects")),a.a.createElement("li",null,Object(s.__)("Safe Redirection URLs","simple-301-redirects")),a.a.createElement("li",null,Object(s.__)("Analyze and Track your marketing campaigns from one place","simple-301-redirects")),a.a.createElement("li",null,Object(s.__)("Optimized queries to reduce load time & make faster","simple-301-redirects")),a.a.createElement("li",null,Object(s.__)("Individual Analytics for each links","simple-301-redirects"))),a.a.createElement("h4",null,Object(s.__)("You can migrate from Simple 301 Redirects to BetterLinks within one click.","simple-301-redirects"))),a.a.createElement("div",{className:"simple301redirects__betterlinks__control"},a.a.createElement(k,{label:Object(s.__)("Install BetterLinks","simple-301-redirects")}))))}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function W(e){var t,r,i=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(e,t):void 0}}(t,r)||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.")}()),o=i[0],c=i[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__documentation"},a.a.createElement("div",{className:"simple301redirects__documentation__panel-header",onClick:function(){return c(!o)}},a.a.createElement("h4",null,a.a.createElement("img",{width:"25",src:f+"assets/images/icon-doc.svg",alt:"doc"})," Documentation"),a.a.createElement("button",null,a.a.createElement("span",{className:"dashicons dashicons-arrow-".concat(o?"up":"down","-alt2")}))),a.a.createElement("div",{className:"simple301redirects__documentation__panel-body"},o&&a.a.createElement("div",{className:"documentation"},a.a.createElement("h4",null,Object(s.__)("Simple Redirects","simple-301-redirects")),a.a.createElement("p",null,Object(s.__)("Simple redirects work similar to the format that Apache uses: the request should be relative to your WordPress root. The destination can be either a full URL to any page on the web, or relative to your WordPress root.","simple-301-redirects")),a.a.createElement("h5",null,Object(s.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Request: ","simple-301-redirects")),Object(s.__)("/old-page/","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Destination: ","simple-301-redirects"))," ",Object(s.__)("/new-page/","simple-301-redirects"))),a.a.createElement("h4",null,Object(s.__)("Wildcards","simple-301-redirects")),a.a.createElement("p",null,Object(s.__)("Wildcards Redirect will redirect all files within a directory to the same filename in the redirected directory. To use wildcards, put an asterisk (*) after the folder name that you want to redirect.","simple-301-redirects")),a.a.createElement("h5",null,Object(s.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Request: ","simple-301-redirects")),Object(s.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Destination: ","simple-301-redirects"))," ",Object(s.__)("/new-folder/* ","simple-301-redirects"))),a.a.createElement("p",null,Object(s.__)("You can also use wildcards to redirect all the dynamic files of a certain directory to a same destination URL as well.","simple-301-redirects")),a.a.createElement("h5",null,Object(s.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Request: ","simple-301-redirects")),Object(s.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Destination: ","simple-301-redirects"))," ",Object(s.__)("/new-page/","simple-301-redirects"))),a.a.createElement("p",null,Object(s.__)("You can also use the asterisk in the destination to replace whatever it matched in the request if you like. Something like this:","simple-301-redirects")),a.a.createElement("h5",null,Object(s.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Request:","simple-301-redirects")),Object(s.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Destination:","simple-301-redirects"))," ",Object(s.__)("/some/other/folder/*","simple-301-redirects"))),a.a.createElement("p",null,"Or:"),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("/some/other/folder/*","simple-301-redirects"))," ",Object(s.__)("/old-folder/*/content/","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(s.__)("Destination:","simple-301-redirects"))," ",Object(s.__)("/some/other/folder/*","simple-301-redirects")))))))}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,t):void 0}}(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 V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function X(e){var t=K(Object(n.useState)(!1),2),r=(t[0],t[1],K(Object(n.useState)(!1),2)),i=r[0],o=r[1];return Object(n.useEffect)((function(){"true"==new URLSearchParams(window.location.search).get("isImport")&&d.a.post("".concat(ajaxurl,"?action=simple301redirects/admin/get_import_info&security=").concat(m)).then((function(e){o(e.data.data)}),(function(e){console.log(e)}))}),[]),a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__panel__divider"},a.a.createElement("div",{className:"simple301redirects__import"},a.a.createElement("div",{className:"simple301redirects__import__head"},a.a.createElement("h4",null,Object(s.__)("Import Redirect Rules","simple-301-redirects")),a.a.createElement("p",null,Object(s.__)("Import your 301 Redirect Links from your Device","simple-301-redirects"))),a.a.createElement("form",{action:"admin.php?page=301options&isImport=true",method:"POST",encType:"multipart/form-data"},a.a.createElement("div",{role:"group",className:"simple301redirects-button-group","aria-labelledby":"my-radio-group"},a.a.createElement("input",{type:"hidden",name:"import",value:!0}),a.a.createElement("input",{type:"hidden",name:"security",value:m}),a.a.createElement("input",{type:"file",id:"upload_file",name:"upload_file",size:"25"}),a.a.createElement("input",{type:"submit",name:"submit",id:"submit",className:"button button-primary",style:{marginTop:10},value:Object(s.__)("Import File","simple-301-redirects"),disabled:""})),i&&a.a.createElement("p",null,a.a.createElement("strong",null,i.replace(/"|"/g,""))))),a.a.createElement("div",{className:"simple301redirects__export"},a.a.createElement("div",{className:"simple301redirects__export__head"},a.a.createElement("h4",null,Object(s.__)("Export Redirect Rules","simple-301-redirects")),a.a.createElement("p",null,Object(s.__)("Export your 301 Redirect Links in .json format","simple-301-redirects"))),a.a.createElement("form",{action:"admin.php?page=301options",method:"POST"},a.a.createElement("input",{type:"hidden",name:"export",value:!0}),a.a.createElement("input",{type:"hidden",name:"security",value:m}),a.a.createElement("div",{className:"simple301redirects-button-group"},a.a.createElement("button",{type:"submit",className:"btl-export-download-button"},Object(s.__)("Export File","simple-301-redirects")))))))}function Y(e){return a.a.createElement(a.a.Fragment,null,a.a.createElement(g,null),a.a.createElement("div",{className:"Simple301Redirects__content__wrapper"},a.a.createElement("div",{className:"Simple301Redirects__main__content"},a.a.createElement(M,null),a.a.createElement($,null)),a.a.createElement("div",{className:"Simple301Redirects__archive__sidebar"},a.a.createElement(X,null),a.a.createElement(W,null))))}I.propTypes=P,I.defaultProps={request:"",destination:"",isNewLink:!1},M.propTypes={},M.defaultProps={},$.propTypes={},$.defaultProps={},W.propTypes={},W.defaultProps={},X.propTypes={},X.defaultProps={},Y.propTypes={},Y.defaultProps={},document.addEventListener("DOMContentLoaded",(function(){o.a.render(a.a.createElement(Y,null),document.getElementById("simple301redirectsbody"))}))}]);
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=36)}([function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t,r){e.exports=r(17)},function(e,t,r){e.exports=r(15)()},function(e,t,r){"use strict";var n=r(6),a=Object.prototype.toString;function i(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:c,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,a){e[a]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";(function(t){var n=r(4),a=r(23),i=r(8),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=r(9)),c),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||a&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(o)})),e.exports=l}).call(this,r(22))},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(4);function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(a(t)+"="+a(e))})))})),i=o.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,a){return e.config=t,r&&(e.code=r),e.request=n,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(4),a=r(24),i=r(25),o=r(7),s=r(26),c=r(29),l=r(30),u=r(10);e.exports=function(e){return new Promise((function(t,r){var d=e.data,p=e.headers,m=e.responseType;n.isFormData(d)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+y)}var b=s(e.baseURL,e.url);function v(){if(f){var n="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f};a(t,r,i),f=null}}if(f.open(e.method.toUpperCase(),o(b,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(r(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){r(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var g=(e.withCredentials||l(b))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;g&&(p[e.xsrfHeaderName]=g)}"setRequestHeader"in f&&n.forEach(p,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),m&&"json"!==m&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),r(e),f=null)})),d||(d=null),f.send(d)}))}},function(e,t,r){"use strict";var n=r(8);e.exports=function(e,t,r,a,i){var o=new Error(e);return n(o,t,r,a,i)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t){t=t||{};var r={},a=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function c(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function l(a){n.isUndefined(t[a])?n.isUndefined(e[a])||(r[a]=c(void 0,e[a])):r[a]=c(e[a],t[a])}n.forEach(a,(function(e){n.isUndefined(t[e])||(r[e]=c(void 0,t[e]))})),n.forEach(i,l),n.forEach(o,(function(a){n.isUndefined(t[a])?n.isUndefined(e[a])||(r[a]=c(void 0,e[a])):r[a]=c(void 0,t[a])})),n.forEach(s,(function(n){n in t?r[n]=c(e[n],t[n]):n in e&&(r[n]=c(void 0,e[n]))}));var u=a.concat(i).concat(o).concat(s),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return n.forEach(d,l),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t){e.exports=window.ReactDOM},function(e,t,r){"use strict";var n=r(16);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,i,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=r(4),a=r(6),i=r(18),o=r(12);function s(e){var t=new i(e),r=a(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var c=s(r(5));c.Axios=i,c.create=function(e){return s(o(c.defaults,e))},c.Cancel=r(13),c.CancelToken=r(33),c.isCancel=r(11),c.all=function(e){return Promise.all(e)},c.spread=r(34),c.isAxiosError=r(35),e.exports=c,e.exports.default=c},function(e,t,r){"use strict";var n=r(4),a=r(7),i=r(19),o=r(20),s=r(12),c=r(31),l=c.validators;function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean,"1.0.0"),forcedJSONParsing:l.transitional(l.boolean,"1.0.0"),clarifyTimeoutError:l.transitional(l.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var a,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var u=[o,void 0];for(Array.prototype.unshift.apply(u,r),u=u.concat(i),a=Promise.resolve(e);u.length;)a=a.then(u.shift(),u.shift());return a}for(var d=e;r.length;){var p=r.shift(),m=r.shift();try{d=p(d)}catch(e){m(e);break}}try{a=o(d)}catch(e){return Promise.reject(e)}for(;i.length;)a=a.then(i.shift(),i.shift());return a},u.prototype.getUri=function(e){return e=s(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=u},function(e,t,r){"use strict";var n=r(4);function a(){this.handlers=[]}a.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},function(e,t,r){"use strict";var n=r(4),a=r(21),i=r(11),o=r(5);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=a.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return s(e),t.data=a.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(s(e),t&&t.response&&(t.response.data=a.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(4),a=r(5);e.exports=function(e,t,r){var i=this||a;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},function(e,t){var r,n,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var c,l=[],u=!1,d=-1;function p(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&m())}function m(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||s(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=h,a.addListener=h,a.once=h,a.off=h,a.removeListener=h,a.removeAllListeners=h,a.emit=h,a.prependListener=h,a.prependOnceListener=h,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t,r){var a=r.config.validateStatus;r.status&&a&&!a(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(4);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,a,i,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(a)&&s.push("path="+a),n.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(27),a=r(28);e.exports=function(e,t){return e&&!n(t)?a(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(4),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,o={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(o[t]&&a.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(4);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function a(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=a(window.location.href),function(t){var r=n.isString(t)?a(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(32),a={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){a[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},o=n.version.split(".");function s(e,t){for(var r=t?t.split("."):o,n=e.split("."),a=0;a<3;a++){if(r[a]>n[a])return!0;if(r[a]<n[a])return!1}return!1}a.transitional=function(e,t,r){var a=t&&s(t);function o(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(o(n," has been removed in "+t));return a&&!i[n]&&(i[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={isOlderVersion:s,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],o=t[i];if(o){var s=e[i],c=void 0===s||o(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:a}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(13);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";r.r(t);var n=r(0),a=r.n(n),i=r(14),o=r.n(i),s=r(3),c=r.n(s),l=r(1),u=r(2),d=r.n(u),p=window.Simple301Redirects,m=p.s3r_nonce,f=p.plugin_root_url,h=(p.plugin_root_path,p.site_url),y=(p.route_path,p.is_betterlinks_activated),b=p.hide_btl_notice,v=function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},g=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/activate_plugin"),t.append("security",m),t.append("basename",e),d.a.post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))};function _(e){return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__topbar"},a.a.createElement("div",{className:"simple301redirects__topbar__logo"},a.a.createElement("img",{width:"40",src:f+"assets/images/logo.svg",alt:"logo"})),a.a.createElement("h3",{className:"simple301redirects__topbar__title"},Object(l.__)("Simple 301 Redirects","simple-301-redirects"))))}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e){var t=E(Object(n.useState)(""),2),r=t[0],i=t[1],o=E(Object(n.useState)(!1),2),s=o[0],c=o[1],u=E(Object(n.useState)(!1),2),p=u[0],f=u[1];return Object(n.useEffect)((function(){var e=new FormData;e.append("action","simple301redirects/admin/get_wildcard"),e.append("security",m),d.a.post(ajaxurl,e).then((function(e){c("true"==e.data.data),f(!0)}),(function(e){console.log(e)}))}),[]),a.a.createElement(a.a.Fragment,null,p&&a.a.createElement("div",{className:"simple301redirects__wildcards"},a.a.createElement("input",{type:"checkbox",name:"wildcard",id:"wildcard",defaultChecked:s,onChange:function(){return function(e){i("Saving..."),c(e);var t=new FormData;return t.append("action","simple301redirects/admin/wildcard"),t.append("security",m),t.append("toggle",e),d.a.post(ajaxurl,t).then((function(e){e.data.success&&setTimeout((function(){i("Saved!"),setTimeout((function(){i("")}),3e3)}),1e3)}),(function(e){console.log(e)}))}(!s)}}),a.a.createElement("label",{htmlFor:"wildcard"},Object(l.__)("Use Wildcards?","simple-301-redirects")," ",r)))}function O(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}_.propTypes={},_.defaultProps={},j.propTypes={},j.defaultProps={};var S={label:c.a.string};function k(e){var t,r,i=e.label,o=(t=Object(n.useState)(i),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}(t,r)||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.")}()),s=o[0],c=o[1],l=function(){var e,t=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c("Installing..."),("betterlinks",t=void 0,t=new FormData,t.append("action","simple301redirects/admin/install_plugin"),t.append("security",m),t.append("slug","betterlinks"),d.a.post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))).then((function(e){c(e.data)})).then((function(){c(s+" Activating..."),g("betterlinks/betterlinks.php").then((function(e){c(e.data),setTimeout((function(){window.location.reload()}),1e3)}))}));case 2:case"end":return e.stop()}var t}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){O(i,n,a,o,s,"next",e)}function s(e){O(i,n,a,o,s,"throw",e)}o(void 0)}))});return function(){return t.apply(this,arguments)}}();return a.a.createElement(a.a.Fragment,null,a.a.createElement("button",{onClick:l},s))}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}k.propTypes=S,k.defaultProps={label:""};var A=function(e){var t,r,i=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(t,r)||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.")}()),o=i[0],s=i[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement("button",{className:"simple301redirects__icon__button",onClick:function(){return t=h,"/"===(r=e.request)[0]&&(r=r.substring(1)),/^((http|https|ftp):\/\/)/.test(r)?v(r):v(t+r),s(!0),void window.setTimeout((function(){s(!1)}),3e3);var t,r}},o?a.a.createElement("span",{className:"dashicons dashicons-yes"}):a.a.createElement("img",{src:f+"assets/images/icon-copy.svg",alt:"copy"})))};function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var R=function(e){var t,r,i=e.localClickHandler,o=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(e,t):void 0}}(t,r)||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.")}()),s=o[0],c=o[1],l=Object(n.useRef)(null),u=Object(n.useRef)(null),d=Object(n.useRef)(null),p=Object(n.useRef)(null),m=Object(n.useRef)(null);return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"Simple301Redirects__loading-dock",ref:l},a.a.createElement("svg",{id:"Simple301Redirects__load-b",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:p},a.a.createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),a.a.createElement("svg",{id:"Simple301Redirects__load",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:d},a.a.createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),a.a.createElement("button",{className:"Simple301Redirects__loading__button__submit",ref:u,onClick:function(){return i("update"),void(s||(c(!0),u.current.classList.remove("Simple301Redirects__return"),u.current.blur(),l.current.classList.add("Simple301Redirects__loaded"),d.current.style.display="initial",p.current.style.display="initial",setTimeout((function(){d.current.style.opacity=1}),225),setTimeout((function(){p.current.style.opacity=1}),350),setTimeout((function(){l.current.classList.remove("Simple301Redirects__loaded"),d.current.style.display="none",p.current.style.display="none",d.current.style.opacity=0,p.current.style.opacity=0,u.current.classList.add("Simple301Redirects__popout"),u.current.innerHTML="",setTimeout((function(){m.current.style.display="block"}),150)}),1450),setTimeout((function(){u.current.classList.remove("Simple301Redirects__popout"),u.current.classList.add("Simple301Redirects__return"),u.current.innerHTML="Update",m.current.style.display="none",c(!1)}),2e3)))}},"Update"),a.a.createElement("svg",{id:"Simple301Redirects__check",style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",ref:m},a.a.createElement("path",{fill:"#FFFFFF",d:"M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z"}))))};function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(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 P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L={request:c.a.string,destination:c.a.string,isNewLink:c.a.bool,clickHandler:c.a.func};function I(e){var t=e.request,r=e.destination,i=e.isNewLink,o=e.clickHandler,s=C(Object(n.useState)(""),2),c=s[0],u=s[1],d=C(Object(n.useState)(""),2),p=d[0],m=d[1];Object(n.useEffect)((function(){u(t),m(r)}),[t,r]);var h=C(Object(n.useState)(!1),2),b=h[0],v=h[1],g=function(e){"update"==e?_(c,p,e):"delete"==e?!0===confirm("Delete This Redirect?")&&_(c,p,e):(_(c,p,e),u(""),m(""))},_=function(e,r,n){if(e&&r){var a=(c=r,(s=e)in(i={})?Object.defineProperty(i,s,{value:c,enumerable:!0,configurable:!0,writable:!0}):i[s]=c,i);t&&(a.oldKey=t),o(n,a)}else v(!0);var i,s,c},E=function(e){"Enter"===e.key&&g(""==t||""==r?"new":"update")};return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__managelinks__item"},a.a.createElement("div",{className:"simple301redirects__managelinks__item__inner"},a.a.createElement("div",{className:"simple301redirects__managelinks__item__request"},a.a.createElement("input",{className:b&&""==c?"error":"",type:"text",name:"request",value:c,onChange:function(e){return u(e.target.value)},onKeyPress:E,required:!0})),a.a.createElement("div",{className:"simple301redirects__managelinks__item__icon"},a.a.createElement("img",{width:"25",src:f+"assets/images/icon-arrow.svg",alt:"doc"})),a.a.createElement("div",{className:"simple301redirects__managelinks__item__destination"},a.a.createElement("textarea",{className:b&&""==p?"error":"",value:p,onChange:function(e){return m(e.target.value)},onKeyPress:E,rows:"1",required:!0}))),a.a.createElement("div",{className:"simple301redirects__managelinks__item__control"},i?a.a.createElement("button",{className:"simple301redirects__button primary__button",onClick:function(){return g("new")}},Object(l.__)("Add New","simple-301-redirects")):a.a.createElement(a.a.Fragment,null,a.a.createElement(A,{request:c}),a.a.createElement(R,{localClickHandler:g}),!y&&a.a.createElement("div",{className:"simple301redirects__button lock__button s3r-tooltip"},a.a.createElement("img",{width:"15",src:f+"assets/images/icon-lock.svg",alt:"local"}),a.a.createElement("span",null,Object(l.__)("3/1 CLICKS","simple-301-redirects")),a.a.createElement("div",{className:"s3r-tooltiptext-wrapper"},a.a.createElement("div",{className:"s3r-tooltiptext"},Object(l.__)("To see Analytics data","simple-301-redirects")," ",a.a.createElement(k,{label:Object(l.__)("Install BetterLinks","simple-301-redirects")})))),a.a.createElement("button",{className:"simple301redirects__icon__button delete__button",onClick:function(){return g("delete")}},a.a.createElement("img",{src:f+"assets/images/icon-delete.svg",alt:"delete"}))))))}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){F(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(e,t):void 0}}(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 B(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function M(e){var t=q(Object(n.useState)({}),2),r=t[0],i=t[1];Object(n.useEffect)((function(){d.a.get(ajaxurl,{params:{action:"simple301redirects/admin/fetch_all_links",security:m}}).then((function(e){e.data&&i(e.data.data)}),(function(e){console.log(e)}))}),[]);var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"new"==e?s(t):"update"==e?c(t):"delete"==e&&u(t)},s=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/create_new_link"),t.append("security",m),t.append("key",Object.keys(e)),t.append("value",Object.values(e)),d.a.post(ajaxurl,t).then((function(t){t.data&&i(D(D({},r),e))}),(function(e){console.log(e)}))},c=function(e){var t=q(Object.keys(e),1)[0],r=q(Object.values(e),2),n=r[0],a=r[1],o=new FormData;return o.append("action","simple301redirects/admin/update_link"),o.append("security",m),o.append("key",t),o.append("value",n),o.append("oldKey",a),d.a.post(ajaxurl,o).then((function(e){e.data&&setTimeout((function(){i(e.data.data)}),2e3)}),(function(e){console.log(e)}))},u=function(e){var t=q(Object.keys(e),1)[0],n=new FormData;return n.append("action","simple301redirects/admin/delete_link"),n.append("security",m),n.append("key",t),d.a.post(ajaxurl,n).then((function(e){e.data&&(delete r[t],i(D({},r)))}),(function(e){console.log(e)}))};return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__managelinks ".concat(y?"simple301redirects__managelinks--activated-btl":"")},a.a.createElement("div",{className:"simple301redirects__managelinks__info"},a.a.createElement("div",{className:"simple301redirects__managelinks__info__inner"},a.a.createElement("div",{className:"simple301redirects__managelinks__info__request"},a.a.createElement("h4",null,Object(l.__)("Request","simple-301-redirects")),a.a.createElement("p",null,"example: /old-page/")),a.a.createElement("div",{className:"simple301redirects__managelinks__info__destination"},a.a.createElement("h4",null,Object(l.__)("Destination","simple-301-redirects")),a.a.createElement("p",null,"example: ".concat(h,"new-page/"))))),Object.entries(r).map((function(e,t){var r=q(e,2),n=r[0],i=r[1];return a.a.createElement(I,{request:n,destination:i,clickHandler:o,key:t})})),a.a.createElement(I,{isNewLink:!0,clickHandler:o}),a.a.createElement(j,null)))}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function J(e){var t,r,i=(t=Object(n.useState)(b),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(e,t):void 0}}(t,r)||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.")}()),o=i[0],s=i[1];return a.a.createElement(a.a.Fragment,null,!y&&!o&&a.a.createElement("div",{className:"simple301redirects__betterlinks"},a.a.createElement("button",{onClick:function(){var e=new FormData;return e.append("action","simple301redirects/admin/hide_notice"),e.append("security",m),e.append("hide",!0),d.a.post(ajaxurl,e).then((function(e){s(!0)}),(function(e){console.log(e)}))},className:"simple301redirects__betterlinks__close__button"},a.a.createElement("img",{width:"20",src:f+"assets/images/close.svg",alt:"logo"})),a.a.createElement("div",{className:"simple301redirects__betterlinks__content"},a.a.createElement("h3",null,Object(l.__)("BetterLinks – Shorten, Track and Manage any URL","simple-301-redirects")),a.a.createElement("h4",null,Object(l.__)("Install BetterLinks to get the best out of Simple 301 Redirects and get access to more advanced features. Check out the features below","simple-301-redirects"),a.a.createElement("img",{width:"18",style:{transform:"translateY(6px) scale(1.5)",marginLeft:8},src:f+"assets/images/pointing-down.svg",alt:"logo"})),a.a.createElement("ul",null,a.a.createElement("li",null,Object(l.__)("Easy-to-use & Simple Link Shortener","simple-301-redirects")),a.a.createElement("li",null,Object(l.__)("Create attractive looking links instantly","simple-301-redirects")),a.a.createElement("li",null,Object(l.__)("Safe Redirection URLs","simple-301-redirects")),a.a.createElement("li",null,Object(l.__)("Analyze and Track your marketing campaigns from one place","simple-301-redirects")),a.a.createElement("li",null,Object(l.__)("Optimized queries to reduce load time & make faster","simple-301-redirects")),a.a.createElement("li",null,Object(l.__)("Individual Analytics for each links","simple-301-redirects"))),a.a.createElement("h4",null,Object(l.__)("You can migrate from Simple 301 Redirects to BetterLinks within one click.","simple-301-redirects"))),a.a.createElement("div",{className:"simple301redirects__betterlinks__control"},a.a.createElement(k,{label:Object(l.__)("Install BetterLinks","simple-301-redirects")}))))}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function z(e){var t,r,i=(t=Object(n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(e,t):void 0}}(t,r)||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.")}()),o=i[0],s=i[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__documentation"},a.a.createElement("div",{className:"simple301redirects__documentation__panel-header",onClick:function(){return s(!o)}},a.a.createElement("h4",null,a.a.createElement("img",{width:"25",src:f+"assets/images/icon-doc.svg",alt:"doc"})," Documentation"),a.a.createElement("button",null,a.a.createElement("span",{className:"dashicons dashicons-arrow-".concat(o?"up":"down","-alt2")}))),a.a.createElement("div",{className:"simple301redirects__documentation__panel-body"},o&&a.a.createElement("div",{className:"documentation"},a.a.createElement("h4",null,Object(l.__)("Simple Redirects","simple-301-redirects")),a.a.createElement("p",null,Object(l.__)("Simple redirects work similar to the format that Apache uses: the request should be relative to your WordPress root. The destination can be either a full URL to any page on the web, or relative to your WordPress root.","simple-301-redirects")),a.a.createElement("h5",null,Object(l.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Request: ","simple-301-redirects")),Object(l.__)("/old-page/","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Destination: ","simple-301-redirects"))," ",Object(l.__)("/new-page/","simple-301-redirects"))),a.a.createElement("h4",null,Object(l.__)("Wildcards","simple-301-redirects")),a.a.createElement("p",null,Object(l.__)("Wildcards Redirect will redirect all files within a directory to the same filename in the redirected directory. To use wildcards, put an asterisk (*) after the folder name that you want to redirect.","simple-301-redirects")),a.a.createElement("h5",null,Object(l.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Request: ","simple-301-redirects")),Object(l.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Destination: ","simple-301-redirects"))," ",Object(l.__)("/new-folder/* ","simple-301-redirects"))),a.a.createElement("p",null,Object(l.__)("You can also use wildcards to redirect all the dynamic files of a certain directory to a same destination URL as well.","simple-301-redirects")),a.a.createElement("h5",null,Object(l.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Request: ","simple-301-redirects")),Object(l.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Destination: ","simple-301-redirects"))," ",Object(l.__)("/new-page/","simple-301-redirects"))),a.a.createElement("p",null,Object(l.__)("You can also use the asterisk in the destination to replace whatever it matched in the request if you like. Something like this:","simple-301-redirects")),a.a.createElement("h5",null,Object(l.__)("Example","simple-301-redirects")),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Request:","simple-301-redirects")),Object(l.__)("/old-folder/*","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Destination:","simple-301-redirects"))," ",Object(l.__)("/some/other/folder/*","simple-301-redirects"))),a.a.createElement("p",null,"Or:"),a.a.createElement("ul",null,a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("/some/other/folder/*","simple-301-redirects"))," ",Object(l.__)("/old-folder/*/content/","simple-301-redirects")),a.a.createElement("li",null,a.a.createElement("strong",null,Object(l.__)("Destination:","simple-301-redirects"))," ",Object(l.__)("/some/other/folder/*","simple-301-redirects")))))))}function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],_n=!0,o=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);_n=!0);}catch(e){o=!0,a=e}finally{try{_n||null==r.return||r.return()}finally{if(o)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(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 K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function V(e){var t=W(Object(n.useState)(!1),2),r=(t[0],t[1],W(Object(n.useState)(!1),2)),i=r[0],o=r[1];return Object(n.useEffect)((function(){"true"==new URLSearchParams(window.location.search).get("isImport")&&d.a.post("".concat(ajaxurl,"?action=simple301redirects/admin/get_import_info&security=").concat(m)).then((function(e){o(e.data.data)}),(function(e){console.log(e)}))}),[]),a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"simple301redirects__panel__divider"},a.a.createElement("div",{className:"simple301redirects__import"},a.a.createElement("div",{className:"simple301redirects__import__head"},a.a.createElement("h4",null,Object(l.__)("Import Redirect Rules","simple-301-redirects")),a.a.createElement("p",null,Object(l.__)("Import your 301 Redirect Links from your Device","simple-301-redirects"))),a.a.createElement("form",{action:"admin.php?page=301options&isImport=true",method:"POST",encType:"multipart/form-data"},a.a.createElement("div",{role:"group",className:"simple301redirects-button-group","aria-labelledby":"my-radio-group"},a.a.createElement("input",{type:"hidden",name:"import",value:!0}),a.a.createElement("input",{type:"hidden",name:"security",value:m}),a.a.createElement("input",{type:"file",id:"upload_file",name:"upload_file",size:"25"}),a.a.createElement("input",{type:"submit",name:"submit",id:"submit",className:"button button-primary",style:{marginTop:10},value:Object(l.__)("Import File","simple-301-redirects"),disabled:""})),i&&a.a.createElement("p",null,a.a.createElement("strong",null,i.replace(/"|"/g,""))))),a.a.createElement("div",{className:"simple301redirects__export"},a.a.createElement("div",{className:"simple301redirects__export__head"},a.a.createElement("h4",null,Object(l.__)("Export Redirect Rules","simple-301-redirects")),a.a.createElement("p",null,Object(l.__)("Export your 301 Redirect Links in .csv format","simple-301-redirects"))),a.a.createElement("form",{action:"admin.php?page=301options",method:"POST"},a.a.createElement("input",{type:"hidden",name:"export",value:!0}),a.a.createElement("input",{type:"hidden",name:"security",value:m}),a.a.createElement("div",{className:"simple301redirects-button-group"},a.a.createElement("button",{type:"submit",className:"btl-export-download-button"},Object(l.__)("Export File","simple-301-redirects")))))))}function X(e){return a.a.createElement(a.a.Fragment,null,a.a.createElement(_,null),a.a.createElement("div",{className:"Simple301Redirects__content__wrapper"},a.a.createElement("div",{className:"Simple301Redirects__main__content"},a.a.createElement(M,null),a.a.createElement(J,null)),a.a.createElement("div",{className:"Simple301Redirects__archive__sidebar"},a.a.createElement(V,null),a.a.createElement(z,null))))}I.propTypes=L,I.defaultProps={request:"",destination:"",isNewLink:!1},M.propTypes={},M.defaultProps={},J.propTypes={},J.defaultProps={},z.propTypes={},z.defaultProps={},V.propTypes={},V.defaultProps={},X.propTypes={},X.defaultProps={},document.addEventListener("DOMContentLoaded",(function(){o.a.render(a.a.createElement(X,null),document.getElementById("simple301redirectsbody"))}))}]);
includes/Admin.php CHANGED
File without changes
includes/Admin/Ajax.php CHANGED
File without changes
includes/Admin/Assets.php CHANGED
File without changes
includes/Admin/Menu.php CHANGED
File without changes
includes/Admin/Tools.php CHANGED
@@ -1,7 +1,8 @@
1
- <?php
2
  namespace Simple301Redirects\Admin;
3
 
4
- class Tools {
 
5
  public function __construct()
6
  {
7
  add_action('admin_init', [$this, 'export_data']);
@@ -11,64 +12,88 @@ class Tools {
11
  public function export_data()
12
  {
13
  $page = isset($_GET['page']) ? $_GET['page'] : '';
14
- $export = isset($_REQUEST['export']) ? $_REQUEST['export'] : false;
15
- if ($page === '301options' && $export == true && current_user_can( 'manage_options' )) {
16
- check_ajax_referer('simple301redirects', 'security');
17
- $content = json_encode(get_option(SIMPLE301REDIRECTS_SETTINGS_NAME));
18
- $filename = 'simple-301-redirects.' . date('Y-m-d') . '.json';
19
- ($file = fopen($filename, 'w')) or die('Unable to open file!');
20
- fwrite($file, $content);
21
- fclose($file);
22
- header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
23
- header('Content-Type: application/force-download');
24
- header('Expires: 0');
25
- header('Cache-Control: must-revalidate');
26
- header('Pragma: public');
27
- header('Content-Type: text/plain');
28
-
29
- echo $content;
30
- exit();
31
- }
 
 
 
 
 
 
 
 
 
 
32
  }
33
  public function import_data()
34
- {
35
- $page = isset($_GET['page']) ? $_GET['page'] : '';
36
- $import = isset($_REQUEST['import']) ? $_REQUEST['import'] : false;
37
- if ($page === '301options' && $import == true && current_user_can( 'manage_options' )) {
38
- check_ajax_referer('simple301redirects', 'security');
39
- if (!empty($_FILES['upload_file']['tmp_name'])) {
40
- $fileContent = json_decode(file_get_contents($_FILES['upload_file']['tmp_name']), true);
 
41
  if (!empty($fileContent)) {
42
  $results = $this->process_data($fileContent);
43
- $_SESSION['simple_301_redirects_import_info'] = json_encode($results);
44
- }
45
- }
46
- }
47
  }
48
- public function process_data($data)
49
- {
50
- $message = '';
51
- if (isset($data) && is_array($data) && count($data) > 0) {
 
 
 
 
 
 
 
 
 
 
 
 
52
  $oldData = get_option(SIMPLE301REDIRECTS_SETTINGS_NAME);
53
- $value = (!empty($oldData) ? array_unique (array_merge (get_option(SIMPLE301REDIRECTS_SETTINGS_NAME), $data)) : $data);
54
  $restuls = update_option(SIMPLE301REDIRECTS_SETTINGS_NAME, $value);
55
- if( $restuls){
56
  $message = 'All Data has been successfully Imported.';
57
  } else {
58
  $message = 'Import Failed.';
59
  }
60
- }
61
- return $message;
62
  }
63
  public function get_import_info()
64
- {
65
- check_ajax_referer('simple301redirects', 'security');
66
- $results = '';
67
- if (isset($_SESSION['simple_301_redirects_import_info'])) {
68
- $results = $_SESSION['simple_301_redirects_import_info'];
69
- unset($_SESSION['simple_301_redirects_import_info']);
70
- }
71
- wp_send_json_success($results);
72
- wp_die();
73
- }
74
- }
 
1
+ <?php
2
  namespace Simple301Redirects\Admin;
3
 
4
+ class Tools
5
+ {
6
  public function __construct()
7
  {
8
  add_action('admin_init', [$this, 'export_data']);
12
  public function export_data()
13
  {
14
  $page = isset($_GET['page']) ? $_GET['page'] : '';
15
+ $export = isset($_REQUEST['export']) ? $_REQUEST['export'] : false;
16
+ if ($page === '301options' && $export == true && current_user_can('manage_options')) {
17
+ check_ajax_referer('simple301redirects', 'security');
18
+ $content = get_option(SIMPLE301REDIRECTS_SETTINGS_NAME);
19
+ $content = $this->prepare_csv_file_data(get_option(SIMPLE301REDIRECTS_SETTINGS_NAME));
20
+ $filename = 'simple-301-redirects.' . date('Y-m-d') . '.csv';
21
+ header('Content-Type: application/csv');
22
+ header('Content-Disposition: attachment; filename="'.$filename.'";');
23
+ $f = fopen('php://output', 'w');
24
+ foreach ($content as $line) {
25
+ fputcsv($f, $line);
26
+ }
27
+ exit();
28
+ }
29
+ }
30
+ public function prepare_csv_file_data($data)
31
+ {
32
+ $formatted_data = [];
33
+ foreach ($data as $key => $value) {
34
+ $formatted_data[] = [
35
+ $key,
36
+ $value
37
+ ];
38
+ }
39
+ if (is_array($data) && count($data) > 0) {
40
+ return array_merge([['request', 'destination']], $formatted_data);
41
+ }
42
+ return [];
43
  }
44
  public function import_data()
45
+ {
46
+ $page = isset($_GET['page']) ? $_GET['page'] : '';
47
+ $import = isset($_REQUEST['import']) ? $_REQUEST['import'] : false;
48
+ if ($page === '301options' && $import == true && current_user_can('manage_options')) {
49
+ check_ajax_referer('simple301redirects', 'security');
50
+ $file = $_FILES['upload_file'];
51
+ if (!empty($file['tmp_name']) && 'csv' === pathinfo($file['name'])[ 'extension' ]) {
52
+ $fileContent = fopen($file['tmp_name'], "r");
53
  if (!empty($fileContent)) {
54
  $results = $this->process_data($fileContent);
55
+ set_transient('simple_301_redirects_import_info', json_encode($results), 60 * 60 * 5);
56
+ }
57
+ }
58
+ }
59
  }
60
+ public function process_data($csv)
61
+ {
62
+ $message = '';
63
+ $count = 0;
64
+ $data = [];
65
+ while (($item = fgetcsv($csv)) !== false) {
66
+ if ($count === 0) {
67
+ $this->link_header = $item;
68
+ $count++;
69
+ continue;
70
+ }
71
+ $item = array_combine($this->link_header, $item);
72
+ $item = \Simple301Redirects\Helper::sanitize_text_or_array_field($item);
73
+ $data[$item['request']] = $item['destination'];
74
+ }
75
+ if (count($data) > 0) {
76
  $oldData = get_option(SIMPLE301REDIRECTS_SETTINGS_NAME);
77
+ $value = (!empty($oldData) ? array_unique(array_merge(get_option(SIMPLE301REDIRECTS_SETTINGS_NAME), $data)) : $data);
78
  $restuls = update_option(SIMPLE301REDIRECTS_SETTINGS_NAME, $value);
79
+ if ($restuls) {
80
  $message = 'All Data has been successfully Imported.';
81
  } else {
82
  $message = 'Import Failed.';
83
  }
84
+ }
85
+ return $message;
86
  }
87
  public function get_import_info()
88
+ {
89
+ check_ajax_referer('simple301redirects', 'security');
90
+ $results = get_transient('simple_301_redirects_import_info');
91
+ if ($results) {
92
+ delete_transient('simple_301_redirects_import_info');
93
+ wp_send_json_success($results);
94
+ wp_die();
95
+ }
96
+ wp_send_json_error($results);
97
+ wp_die();
98
+ }
99
+ }
includes/Admin/WPDev/PluginUsageTracker.php CHANGED
File without changes
includes/Helper.php CHANGED
@@ -1,29 +1,31 @@
1
  <?php
2
  namespace Simple301Redirects;
3
 
4
- class Helper {
 
5
  /**
6
- * Check Supported Post type for admin page and plugin main settings page
7
- *
8
- * @return bool
9
- */
10
-
11
- public static function plugin_page_hook_suffix($hook)
12
- {
13
- if ($hook == 'settings_page_301options') {
14
- return true;
15
- }
16
- return false;
17
- }
18
- public static function str_ireplace($search,$replace,$subject){
 
19
  $token = chr(1);
20
  $haystack = strtolower($subject);
21
  $needle = strtolower($search);
22
- while (($pos=strpos($haystack,$needle))!==FALSE){
23
- $subject = substr_replace($subject,$token,$pos,strlen($search));
24
- $haystack = substr_replace($haystack,$token,$pos,strlen($search));
25
  }
26
- $subject = str_replace($token,$replace,$subject);
27
  return $subject;
28
  }
29
 
@@ -94,7 +96,24 @@ class Helper {
94
  return $install;
95
  }
96
 
97
- public static function is_activated_betterlinks(){
 
98
  return is_plugin_active('betterlinks/betterlinks.php');
99
  }
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  namespace Simple301Redirects;
3
 
4
+ class Helper
5
+ {
6
  /**
7
+ * Check Supported Post type for admin page and plugin main settings page
8
+ *
9
+ * @return bool
10
+ */
11
+
12
+ public static function plugin_page_hook_suffix($hook)
13
+ {
14
+ if ($hook == 'settings_page_301options') {
15
+ return true;
16
+ }
17
+ return false;
18
+ }
19
+ public static function str_ireplace($search, $replace, $subject)
20
+ {
21
  $token = chr(1);
22
  $haystack = strtolower($subject);
23
  $needle = strtolower($search);
24
+ while (($pos=strpos($haystack, $needle))!==false) {
25
+ $subject = substr_replace($subject, $token, $pos, strlen($search));
26
+ $haystack = substr_replace($haystack, $token, $pos, strlen($search));
27
  }
28
+ $subject = str_replace($token, $replace, $subject);
29
  return $subject;
30
  }
31
 
96
  return $install;
97
  }
98
 
99
+ public static function is_activated_betterlinks()
100
+ {
101
  return is_plugin_active('betterlinks/betterlinks.php');
102
  }
103
+
104
+ public static function sanitize_text_or_array_field($array_or_string)
105
+ {
106
+ if (is_string($array_or_string)) {
107
+ $array_or_string = sanitize_text_field($array_or_string);
108
+ } elseif (is_array($array_or_string)) {
109
+ foreach ($array_or_string as $key => &$value) {
110
+ if (is_array($value)) {
111
+ $value = self::sanitize_text_or_array_field($value);
112
+ } else {
113
+ $value = sanitize_text_field($value);
114
+ }
115
+ }
116
+ }
117
+ return $array_or_string;
118
+ }
119
+ }
includes/Installer.php CHANGED
File without changes
languages/simple-301-redirects.pot CHANGED
@@ -2,16 +2,16 @@
2
  # This file is distributed under the same license as the Simple 301 Redirects plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Simple 301 Redirects 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-301-redirects\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-04-01T03:22:51+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: simple-301-redirects\n"
16
 
17
  #. Plugin Name of the plugin
@@ -35,15 +35,27 @@ msgstr ""
35
  msgid "https://wpdeveloper.net/"
36
  msgstr ""
37
 
38
- #: includes/Admin/Ajax.php:34
 
 
 
 
 
 
 
 
 
 
 
 
39
  msgid "Plugin is installed successfully!"
40
  msgstr ""
41
 
42
- #: includes/Admin/Ajax.php:47
43
  msgid "Plugin couldn't be activated."
44
  msgstr ""
45
 
46
- #: includes/Admin/Ajax.php:49
47
  msgid "BetterLinks is activated!"
48
  msgstr ""
49
 
@@ -84,7 +96,7 @@ msgid "You can migrate from Simple 301 Redirects to BetterLinks within one click
84
  msgstr ""
85
 
86
  #: src/components/BetterLinks/index.js:49
87
- #: src/components/Link/index.js:109
88
  msgid "Install BetterLinks"
89
  msgstr ""
90
 
@@ -169,15 +181,15 @@ msgstr ""
169
  msgid "/old-folder/*/content/"
170
  msgstr ""
171
 
172
- #: src/components/Link/index.js:97
173
  msgid "Add New"
174
  msgstr ""
175
 
176
- #: src/components/Link/index.js:106
177
  msgid "3/1 CLICKS"
178
  msgstr ""
179
 
180
- #: src/components/Link/index.js:109
181
  msgid "To see Analytics data"
182
  msgstr ""
183
 
@@ -189,19 +201,19 @@ msgstr ""
189
  msgid "Import your 301 Redirect Links from your Device"
190
  msgstr ""
191
 
192
- #: src/components/Tools/index.js:44
193
  msgid "Import File"
194
  msgstr ""
195
 
196
- #: src/components/Tools/index.js:57
197
  msgid "Export Redirect Rules"
198
  msgstr ""
199
 
200
- #: src/components/Tools/index.js:58
201
- msgid "Export your 301 Redirect Links in .json format"
202
  msgstr ""
203
 
204
- #: src/components/Tools/index.js:63
205
  msgid "Export File"
206
  msgstr ""
207
 
@@ -209,10 +221,10 @@ msgstr ""
209
  msgid "Use Wildcards?"
210
  msgstr ""
211
 
212
- #: src/containers/group/ManageLinks.js:58
213
  msgid "Request"
214
  msgstr ""
215
 
216
- #: src/containers/group/ManageLinks.js:62
217
  msgid "Destination"
218
  msgstr ""
2
  # This file is distributed under the same license as the Simple 301 Redirects plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Simple 301 Redirects 2.0.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/simple-301-redirects\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-10-18T06:29:57+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: simple-301-redirects\n"
16
 
17
  #. Plugin Name of the plugin
35
  msgid "https://wpdeveloper.net/"
36
  msgstr ""
37
 
38
+ #: includes/Admin.php:46
39
+ msgid "Want to help make <strong>Simple 301 Redirects</strong> even more awesome? You can get a <strong>10% discount</strong> coupon on our Premium products if you allow us to track the non-sensitive usage data."
40
+ msgstr ""
41
+
42
+ #: includes/Admin.php:47
43
+ msgid ""
44
+ "We collect non-sensitive diagnostic data and plugin usage information. \n"
45
+ " Your site URL, WordPress & PHP version, plugins & themes and email address to send you the \n"
46
+ " discount coupon. This data lets us make sure this plugin always stays compatible with the most \n"
47
+ " popular plugins and themes. No spam, I promise."
48
+ msgstr ""
49
+
50
+ #: includes/Admin/Ajax.php:41
51
  msgid "Plugin is installed successfully!"
52
  msgstr ""
53
 
54
+ #: includes/Admin/Ajax.php:55
55
  msgid "Plugin couldn't be activated."
56
  msgstr ""
57
 
58
+ #: includes/Admin/Ajax.php:57
59
  msgid "BetterLinks is activated!"
60
  msgstr ""
61
 
96
  msgstr ""
97
 
98
  #: src/components/BetterLinks/index.js:49
99
+ #: src/components/Link/index.js:108
100
  msgid "Install BetterLinks"
101
  msgstr ""
102
 
181
  msgid "/old-folder/*/content/"
182
  msgstr ""
183
 
184
+ #: src/components/Link/index.js:96
185
  msgid "Add New"
186
  msgstr ""
187
 
188
+ #: src/components/Link/index.js:105
189
  msgid "3/1 CLICKS"
190
  msgstr ""
191
 
192
+ #: src/components/Link/index.js:108
193
  msgid "To see Analytics data"
194
  msgstr ""
195
 
201
  msgid "Import your 301 Redirect Links from your Device"
202
  msgstr ""
203
 
204
+ #: src/components/Tools/index.js:46
205
  msgid "Import File"
206
  msgstr ""
207
 
208
+ #: src/components/Tools/index.js:59
209
  msgid "Export Redirect Rules"
210
  msgstr ""
211
 
212
+ #: src/components/Tools/index.js:60
213
+ msgid "Export your 301 Redirect Links in .csv format"
214
  msgstr ""
215
 
216
+ #: src/components/Tools/index.js:67
217
  msgid "Export File"
218
  msgstr ""
219
 
221
  msgid "Use Wildcards?"
222
  msgstr ""
223
 
224
+ #: src/containers/group/ManageLinks.js:111
225
  msgid "Request"
226
  msgstr ""
227
 
228
+ #: src/containers/group/ManageLinks.js:115
229
  msgid "Destination"
230
  msgstr ""
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Simple 301 Redirects by BetterLinks ===
2
- Contributors: wpdevteam, asif2bd, re_enter_rupok, tusharimran, scottnelle
3
  Tags: 301 redirects, 301, shortlinks, link shortener, links, permalink, redirects, seo redirects, url redirect, 301 redirect, url, pretty links, short links, link tracking, affiliate links, urls
4
  Requires at least: 5.0
5
- Tested up to: 5.7.1
6
  Requires PHP: 5.4
7
- Stable tag: 2.0.5
8
  License: GPL-3.0-or-later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -31,7 +31,7 @@ By setting up 301 redirects from your old pages to your new pages, any incoming
31
 
32
  **◾Import Redirect Rules:** You can import redirects links in bulk from your device and upload using this plugin to manage links
33
 
34
- **◾ Export Redirect Rules:** You can also export your 301 Redirect Links in .json format to use in future
35
 
36
  ◾ **Wildcards:** It will redirect all files within a directory to the same filename in the redirected directory. To use wildcards, put an asterisk (\*) after the folder name that you want to redirect. Example:
37
 
@@ -100,6 +100,10 @@ Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do bett
100
 
101
  == Changelog ==
102
 
 
 
 
 
103
  = 2.0.5 - 08/07/2021 =
104
  * Fixed: Http mixed content issue
105
  * Added: AJAX Support in place of REST API
@@ -159,5 +163,5 @@ Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do bett
159
  = 1.0 =
160
  * Initial Release
161
 
162
- == Upgrade Notice ==
163
  [Major Update] Bugfix, new design, and stability
1
  === Simple 301 Redirects by BetterLinks ===
2
+ Contributors: wpdevteam, asif2bd, re_enter_rupok, scottnelle
3
  Tags: 301 redirects, 301, shortlinks, link shortener, links, permalink, redirects, seo redirects, url redirect, 301 redirect, url, pretty links, short links, link tracking, affiliate links, urls
4
  Requires at least: 5.0
5
+ Tested up to: 6.0
6
  Requires PHP: 5.4
7
+ Stable tag: 2.0.6
8
  License: GPL-3.0-or-later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
31
 
32
  **◾Import Redirect Rules:** You can import redirects links in bulk from your device and upload using this plugin to manage links
33
 
34
+ **◾ Export Redirect Rules:** You can also export your 301 Redirect Links in .csv format to use in future
35
 
36
  ◾ **Wildcards:** It will redirect all files within a directory to the same filename in the redirected directory. To use wildcards, put an asterisk (\*) after the folder name that you want to redirect. Example:
37
 
100
 
101
  == Changelog ==
102
 
103
+ = 2.0.6 - 19/10/2021 =
104
+ * Added: CSV Import/Export option
105
+ * Few minor bug fix and improvements
106
+
107
  = 2.0.5 - 08/07/2021 =
108
  * Fixed: Http mixed content issue
109
  * Added: AJAX Support in place of REST API
163
  = 1.0 =
164
  * Initial Release
165
 
166
+ == Upgrade Notice ==
167
  [Major Update] Bugfix, new design, and stability
vendor/autoload.php CHANGED
File without changes
vendor/composer/ClassLoader.php CHANGED
File without changes
vendor/composer/InstalledVersions.php CHANGED
File without changes
vendor/composer/LICENSE CHANGED
File without changes
vendor/composer/autoload_classmap.php CHANGED
File without changes
vendor/composer/autoload_namespaces.php CHANGED
File without changes
vendor/composer/autoload_psr4.php CHANGED
File without changes
vendor/composer/autoload_real.php CHANGED
File without changes
vendor/composer/autoload_static.php CHANGED
File without changes
vendor/composer/installed.json CHANGED
File without changes
vendor/composer/installed.php CHANGED
File without changes
wp-simple-301-redirects.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://wpdeveloper.net/
8
  * Text Domain: simple-301-redirects
9
  * Domain Path: /languages
10
- * Version: 2.0.5
11
  */
12
 
13
  /* Copyright 2009-2021 WPDeveloper
@@ -66,7 +66,7 @@ if (!class_exists("Simple301redirects")) {
66
 
67
  public function define_constants()
68
  {
69
- define('SIMPLE301REDIRECTS_VERSION', '2.0.5');
70
  define('SIMPLE301REDIRECTS_SETTINGS_NAME', '301_redirects');
71
  define('SIMPLE301REDIRECTS_PLUGIN_FILE', __FILE__);
72
  define('SIMPLE301REDIRECTS_PLUGIN_BASENAME', plugin_basename(__FILE__));
7
  * Author URI: https://wpdeveloper.net/
8
  * Text Domain: simple-301-redirects
9
  * Domain Path: /languages
10
+ * Version: 2.0.6
11
  */
12
 
13
  /* Copyright 2009-2021 WPDeveloper
66
 
67
  public function define_constants()
68
  {
69
+ define('SIMPLE301REDIRECTS_VERSION', '2.0.6');
70
  define('SIMPLE301REDIRECTS_SETTINGS_NAME', '301_redirects');
71
  define('SIMPLE301REDIRECTS_PLUGIN_FILE', __FILE__);
72
  define('SIMPLE301REDIRECTS_PLUGIN_BASENAME', plugin_basename(__FILE__));