Simple 301 Redirects - Version 2.0.7

Version Description

  • 13/09/2022 =
  • Fixed: WP-CLI issue.
  • Few minor bug fix and improvements
Download this release

Release Info

Developer priyomukul
Plugin Icon 128x128 Simple 301 Redirects
Version 2.0.7
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.7

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' => 'd587d386c8c9a1032e7d0ce98fb63c9d');
1
+ <?php return array('dependencies' => array('react', 'react-dom', 'wp-i18n'), 'version' => '2a59159f9c29cf550663');
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=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"))}))}]);
1
+ !function(){var e={669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),i=r(26),o=r(372),a=r(327),s=r(97),l=r(109),c=r(985),u=r(61);e.exports=function(e){return new Promise((function(t,r){var p=e.data,d=e.headers,f=e.responseType;n.isFormData(p)&&delete d["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+y)}var v=s(e.baseURL,e.url);function g(){if(m){var n="getAllResponseHeaders"in m?l(m.getAllResponseHeaders()):null,o={data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m};i(t,r,o),m=null}}if(m.open(e.method.toUpperCase(),a(v,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},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,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},n.isStandardBrowserEnv()){var _=(e.withCredentials||c(v))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(d[e.xsrfHeaderName]=_)}"setRequestHeader"in m&&n.forEach(d,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete d[t]:m.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),f&&"json"!==f&&(m.responseType=e.responseType),"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)})),p||(p=null),m.send(p)}))}},609:function(e,t,r){"use strict";var n=r(867),i=r(849),o=r(321),a=r(185);function s(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var l=s(r(655));l.Axios=o,l.create=function(e){return s(a(l.defaults,e))},l.Cancel=r(263),l.CancelToken=r(972),l.isCancel=r(502),l.all=function(e){return Promise.all(e)},l.spread=r(713),l.isAxiosError=r(268),e.exports=l,e.exports.default=l},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function i(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))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),i=r(327),o=r(782),a=r(572),s=r(185),l=r(875),c=l.validators;function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}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&&l.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.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 i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!n){var u=[a,void 0];for(Array.prototype.unshift.apply(u,r),u=u.concat(o),i=Promise.resolve(e);u.length;)i=i.then(u.shift(),u.shift());return i}for(var p=e;r.length;){var d=r.shift(),f=r.shift();try{p=d(p)}catch(e){f(e);break}}try{i=a(p)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},u.prototype.getUri=function(e){return e=s(this.defaults,e),i(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},782:function(e,t,r){"use strict";var n=r(867);function i(){this.handlers=[]}i.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},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},97:function(e,t,r){"use strict";var n=r(793),i=r(303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},572:function(e,t,r){"use strict";var n=r(867),i=r(527),o=r(502),a=r(655);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i.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||a.adapter)(e).then((function(t){return s(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,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}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],a=["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 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 c(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=l(void 0,t[e]))})),n.forEach(o,c),n.forEach(a,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(void 0,t[i])})),n.forEach(s,(function(n){n in t?r[n]=l(e[n],t[n]):n in e&&(r[n]=l(void 0,e[n]))}));var u=i.concat(o).concat(a).concat(s),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return n.forEach(p,c),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),i=r(655);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(867),i=r(16),o=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(l=r(448)),l),transformRequest:[function(e,t){return i(t,"Accept"),i(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,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(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){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(a)})),e.exports=c},849:function(e){"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)}}},327:function(e,t,r){"use strict";var n=r(867);function i(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 o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];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)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&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(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(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=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),i=["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,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(593),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={},a=n.version.split(".");function s(e,t){for(var r=t?t.split("."):a,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}i.transitional=function(e,t,r){var i=t&&s(t);function a(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(a(n," has been removed in "+t));return i&&!o[n]&&(o[n]=!0,console.warn(a(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),i=n.length;i-- >0;){var o=n[i],a=t[o];if(a){var s=e[o],l=void 0===s||a(s,o,e);if(!0!==l)throw new TypeError("option "+o+" must be "+l)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},867:function(e,t,r){"use strict";var n=r(849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(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:l,isUndefined:a,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return s(e)&&c(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):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,i){e[i]=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}}},703:function(e,t,r){"use strict";var n=r(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==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,bigint: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:o,resetWarningCache:i};return r.PropTypes=r,r}},697:function(e,t,r){e.exports=r(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},593:function(e){"use strict";e.exports=JSON.parse('{"_from":"axios@^0.21.1","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"axios@^0.21.1","name":"axios","escapedName":"axios","rawSpec":"^0.21.1","saveSpec":null,"fetchSpec":"^0.21.1"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_shasum":"c67b90dc0568e5c1cf2b0b858c43ba28e2eda575","_spec":"axios@^0.21.1","_where":"/home/runner/work/simple-301-redirects/simple-301-redirects","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundleDependencies":false,"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"deprecated":false,"description":"Promise based HTTP client for the browser and node.js","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"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.React,t=r.n(e),n=window.ReactDOM,i=r.n(n),o=window.wp.i18n,a=r(669),s=r.n(a),l=window.Simple301Redirects,c=l.s3r_nonce,u=l.plugin_root_url,p=(l.plugin_root_path,l.site_url),d=(l.route_path,l.is_betterlinks_activated),f=l.hide_btl_notice,m=function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},h=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/activate_plugin"),t.append("security",c),t.append("basename",e),s().post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))};function y(e){return t().createElement(t().Fragment,null,t().createElement("div",{className:"simple301redirects__topbar"},t().createElement("div",{className:"simple301redirects__topbar__logo"},t().createElement("img",{width:"40",src:u+"assets/images/logo.svg",alt:"logo"})),t().createElement("h3",{className:"simple301redirects__topbar__title"},(0,o.__)("Simple 301 Redirects","simple-301-redirects"))))}function v(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,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(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)?g(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 g(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 _(r){var n=v((0,e.useState)(""),2),i=n[0],a=n[1],l=v((0,e.useState)(!1),2),u=l[0],p=l[1],d=v((0,e.useState)(!1),2),f=d[0],m=d[1];return(0,e.useEffect)((function(){var e=new FormData;e.append("action","simple301redirects/admin/get_wildcard"),e.append("security",c),s().post(ajaxurl,e).then((function(e){p("true"==e.data.data),m(!0)}),(function(e){console.log(e)}))}),[]),t().createElement(t().Fragment,null,f&&t().createElement("div",{className:"simple301redirects__wildcards"},t().createElement("input",{type:"checkbox",name:"wildcard",id:"wildcard",defaultChecked:u,onChange:function(){return function(e){a("Saving..."),p(e);var t=new FormData;return t.append("action","simple301redirects/admin/wildcard"),t.append("security",c),t.append("toggle",e),s().post(ajaxurl,t).then((function(e){e.data.success&&setTimeout((function(){a("Saved!"),setTimeout((function(){a("")}),3e3)}),1e3)}),(function(e){console.log(e)}))}(!u)}}),t().createElement("label",{htmlFor:"wildcard"},(0,o.__)("Use Wildcards?","simple-301-redirects")," ",i)))}y.propTypes={},y.defaultProps={},_.propTypes={},_.defaultProps={};var b=r(697),E=r.n(b);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function x(){x=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new k(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===u)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function p(){}function d(){}function f(){}var m={};s(m,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(j([])));y&&y!==t&&r.call(y,i)&&(m=y);var v=f.prototype=p.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(i,o,a,s){var l=c(e[i],e,o);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==w(p)&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,u;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function j(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=f,s(v,"constructor",f),s(f,"constructor",d),d.displayName=s(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},g(_.prototype),s(_.prototype,o,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new _(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(v),s(v,a,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=j,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function S(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}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}var j={label:E().string};function O(r){var n,i,o=r.label,a=(n=(0,e.useState)(o),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(n,i)||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}}(n,i)||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.")}()),l=a[0],u=a[1],p=function(){var e,t=(e=x().mark((function e(){return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u("Installing..."),("betterlinks",t=void 0,t=new FormData,t.append("action","simple301redirects/admin/install_plugin"),t.append("security",c),t.append("slug","betterlinks"),s().post(ajaxurl,t).then((function(e){return e.data}),(function(e){console.log(e)}))).then((function(e){u(e.data)})).then((function(){u(l+" Activating..."),h("betterlinks/betterlinks.php").then((function(e){u(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,i){var o=e.apply(t,r);function a(e){S(o,n,i,a,s,"next",e)}function s(e){S(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return t().createElement(t().Fragment,null,t().createElement("button",{onClick:p},l))}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}O.propTypes=j,O.defaultProps={label:""};var A=function(r){var n,i,o=(n=(0,e.useState)(!1),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(n,i)||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}}(n,i)||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.")}()),a=o[0],s=o[1];return t().createElement(t().Fragment,null,t().createElement("button",{className:"simple301redirects__icon__button",onClick:function(){return function(e,t){"/"===t[0]&&(t=t.substring(1)),/^((http|https|ftp):\/\/)/.test(t)?m(t):m(e+t),s(!0),window.setTimeout((function(){s(!1)}),3e3)}(p,r.request)}},a?t().createElement("span",{className:"dashicons dashicons-yes"}):t().createElement("img",{src:u+"assets/images/icon-copy.svg",alt:"copy"})))};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}var L=function(r){var n,i,o=r.localClickHandler,a=(n=(0,e.useState)(!1),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(n,i)||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}}(n,i)||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=a[0],l=a[1],c=(0,e.useRef)(null),u=(0,e.useRef)(null),p=(0,e.useRef)(null),d=(0,e.useRef)(null),f=(0,e.useRef)(null);return t().createElement(t().Fragment,null,t().createElement("div",{className:"Simple301Redirects__loading-dock",ref:c},t().createElement("svg",{id:"Simple301Redirects__load-b",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:d},t().createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),t().createElement("svg",{id:"Simple301Redirects__load",x:"0px",y:"0px",viewBox:"0 0 150 150",ref:p},t().createElement("circle",{className:"Simple301Redirects__loading-inner",cx:75,cy:75,r:60})),t().createElement("button",{className:"Simple301Redirects__loading__button__submit",ref:u,onClick:function(){return o("update"),void(s||(l(!0),u.current.classList.remove("Simple301Redirects__return"),u.current.blur(),c.current.classList.add("Simple301Redirects__loaded"),p.current.style.display="initial",d.current.style.display="initial",setTimeout((function(){p.current.style.opacity=1}),225),setTimeout((function(){d.current.style.opacity=1}),350),setTimeout((function(){c.current.classList.remove("Simple301Redirects__loaded"),p.current.style.display="none",d.current.style.display="none",p.current.style.opacity=0,d.current.style.opacity=0,u.current.classList.add("Simple301Redirects__popout"),u.current.innerHTML="",setTimeout((function(){f.current.style.display="block"}),150)}),1450),setTimeout((function(){u.current.classList.remove("Simple301Redirects__popout"),u.current.classList.add("Simple301Redirects__return"),u.current.innerHTML="Update",f.current.style.display="none",l(!1)}),2e3)))}},"Update"),t().createElement("svg",{id:"Simple301Redirects__check",style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",ref:f},t().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 R(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,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(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)?C(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 C(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:E().string,destination:E().string,isNewLink:E().bool,clickHandler:E().func};function I(r){var n=r.request,i=r.destination,a=r.isNewLink,s=r.clickHandler,l=R((0,e.useState)(""),2),c=l[0],p=l[1],f=R((0,e.useState)(""),2),m=f[0],h=f[1];(0,e.useEffect)((function(){p(n),h(i)}),[n,i]);var y=R((0,e.useState)(!1),2),v=y[0],g=y[1],_=function(e){"update"==e?b(c,m,e):"delete"==e?!0===confirm("Delete This Redirect?")&&b(c,m,e):(b(c,m,e),p(""),h(""))},b=function(e,t,r){if(e&&t){var i=(l=t,(a=e)in(o={})?Object.defineProperty(o,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):o[a]=l,o);n&&(i.oldKey=n),s(r,i)}else g(!0);var o,a,l},E=function(e){"Enter"===e.key&&_(""==n||""==i?"new":"update")};return t().createElement(t().Fragment,null,t().createElement("div",{className:"simple301redirects__managelinks__item"},t().createElement("div",{className:"simple301redirects__managelinks__item__inner"},t().createElement("div",{className:"simple301redirects__managelinks__item__request"},t().createElement("input",{className:v&&""==c?"error":"",type:"text",name:"request",value:c,onChange:function(e){return p(e.target.value)},onKeyPress:E,required:!0})),t().createElement("div",{className:"simple301redirects__managelinks__item__icon"},t().createElement("img",{width:"25",src:u+"assets/images/icon-arrow.svg",alt:"doc"})),t().createElement("div",{className:"simple301redirects__managelinks__item__destination"},t().createElement("textarea",{className:v&&""==m?"error":"",value:m,onChange:function(e){return h(e.target.value)},onKeyPress:E,rows:"1",required:!0}))),t().createElement("div",{className:"simple301redirects__managelinks__item__control"},a?t().createElement("button",{className:"simple301redirects__button primary__button",onClick:function(){return _("new")}},(0,o.__)("Add New","simple-301-redirects")):t().createElement(t().Fragment,null,t().createElement(A,{request:c}),t().createElement(L,{localClickHandler:_}),!d&&t().createElement("div",{className:"simple301redirects__button lock__button s3r-tooltip"},t().createElement("img",{width:"15",src:u+"assets/images/icon-lock.svg",alt:"local"}),t().createElement("span",null,(0,o.__)("3/1 CLICKS","simple-301-redirects")),t().createElement("div",{className:"s3r-tooltiptext-wrapper"},t().createElement("div",{className:"s3r-tooltiptext"},(0,o.__)("To see Analytics data","simple-301-redirects")," ",t().createElement(O,{label:(0,o.__)("Install BetterLinks","simple-301-redirects")})))),t().createElement("button",{className:"simple301redirects__icon__button delete__button",onClick:function(){return _("delete")}},t().createElement("img",{src:u+"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,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(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(r){var n=q((0,e.useState)({}),2),i=n[0],a=n[1];(0,e.useEffect)((function(){s().get(ajaxurl,{params:{action:"simple301redirects/admin/fetch_all_links",security:c}}).then((function(e){e.data&&a(e.data.data)}),(function(e){console.log(e)}))}),[]);var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"new"==e?u(t):"update"==e?f(t):"delete"==e&&m(t)},u=function(e){var t=new FormData;return t.append("action","simple301redirects/admin/create_new_link"),t.append("security",c),t.append("key",Object.keys(e)),t.append("value",Object.values(e)),s().post(ajaxurl,t).then((function(t){t.data&&a(F(F({},i),e))}),(function(e){console.log(e)}))},f=function(e){var t=q(Object.keys(e),1)[0],r=q(Object.values(e),2),n=r[0],i=r[1],o=new FormData;return o.append("action","simple301redirects/admin/update_link"),o.append("security",c),o.append("key",t),o.append("value",n),o.append("oldKey",i),s().post(ajaxurl,o).then((function(e){e.data&&setTimeout((function(){a(e.data.data)}),2e3)}),(function(e){console.log(e)}))},m=function(e){var t=q(Object.keys(e),1)[0],r=new FormData;return r.append("action","simple301redirects/admin/delete_link"),r.append("security",c),r.append("key",t),s().post(ajaxurl,r).then((function(e){e.data&&(delete i[t],a(F({},i)))}),(function(e){console.log(e)}))};return t().createElement(t().Fragment,null,t().createElement("div",{className:"simple301redirects__managelinks ".concat(d?"simple301redirects__managelinks--activated-btl":"")},t().createElement("div",{className:"simple301redirects__managelinks__info"},t().createElement("div",{className:"simple301redirects__managelinks__info__inner"},t().createElement("div",{className:"simple301redirects__managelinks__info__request"},t().createElement("h4",null,(0,o.__)("Request","simple-301-redirects")),t().createElement("p",null,"example: /old-page/")),t().createElement("div",{className:"simple301redirects__managelinks__info__destination"},t().createElement("h4",null,(0,o.__)("Destination","simple-301-redirects")),t().createElement("p",null,"example: ".concat(p,"new-page/"))))),Object.entries(i).map((function(e,r){var n=q(e,2),i=n[0],o=n[1];return t().createElement(I,{request:i,destination:o,clickHandler:l,key:r})})),t().createElement(I,{isNewLink:!0,clickHandler:l}),t().createElement(_,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 z(r){var n,i,a=(n=(0,e.useState)(f),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(n,i)||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}}(n,i)||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.")}()),l=a[0],p=a[1];return t().createElement(t().Fragment,null,!d&&!l&&t().createElement("div",{className:"simple301redirects__betterlinks"},t().createElement("button",{onClick:function(){var e=new FormData;return e.append("action","simple301redirects/admin/hide_notice"),e.append("security",c),e.append("hide",!0),s().post(ajaxurl,e).then((function(e){p(!0)}),(function(e){console.log(e)}))},className:"simple301redirects__betterlinks__close__button"},t().createElement("img",{width:"20",src:u+"assets/images/close.svg",alt:"logo"})),t().createElement("div",{className:"simple301redirects__betterlinks__content"},t().createElement("h3",null,(0,o.__)("BetterLinks – Shorten, Track and Manage any URL","simple-301-redirects")),t().createElement("h4",null,(0,o.__)("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"),t().createElement("img",{width:"18",style:{transform:"translateY(6px) scale(1.5)",marginLeft:8},src:u+"assets/images/pointing-down.svg",alt:"logo"})),t().createElement("ul",null,t().createElement("li",null,(0,o.__)("Easy-to-use & Simple Link Shortener","simple-301-redirects")),t().createElement("li",null,(0,o.__)("Create attractive looking links instantly","simple-301-redirects")),t().createElement("li",null,(0,o.__)("Safe Redirection URLs","simple-301-redirects")),t().createElement("li",null,(0,o.__)("Analyze and Track your marketing campaigns from one place","simple-301-redirects")),t().createElement("li",null,(0,o.__)("Optimized queries to reduce load time & make faster","simple-301-redirects")),t().createElement("li",null,(0,o.__)("Individual Analytics for each links","simple-301-redirects"))),t().createElement("h4",null,(0,o.__)("You can migrate from Simple 301 Redirects to BetterLinks within one click.","simple-301-redirects"))),t().createElement("div",{className:"simple301redirects__betterlinks__control"},t().createElement(O,{label:(0,o.__)("Install BetterLinks","simple-301-redirects")}))))}function J(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 $(r){var n,i,a=(n=(0,e.useState)(!1),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(n,i)||function(e,t){if(e){if("string"==typeof e)return J(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)?J(e,t):void 0}}(n,i)||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=a[0],l=a[1];return t().createElement(t().Fragment,null,t().createElement("div",{className:"simple301redirects__documentation"},t().createElement("div",{className:"simple301redirects__documentation__panel-header",onClick:function(){return l(!s)}},t().createElement("h4",null,t().createElement("img",{width:"25",src:u+"assets/images/icon-doc.svg",alt:"doc"})," Documentation"),t().createElement("button",null,t().createElement("span",{className:"dashicons dashicons-arrow-".concat(s?"up":"down","-alt2")}))),t().createElement("div",{className:"simple301redirects__documentation__panel-body"},s&&t().createElement("div",{className:"documentation"},t().createElement("h4",null,(0,o.__)("Simple Redirects","simple-301-redirects")),t().createElement("p",null,(0,o.__)("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")),t().createElement("h5",null,(0,o.__)("Example","simple-301-redirects")),t().createElement("ul",null,t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Request: ","simple-301-redirects")),(0,o.__)("/old-page/","simple-301-redirects")),t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Destination: ","simple-301-redirects"))," ",(0,o.__)("/new-page/","simple-301-redirects"))),t().createElement("h4",null,(0,o.__)("Wildcards","simple-301-redirects")),t().createElement("p",null,(0,o.__)("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")),t().createElement("h5",null,(0,o.__)("Example","simple-301-redirects")),t().createElement("ul",null,t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Request: ","simple-301-redirects")),(0,o.__)("/old-folder/*","simple-301-redirects")),t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Destination: ","simple-301-redirects"))," ",(0,o.__)("/new-folder/* ","simple-301-redirects"))),t().createElement("p",null,(0,o.__)("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")),t().createElement("h5",null,(0,o.__)("Example","simple-301-redirects")),t().createElement("ul",null,t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Request: ","simple-301-redirects")),(0,o.__)("/old-folder/*","simple-301-redirects")),t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Destination: ","simple-301-redirects"))," ",(0,o.__)("/new-page/","simple-301-redirects"))),t().createElement("p",null,(0,o.__)("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")),t().createElement("h5",null,(0,o.__)("Example","simple-301-redirects")),t().createElement("ul",null,t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Request:","simple-301-redirects")),(0,o.__)("/old-folder/*","simple-301-redirects")),t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Destination:","simple-301-redirects"))," ",(0,o.__)("/some/other/folder/*","simple-301-redirects"))),t().createElement("p",null,"Or:"),t().createElement("ul",null,t().createElement("li",null,t().createElement("strong",null,(0,o.__)("/some/other/folder/*","simple-301-redirects"))," ",(0,o.__)("/old-folder/*/content/","simple-301-redirects")),t().createElement("li",null,t().createElement("strong",null,(0,o.__)("Destination:","simple-301-redirects"))," ",(0,o.__)("/some/other/folder/*","simple-301-redirects")))))))}function G(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,i,o=[],_n=!0,a=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);_n=!0);}catch(e){a=!0,i=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw i}}return o}}(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 W(r){var n=G((0,e.useState)(!1),2),i=(n[0],n[1],G((0,e.useState)(!1),2)),a=i[0],l=i[1];return(0,e.useEffect)((function(){"true"==new URLSearchParams(window.location.search).get("isImport")&&s().post("".concat(ajaxurl,"?action=simple301redirects/admin/get_import_info&security=").concat(c)).then((function(e){l(e.data.data)}),(function(e){console.log(e)}))}),[]),t().createElement(t().Fragment,null,t().createElement("div",{className:"simple301redirects__panel__divider"},t().createElement("div",{className:"simple301redirects__import"},t().createElement("div",{className:"simple301redirects__import__head"},t().createElement("h4",null,(0,o.__)("Import Redirect Rules","simple-301-redirects")),t().createElement("p",null,(0,o.__)("Import your 301 Redirect Links from your Device","simple-301-redirects"))),t().createElement("form",{action:"admin.php?page=301options&isImport=true",method:"POST",encType:"multipart/form-data"},t().createElement("div",{role:"group",className:"simple301redirects-button-group","aria-labelledby":"my-radio-group"},t().createElement("input",{type:"hidden",name:"import",value:!0}),t().createElement("input",{type:"hidden",name:"security",value:c}),t().createElement("input",{type:"file",id:"upload_file",name:"upload_file",size:"25"}),t().createElement("input",{type:"submit",name:"submit",id:"submit",className:"button button-primary",style:{marginTop:10},value:(0,o.__)("Import File","simple-301-redirects"),disabled:""})),a&&t().createElement("p",null,t().createElement("strong",null,a.replace(/"|"/g,""))))),t().createElement("div",{className:"simple301redirects__export"},t().createElement("div",{className:"simple301redirects__export__head"},t().createElement("h4",null,(0,o.__)("Export Redirect Rules","simple-301-redirects")),t().createElement("p",null,(0,o.__)("Export your 301 Redirect Links in .csv format","simple-301-redirects"))),t().createElement("form",{action:"admin.php?page=301options",method:"POST"},t().createElement("input",{type:"hidden",name:"export",value:!0}),t().createElement("input",{type:"hidden",name:"security",value:c}),t().createElement("div",{className:"simple301redirects-button-group"},t().createElement("button",{type:"submit",className:"btl-export-download-button"},(0,o.__)("Export File","simple-301-redirects")))))))}function K(e){return t().createElement(t().Fragment,null,t().createElement(y,null),t().createElement("div",{className:"Simple301Redirects__content__wrapper"},t().createElement("div",{className:"Simple301Redirects__main__content"},t().createElement(M,null),t().createElement(z,null)),t().createElement("div",{className:"Simple301Redirects__archive__sidebar"},t().createElement(W,null),t().createElement($,null))))}I.propTypes=P,I.defaultProps={request:"",destination:"",isNewLink:!1},M.propTypes={},M.defaultProps={},z.propTypes={},z.defaultProps={},$.propTypes={},$.defaultProps={},W.propTypes={},W.defaultProps={},K.propTypes={},K.defaultProps={},document.addEventListener("DOMContentLoaded",(function(){i().render(t().createElement(K,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
File without changes
includes/Admin/WPDev/PluginUsageTracker.php CHANGED
File without changes
includes/Helper.php CHANGED
File without changes
includes/Installer.php CHANGED
File without changes
languages/simple-301-redirects.pot CHANGED
File without changes
readme.txt CHANGED
@@ -1,167 +1,171 @@
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
-
11
- Simple 301 Redirects provides an easy method of redirecting requests to another page on your site or elsewhere on the web.
12
-
13
- == Description ==
14
-
15
- = Improve Your User Experience With Simple 301 Redirects Solution for WordPress =
16
-
17
- Got "404 not found" errors? Launching a marketing campaign with a new URL? Or relaunching your website with a new URL? Let's redirect your old URLs to new ones automatically by creating 301 redirects to existing pages.
18
-
19
- Simple 301 Redirects provides an easy method of redirecting requests to another page on your site or elsewhere on the web. It's especially handy when you migrate a site to WordPress and can't preserve your URL structure.
20
-
21
- By setting up 301 redirects from your old pages to your new pages, any incoming links will be seamlessly passed along, and their page rank (or what-have-you) will be passed along with them.
22
-
23
- ## ⭐ FEATURES OF SIMPLE 301 REDIRECTS:
24
-
25
- ◾With this plugin, you can check and redirect your old URLs to the new ones with few easy steps
26
- **◾** Designed for any websites with very easy and user friendly interface which you can set up in few seconds
27
-
28
- ◾Works great eCommerce, blog, magazine, small business and any others websites
29
-
30
- ## 🔰 MANAGE YOUR LINKS WITH SIMPLE 301 REDIRECTS:
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
-
38
- - Request: /old-folder/\*
39
- - Destination: /new-folder/\*
40
-
41
- ◾ **Friendly Support:** Get super friendly community support as we have an extraordinary support team ready to help you. Ask your questions in the support forum &amp; someone from our team will help you
42
-
43
- ## 🏆 Featured by Renowned WordPress Publications
44
-
45
- Simple 301 Redirects has been loved by lots of users, website owners, bloggers and marketers:
46
-
47
- 🌟[Peakplex](https://peakplex.com/blog/use-simple-301-redirects-plugin/)
48
-
49
- "The plugin's name could not be better. It really is simple to do 301 redirects. For example, if you modify the URL of one of your pages, then you can take the old URL and redirect it to the new one. Not only can this keep some SEO value, but it's good for user experience as well."
50
-
51
- 🌟[WPKube](https://www.wpkube.com/add-301-redirects-wordpress/)
52
-
53
- "I like this plugin because: You can quickly create 301 redirects without leaving your WordPress dashboard. It makes it much easier to manage your existing 301 redirects. It's just plain easier for beginners than digging around the .htaccess file."
54
-
55
- **THIS PLUGIN IS MAINTAINED BY THE TEAM** [WPDeveloper](https://wpdeveloper.net/).
56
-
57
- ## 🎁 [FREEBIE] Handful Plugins To Improve Your WordPress Site
58
-
59
- If you like Simple 301 Redirects, then consider checking out our other WordPress Plugins &amp; take your website to next level:
60
-
61
- 🔝[**Essential Addons For Elementor**](https://wordpress.org/plugins/essential-addons-for-elementor-lite/)– Most popular Elementor addons with 1 million active users in the WordPress repository.
62
-
63
- 🔔[**NotificationX**](https://wordpress.org/plugins/notificationx/)– Best Social Proof &amp; FOMO Marketing Solution to increase conversion rates.
64
-
65
- 📝[**BetterDocs**](https://wordpress.org/plugins/betterdocs)– Best Documentation &amp; Knowledge Base Plugin for WordPress, which also reduces your manual support request.
66
-
67
- 🛑[**Disable Comments**](https://wordpress.org/plugins/disable-comments/) - Instantly allow or disallow comments from any post type in WordPress and gain complete control over your full website.
68
-
69
- ♾️[**EmbedPress**](https://wordpress.org/plugins/embedpress/) - EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click to showcase it beautifully for the visitors.
70
-
71
- ☁️[**Templately**](https://wordpress.org/plugins/templately/) - Free templates library for Elementor &amp; Gutenberg along with the cloud collaboration for WordPress.
72
-
73
- ⏰ [**WP Scheduled Posts**](https://wordpress.org/plugins/wp-scheduled-posts/): Advanced editorial calendar & complete solution for WordPress Post Scheduling, social sharing, missed scheduled alerts and more.
74
-
75
- ⭐[**ReviewX**](https://wordpress.org/plugins/reviewx/) - WooCommerce Product review plugin that allows users to submit product reviews with multiple criteria, photos, video and more.
76
-
77
- ⚡ [**Flexia**](http://wordpress.org/plugins/flexia): Most lightweight, customizable & multi purpose theme for WordPress.
78
-
79
- ### 💙 LOVED SIMPLE 301 REDIRECTS?
80
-
81
- - Join our [Facebook Group](https://www.facebook.com/groups/wpdeveloper.net/)
82
-
83
- - If you love Simple 301 Redirects, [rate us on WordPress](https://wordpress.org/support/plugin/simple-301-redirects/reviews/?filter=5)
84
-
85
- Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
86
-
87
-
88
- == Installation ==
89
-
90
- 1. Upload Simple 301 Redirects to the `/wp-content/plugins/` directory
91
- 1. Activate the plugin through the 'Plugins' menu in WordPress
92
- 1. Add redirects on the Settings > 301 Redirects page.
93
-
94
-
95
- == Screenshots ==
96
-
97
- 1. Simple 301 Redirects - Dashboard
98
- 2. Simple 301 Redirects - Setup
99
-
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
110
- * Few minor bug fix and improvements
111
-
112
- = 2.0.4 - 05/05/2021 =
113
- * Improved: User role capabilities check in Ajax requests for security enhancements
114
- * Few minor bug fix and improvements
115
-
116
- = 2.0.3 - 18/04/2021 =
117
- * Fixed: Redirects fail with trailing slash in the Request URL
118
- * Improved: Import/Export feature for security enhancements
119
- * Few minor bug fix and improvements
120
-
121
- = 2.0.2 - 15/04/2021 =
122
- * Fixed: Link Redirection not working when Shortend URL is shared on Facebook
123
- * Fixed: Destination URL not fully visible on smaller devices
124
- * Improved: Coding structure to enhance security
125
- * Few minor bug fix and improvements
126
-
127
- = 2.0.1 - 07/04/2021 =
128
- * Few minor bug fix and improvements
129
-
130
- = 2.0.0 - 01/04/2021 =
131
- * Revamped: New UI/UX
132
- * Added: Support for WordPress 5.7
133
- * Added: Options to Export/Import Links
134
- * Few minor bug fix and improvements
135
-
136
- = 1.07 =
137
- * Security Update - Better handling of posted data.
138
-
139
- = 1.06 =
140
- * Security Updates - Special thanks to Ryan Hellyer!
141
-
142
- = 1.05 =
143
- * Wildcard support
144
- * Delete functiontionality
145
- * On-page documentation
146
-
147
- = 1.04 =
148
- * Removed deprecated function calls
149
- * Updated code to better match WordPress coding standards
150
- * Updated handling of https protocol to prevent errors in certain server configurations
151
- * Better support for destinations that start with a leading slash instead of the full domain
152
-
153
- = 1.03 =
154
- * Sorry for the double update. I forgot to check for PHP4 compatibility. Many people are still using PHP4, apparently, so this update is to fix compatibility with these legacy systems.
155
-
156
- = 1.02 =
157
- * Added support for special characters in non-english URLs.
158
- * Fixed a case sensitivity bug.
159
-
160
- = 1.01 =
161
- * Updated redirect method to send headers directly rather than using wp_redirect() because it was sending 302 codes on some servers
162
-
163
- = 1.0 =
164
- * Initial Release
165
-
166
- == Upgrade Notice ==
167
- [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.1
6
+ Requires PHP: 5.4
7
+ Stable tag: 2.0.7
8
+ License: GPL-3.0-or-later
9
+ License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ Simple 301 Redirects provides an easy method of redirecting requests to another page on your site or elsewhere on the web.
12
+
13
+ == Description ==
14
+
15
+ = Improve Your User Experience With Simple 301 Redirects Solution for WordPress =
16
+
17
+ Got "404 not found" errors? Launching a marketing campaign with a new URL? Or relaunching your website with a new URL? Let's redirect your old URLs to new ones automatically by creating 301 redirects to existing pages.
18
+
19
+ Simple 301 Redirects provides an easy method of redirecting requests to another page on your site or elsewhere on the web. It's especially handy when you migrate a site to WordPress and can't preserve your URL structure.
20
+
21
+ By setting up 301 redirects from your old pages to your new pages, any incoming links will be seamlessly passed along, and their page rank (or what-have-you) will be passed along with them.
22
+
23
+ ## ⭐ FEATURES OF SIMPLE 301 REDIRECTS:
24
+
25
+ ◾With this plugin, you can check and redirect your old URLs to the new ones with few easy steps
26
+ **◾** Designed for any websites with very easy and user friendly interface which you can set up in few seconds
27
+
28
+ ◾Works great eCommerce, blog, magazine, small business and any others websites
29
+
30
+ ## 🔰 MANAGE YOUR LINKS WITH SIMPLE 301 REDIRECTS:
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
+
38
+ - Request: /old-folder/\*
39
+ - Destination: /new-folder/\*
40
+
41
+ ◾ **Friendly Support:** Get super friendly community support as we have an extraordinary support team ready to help you. Ask your questions in the support forum &amp; someone from our team will help you
42
+
43
+ ## 🏆 Featured by Renowned WordPress Publications
44
+
45
+ Simple 301 Redirects has been loved by lots of users, website owners, bloggers and marketers:
46
+
47
+ 🌟[Peakplex](https://peakplex.com/blog/use-simple-301-redirects-plugin/)
48
+
49
+ "The plugin's name could not be better. It really is simple to do 301 redirects. For example, if you modify the URL of one of your pages, then you can take the old URL and redirect it to the new one. Not only can this keep some SEO value, but it's good for user experience as well."
50
+
51
+ 🌟[WPKube](https://www.wpkube.com/add-301-redirects-wordpress/)
52
+
53
+ "I like this plugin because: You can quickly create 301 redirects without leaving your WordPress dashboard. It makes it much easier to manage your existing 301 redirects. It's just plain easier for beginners than digging around the .htaccess file."
54
+
55
+ **THIS PLUGIN IS MAINTAINED BY THE TEAM** [WPDeveloper](https://wpdeveloper.net/).
56
+
57
+ ## 🎁 [FREEBIE] Handful Plugins To Improve Your WordPress Site
58
+
59
+ If you like Simple 301 Redirects, then consider checking out our other WordPress Plugins &amp; take your website to next level:
60
+
61
+ 🔝[**Essential Addons For Elementor**](https://wordpress.org/plugins/essential-addons-for-elementor-lite/)– Most popular Elementor addons with 1 million active users in the WordPress repository.
62
+
63
+ 🔔[**NotificationX**](https://wordpress.org/plugins/notificationx/)– Best Social Proof &amp; FOMO Marketing Solution to increase conversion rates.
64
+
65
+ 📝[**BetterDocs**](https://wordpress.org/plugins/betterdocs)– Best Documentation &amp; Knowledge Base Plugin for WordPress, which also reduces your manual support request.
66
+
67
+ 🛑[**Disable Comments**](https://wordpress.org/plugins/disable-comments/) - Instantly allow or disallow comments from any post type in WordPress and gain complete control over your full website.
68
+
69
+ ♾️[**EmbedPress**](https://wordpress.org/plugins/embedpress/) - EmbedPress lets you embed videos, images, posts, audio, maps and all other types of content into your WordPress site with one-click to showcase it beautifully for the visitors.
70
+
71
+ ☁️[**Templately**](https://wordpress.org/plugins/templately/) - Free templates library for Elementor &amp; Gutenberg along with the cloud collaboration for WordPress.
72
+
73
+ ⏰ [**WP Scheduled Posts**](https://wordpress.org/plugins/wp-scheduled-posts/): Advanced editorial calendar & complete solution for WordPress Post Scheduling, social sharing, missed scheduled alerts and more.
74
+
75
+ ⭐[**ReviewX**](https://wordpress.org/plugins/reviewx/) - WooCommerce Product review plugin that allows users to submit product reviews with multiple criteria, photos, video and more.
76
+
77
+ ⚡ [**Flexia**](http://wordpress.org/plugins/flexia): Most lightweight, customizable & multi purpose theme for WordPress.
78
+
79
+ ### 💙 LOVED SIMPLE 301 REDIRECTS?
80
+
81
+ - Join our [Facebook Group](https://www.facebook.com/groups/wpdeveloper.net/)
82
+
83
+ - If you love Simple 301 Redirects, [rate us on WordPress](https://wordpress.org/support/plugin/simple-301-redirects/reviews/?filter=5)
84
+
85
+ Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
86
+
87
+
88
+ == Installation ==
89
+
90
+ 1. Upload Simple 301 Redirects to the `/wp-content/plugins/` directory
91
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
92
+ 1. Add redirects on the Settings > 301 Redirects page.
93
+
94
+
95
+ == Screenshots ==
96
+
97
+ 1. Simple 301 Redirects - Dashboard
98
+ 2. Simple 301 Redirects - Setup
99
+
100
+
101
+ == Changelog ==
102
+
103
+ = 2.0.7 - 13/09/2022 =
104
+ * Fixed: WP-CLI issue.
105
+ * Few minor bug fix and improvements
106
+
107
+ = 2.0.6 - 19/10/2021 =
108
+ * Added: CSV Import/Export option
109
+ * Few minor bug fix and improvements
110
+
111
+ = 2.0.5 - 08/07/2021 =
112
+ * Fixed: Http mixed content issue
113
+ * Added: AJAX Support in place of REST API
114
+ * Few minor bug fix and improvements
115
+
116
+ = 2.0.4 - 05/05/2021 =
117
+ * Improved: User role capabilities check in Ajax requests for security enhancements
118
+ * Few minor bug fix and improvements
119
+
120
+ = 2.0.3 - 18/04/2021 =
121
+ * Fixed: Redirects fail with trailing slash in the Request URL
122
+ * Improved: Import/Export feature for security enhancements
123
+ * Few minor bug fix and improvements
124
+
125
+ = 2.0.2 - 15/04/2021 =
126
+ * Fixed: Link Redirection not working when Shortend URL is shared on Facebook
127
+ * Fixed: Destination URL not fully visible on smaller devices
128
+ * Improved: Coding structure to enhance security
129
+ * Few minor bug fix and improvements
130
+
131
+ = 2.0.1 - 07/04/2021 =
132
+ * Few minor bug fix and improvements
133
+
134
+ = 2.0.0 - 01/04/2021 =
135
+ * Revamped: New UI/UX
136
+ * Added: Support for WordPress 5.7
137
+ * Added: Options to Export/Import Links
138
+ * Few minor bug fix and improvements
139
+
140
+ = 1.07 =
141
+ * Security Update - Better handling of posted data.
142
+
143
+ = 1.06 =
144
+ * Security Updates - Special thanks to Ryan Hellyer!
145
+
146
+ = 1.05 =
147
+ * Wildcard support
148
+ * Delete functiontionality
149
+ * On-page documentation
150
+
151
+ = 1.04 =
152
+ * Removed deprecated function calls
153
+ * Updated code to better match WordPress coding standards
154
+ * Updated handling of https protocol to prevent errors in certain server configurations
155
+ * Better support for destinations that start with a leading slash instead of the full domain
156
+
157
+ = 1.03 =
158
+ * Sorry for the double update. I forgot to check for PHP4 compatibility. Many people are still using PHP4, apparently, so this update is to fix compatibility with these legacy systems.
159
+
160
+ = 1.02 =
161
+ * Added support for special characters in non-english URLs.
162
+ * Fixed a case sensitivity bug.
163
+
164
+ = 1.01 =
165
+ * Updated redirect method to send headers directly rather than using wp_redirect() because it was sending 302 codes on some servers
166
+
167
+ = 1.0 =
168
+ * Initial Release
169
+
170
+ == Upgrade Notice ==
171
+ [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
@@ -1,200 +1,203 @@
1
- <?php
2
- /**
3
- * Plugin Name: Simple 301 Redirects
4
- * Plugin URI: https://wordpress.org/plugins/simple-301-redirects/
5
- * Description: Create a list of URLs that you would like to 301 redirect to another page or site. Now with wildcard support.
6
- * Author: WPDeveloper
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
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
- */
29
-
30
- if (!defined('ABSPATH')) {
31
- exit();
32
- }
33
-
34
- if (file_exists(dirname(__FILE__) . '/vendor/autoload.php')) {
35
- require_once dirname(__FILE__) . '/vendor/autoload.php';
36
- }
37
-
38
-
39
- if (!class_exists("Simple301redirects")) {
40
-
41
- final class Simple301Redirects {
42
-
43
- private function __construct()
44
- {
45
- $this->define_constants();
46
- add_action('plugins_loaded', [$this, 'on_plugins_loaded']);
47
- add_action('simple301redirects_loaded', [$this, 'init_plugin']);
48
- // add the redirect action, high priority
49
- add_action('init', array($this,'redirect'), 1);
50
- }
51
- public static function init()
52
- {
53
- static $instance = false;
54
-
55
- if (!$instance) {
56
- $instance = new self();
57
- }
58
-
59
- return $instance;
60
- }
61
-
62
- public function on_plugins_loaded()
63
- {
64
- do_action('simple301redirects_loaded');
65
- }
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__));
73
- define('SIMPLE301REDIRECTS_PLUGIN_SLUG', 'simple-301-redirects');
74
- define('SIMPLE301REDIRECTS_PLUGIN_ROOT_URI', plugins_url('/', __FILE__));
75
- define('SIMPLE301REDIRECTS_ROOT_DIR_PATH', plugin_dir_path(__FILE__));
76
- define('SIMPLE301REDIRECTS_ASSETS_DIR_PATH', SIMPLE301REDIRECTS_ROOT_DIR_PATH . 'assets/');
77
- define('SIMPLE301REDIRECTS_ASSETS_URI', SIMPLE301REDIRECTS_PLUGIN_ROOT_URI . 'assets/');
78
- }
79
-
80
- /**
81
- * Initialize the plugin
82
- *
83
- * @return void
84
- */
85
- public function init_plugin()
86
- {
87
- $this->load_textdomain();
88
- if (is_admin()) {
89
- new Simple301Redirects\Admin();
90
- }
91
- $this->load_installer();
92
- }
93
-
94
- public function load_textdomain()
95
- {
96
- load_plugin_textdomain('simple-301-redirects', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages/');
97
- }
98
- public function load_installer()
99
- {
100
- $Installer = new Simple301Redirects\Installer();
101
- $Installer->migrate();
102
- }
103
- /**
104
- * redirect function
105
- * Read the list of redirects and if the current page
106
- * is found in the list, send the visitor on her way
107
- * @access public
108
- * @return void
109
- */
110
- public function redirect() {
111
- // this is what the user asked for (strip out home portion, case insensitive)
112
- $userrequest = \Simple301Redirects\Helper::str_ireplace(get_option('home'),'',$this->get_address());
113
- $userrequest = ltrim($userrequest, parse_url(site_url(), PHP_URL_PATH));
114
- $param = explode('?', $userrequest, 2);
115
- $userrequest = current($param);
116
-
117
- $redirects = get_option('301_redirects');
118
- if (!empty($redirects)) {
119
-
120
- $wildcard = get_option('301_redirects_wildcard');
121
- $do_redirect = '';
122
-
123
- // compare user request to each 301 stored in the db
124
- foreach ($redirects as $storedrequest => $destination) {
125
- // check if we should use regex search
126
- if ($wildcard === 'true' && strpos($storedrequest,'*') !== false) {
127
- // wildcard redirect
128
-
129
- // don't allow people to accidentally lock themselves out of admin
130
- if ( strpos($userrequest, '/wp-login') !== 0 && strpos($userrequest, '/wp-admin') !== 0 ) {
131
- // Make sure it gets all the proper decoding and rtrim action
132
- $storedrequest = str_replace('*','(.*)',$storedrequest);
133
- $pattern = '/^' . str_replace( '/', '\/', rtrim( $storedrequest, '/' ) ) . '/';
134
- $destination = str_replace('*','$1',$destination);
135
- $output = preg_replace($pattern, $destination, $userrequest);
136
- if ($output !== $userrequest) {
137
- // pattern matched, perform redirect
138
- $do_redirect = $output;
139
- }
140
- }
141
- }elseif(urldecode(trim($userrequest, '/')) == trim($storedrequest,'/')){
142
- // simple comparison redirect
143
- $do_redirect = $destination;
144
- }
145
-
146
- // redirect. the second condition here prevents redirect loops as a result of wildcards.
147
- if ($do_redirect !== '' && trim($do_redirect,'/') !== trim($userrequest,'/')) {
148
- // check if destination needs the domain prepended
149
- if (strpos($do_redirect,'/') === 0){
150
- $do_redirect = home_url().$do_redirect;
151
- }
152
- header ('HTTP/1.1 301 Moved Permanently');
153
- header ('Location: ' . $do_redirect);
154
- exit();
155
- }
156
- else { unset($redirects); }
157
- }
158
- }
159
- } // end funcion redirect
160
-
161
- /**
162
- * getAddress function
163
- * utility function to get the full address of the current request
164
- * credit: http://www.phpro.org/examples/Get-Full-URL.html
165
- * @access public
166
- * @return void
167
- */
168
- public function get_address() {
169
- // return the full address
170
- return $this->get_protocol().'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
171
- } // end function get_address
172
-
173
- public function get_protocol() {
174
- // Set the base protocol to http
175
- $protocol = 'http';
176
- // check for https
177
- if ( isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on" ) {
178
- $protocol .= "s";
179
- }
180
-
181
- return $protocol;
182
- } // end function get_protocol
183
- }
184
- }
185
-
186
-
187
- /**
188
- * Initializes the main plugin
189
- *
190
- * @return \Simple301Redirects
191
- */
192
- if (!function_exists('Simple301Redirects_Start')) {
193
- function Simple301Redirects_Start()
194
- {
195
- return Simple301Redirects::init();
196
- }
197
- }
198
-
199
- // Plugin Start
 
 
 
200
  Simple301Redirects_Start();
1
+ <?php
2
+ /**
3
+ * Plugin Name: Simple 301 Redirects
4
+ * Plugin URI: https://wordpress.org/plugins/simple-301-redirects/
5
+ * Description: Create a list of URLs that you would like to 301 redirect to another page or site. Now with wildcard support.
6
+ * Author: WPDeveloper
7
+ * Author URI: https://wpdeveloper.net/
8
+ * Text Domain: simple-301-redirects
9
+ * Domain Path: /languages
10
+ * Version: 2.0.7
11
+ */
12
+
13
+ /* Copyright 2009-2021 WPDeveloper
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
+ */
29
+
30
+ if (!defined('ABSPATH')) {
31
+ exit();
32
+ }
33
+
34
+ if (file_exists(dirname(__FILE__) . '/vendor/autoload.php')) {
35
+ require_once dirname(__FILE__) . '/vendor/autoload.php';
36
+ }
37
+
38
+
39
+ if (!class_exists("Simple301redirects")) {
40
+
41
+ final class Simple301Redirects {
42
+
43
+ private function __construct()
44
+ {
45
+ $this->define_constants();
46
+ add_action('plugins_loaded', [$this, 'on_plugins_loaded']);
47
+
48
+ if( ! defined('WP_CLI') || ( defined('WP_CLI') && ! WP_CLI ) ) {
49
+ add_action('simple301redirects_loaded', [$this, 'init_plugin']);
50
+ // add the redirect action, high priority
51
+ add_action('init', array($this,'redirect'), 1);
52
+ }
53
+ }
54
+ public static function init()
55
+ {
56
+ static $instance = false;
57
+
58
+ if (!$instance) {
59
+ $instance = new self();
60
+ }
61
+
62
+ return $instance;
63
+ }
64
+
65
+ public function on_plugins_loaded()
66
+ {
67
+ do_action('simple301redirects_loaded');
68
+ }
69
+
70
+ public function define_constants()
71
+ {
72
+ define('SIMPLE301REDIRECTS_VERSION', '2.0.7');
73
+ define('SIMPLE301REDIRECTS_SETTINGS_NAME', '301_redirects');
74
+ define('SIMPLE301REDIRECTS_PLUGIN_FILE', __FILE__);
75
+ define('SIMPLE301REDIRECTS_PLUGIN_BASENAME', plugin_basename(__FILE__));
76
+ define('SIMPLE301REDIRECTS_PLUGIN_SLUG', 'simple-301-redirects');
77
+ define('SIMPLE301REDIRECTS_PLUGIN_ROOT_URI', plugins_url('/', __FILE__));
78
+ define('SIMPLE301REDIRECTS_ROOT_DIR_PATH', plugin_dir_path(__FILE__));
79
+ define('SIMPLE301REDIRECTS_ASSETS_DIR_PATH', SIMPLE301REDIRECTS_ROOT_DIR_PATH . 'assets/');
80
+ define('SIMPLE301REDIRECTS_ASSETS_URI', SIMPLE301REDIRECTS_PLUGIN_ROOT_URI . 'assets/');
81
+ }
82
+
83
+ /**
84
+ * Initialize the plugin
85
+ *
86
+ * @return void
87
+ */
88
+ public function init_plugin()
89
+ {
90
+ $this->load_textdomain();
91
+ if (is_admin()) {
92
+ new Simple301Redirects\Admin();
93
+ }
94
+ $this->load_installer();
95
+ }
96
+
97
+ public function load_textdomain()
98
+ {
99
+ load_plugin_textdomain('simple-301-redirects', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages/');
100
+ }
101
+ public function load_installer()
102
+ {
103
+ $Installer = new Simple301Redirects\Installer();
104
+ $Installer->migrate();
105
+ }
106
+ /**
107
+ * redirect function
108
+ * Read the list of redirects and if the current page
109
+ * is found in the list, send the visitor on her way
110
+ * @access public
111
+ * @return void
112
+ */
113
+ public function redirect() {
114
+ // this is what the user asked for (strip out home portion, case insensitive)
115
+
116
+ $redirects = get_option('301_redirects');
117
+ if (!empty($redirects)) {
118
+ $userrequest = \Simple301Redirects\Helper::str_ireplace(get_option('home'),'',$this->get_address());
119
+ $userrequest = ltrim($userrequest);
120
+ $param = explode('?', $userrequest, 2);
121
+ $userrequest = current($param);
122
+
123
+ $wildcard = get_option('301_redirects_wildcard');
124
+ $do_redirect = '';
125
+
126
+ // compare user request to each 301 stored in the db
127
+ foreach ($redirects as $storedrequest => $destination) {
128
+ // check if we should use regex search
129
+ if ($wildcard === 'true' && strpos($storedrequest,'*') !== false) {
130
+ // wildcard redirect
131
+
132
+ // don't allow people to accidentally lock themselves out of admin
133
+ if ( strpos($userrequest, '/wp-login') !== 0 && strpos($userrequest, '/wp-admin') !== 0 ) {
134
+ // Make sure it gets all the proper decoding and rtrim action
135
+ $storedrequest = str_replace('*','(.*)',$storedrequest);
136
+ $pattern = '/^' . str_replace( '/', '\/', rtrim( $storedrequest, '/' ) ) . '/';
137
+ $destination = str_replace('*','$1',$destination);
138
+ $output = preg_replace($pattern, $destination, $userrequest);
139
+ if ($output !== $userrequest) {
140
+ // pattern matched, perform redirect
141
+ $do_redirect = $output;
142
+ }
143
+ }
144
+ }elseif(urldecode(trim($userrequest, '/')) == trim($storedrequest,'/')){
145
+ // simple comparison redirect
146
+ $do_redirect = $destination;
147
+ }
148
+
149
+ // redirect. the second condition here prevents redirect loops as a result of wildcards.
150
+ if ($do_redirect !== '' && trim($do_redirect,'/') !== trim($userrequest,'/')) {
151
+ // check if destination needs the domain prepended
152
+ if (strpos($do_redirect,'/') === 0){
153
+ $do_redirect = home_url().$do_redirect;
154
+ }
155
+ header ('HTTP/1.1 301 Moved Permanently');
156
+ header ('Location: ' . $do_redirect);
157
+ exit();
158
+ }
159
+ else { unset($redirects); }
160
+ }
161
+ }
162
+ } // end funcion redirect
163
+
164
+ /**
165
+ * getAddress function
166
+ * utility function to get the full address of the current request
167
+ * credit: http://www.phpro.org/examples/Get-Full-URL.html
168
+ * @access public
169
+ * @return void
170
+ */
171
+ public function get_address() {
172
+ // return the full address
173
+ return $this->get_protocol().'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
174
+ } // end function get_address
175
+
176
+ public function get_protocol() {
177
+ // Set the base protocol to http
178
+ $protocol = 'http';
179
+ // check for https
180
+ if ( isset( $_SERVER["HTTPS"] ) && strtolower( $_SERVER["HTTPS"] ) == "on" ) {
181
+ $protocol .= "s";
182
+ }
183
+
184
+ return $protocol;
185
+ } // end function get_protocol
186
+ }
187
+ }
188
+
189
+
190
+ /**
191
+ * Initializes the main plugin
192
+ *
193
+ * @return \Simple301Redirects
194
+ */
195
+ if (!function_exists('Simple301Redirects_Start')) {
196
+ function Simple301Redirects_Start()
197
+ {
198
+ return Simple301Redirects::init();
199
+ }
200
+ }
201
+
202
+ // Plugin Start
203
  Simple301Redirects_Start();