Version Description
- 2021-10-12 =
- Added default rule for new shipping method
- Added support for Onboarding in FS PRO
Download this release
Release Info
Developer | wpdesk |
Plugin | Flexible Shipping for WooCommerce |
Version | 4.9.0 |
Comparing to | |
See all releases |
Code changes from version 4.8.5 to 4.9.0
- assets/js/onboarding.js +1 -1
- classes/class-flexible-shipping-plugin.php +31 -16
- flexible-shipping.php +4 -4
- lang/flexible-shipping.pot +32 -32
- readme.txt +5 -1
- src/WPDesk/FS/Helpers/FlexibleShippingMethodsChecker.php +34 -0
- src/WPDesk/FS/Helpers/WooSettingsPageChecker.php +65 -0
- src/WPDesk/FS/Onboarding/TableRate/FinishOption.php +7 -7
- src/WPDesk/FS/Onboarding/TableRate/Onboarding.php +51 -104
- src/WPDesk/FS/Onboarding/TableRate/OptionAjaxUpdater.php +20 -9
- src/WPDesk/FS/Onboarding/TableRate/PopupData.php +60 -60
- src/WPDesk/FS/Onboarding/TableRate/Tracker.php +4 -3
- src/WPDesk/FS/TableRate/DefaultRulesSettings.php +16 -3
- src/WPDesk/FS/TableRate/Rule/Condition/None.php +4 -3
- src/WPDesk/FS/TableRate/ShippingMethodSingle.php +3 -2
- src/WPDesk/FS/TableRate/views/shipping-method-settings-rules.php +13 -13
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +2 -0
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +7 -5
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/FormContentRenderer.php +6 -2
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/PluginsPageRenderer.php +7 -4
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/Renderer.php +7 -4
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/views/activation-form.php +4 -5
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/views/plugins-page-row.php +6 -7
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php +13 -13
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php +2 -2
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-plugin-update.php +12 -12
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/license-actions.php +9 -9
- vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/licenses.php +2 -2
assets/js/onboarding.js
CHANGED
@@ -32,4 +32,4 @@ object-assign
|
|
32 |
*
|
33 |
* This source code is licensed under the MIT license found in the
|
34 |
* LICENSE file in the root directory of this source tree.
|
35 |
-
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},a=function(e,t){c=setTimeout(e,t)},o=function(){clearTimeout(c)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){window.cancelAnimationFrame;window.requestAnimationFrame}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var v=p.now();t.unstable_now=function(){return p.now()-v}}var g=!1,y=null,b=-1,E=5,w=0;i=function(){return t.unstable_now()>=w},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e||(E=0<e?Math.floor(1e3/e):5)};var k=new MessageChannel,x=k.port2;k.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();w=e+E;try{y(!0,e)?x.postMessage(null):(g=!1,y=null)}catch(e){throw x.postMessage(null),e}}else g=!1},r=function(e){y=e,g||(g=!0,x.postMessage(null))},a=function(e,n){b=m((function(){e(t.unstable_now())}),n)},o=function(){h(b),b=-1}}function T(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<_(a,t)))break e;e[r]=t,e[n]=a,n=r}}function S(e){return void 0===(e=e[0])?null:e}function C(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,u=e[l];if(void 0!==i&&0>_(i,n))void 0!==u&&0>_(u,i)?(e[r]=u,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==u&&0>_(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],P=[],N=1,R=null,j=3,M=!1,F=!1,D=!1;function z(e){for(var t=S(P);null!==t;){if(null===t.callback)C(P);else{if(!(t.startTime<=e))break;C(P),t.sortIndex=t.expirationTime,T(O,t)}t=S(P)}}function I(e){if(D=!1,z(e),!F)if(null!==S(O))F=!0,r(A);else{var t=S(P);null!==t&&a(I,t.startTime-e)}}function A(e,n){F=!1,D&&(D=!1,o()),M=!0;var r=j;try{for(z(n),R=S(O);null!==R&&(!(R.expirationTime>n)||e&&!i());){var l=R.callback;if(null!==l){R.callback=null,j=R.priorityLevel;var u=l(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?R.callback=u:R===S(O)&&C(O),z(n)}else C(O);R=S(O)}if(null!==R)var c=!0;else{var s=S(P);null!==s&&a(I,s.startTime-n),c=!1}return c}finally{R=null,j=r,M=!1}}function L(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||M||(F=!0,r(A))},t.unstable_getCurrentPriorityLevel=function(){return j},t.unstable_getFirstCallbackNode=function(){return S(O)},t.unstable_next=function(e){switch(j){case 1:case 2:case 3:var t=3;break;default:t=j}var n=j;j=t;try{return e()}finally{j=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=j;j=e;try{return t()}finally{j=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0<u?l+u:l,i="number"==typeof i.timeout?i.timeout:L(e)}else i=L(e),u=l;return e={id:N++,callback:n,priorityLevel:e,startTime:u,expirationTime:i=u+i,sortIndex:-1},u>l?(e.sortIndex=u,T(P,e),null===S(O)&&e===S(P)&&(D?o():D=!0,a(I,u-l))):(e.sortIndex=i,T(O,e),F||M||(F=!0,r(A))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();z(e);var n=S(O);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<R.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=j;return function(){var n=j;j=t;try{return e.apply(this,arguments)}finally{j=n}}}},function(e,t,n){"use strict";var r=n(34);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=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 l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={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:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=n(0),a=n(22),o=n(23),i=o.setStyleProp;function l(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&o.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var o,u,c,s,f=(n=n||{}).library||r,d=f.cloneElement,p=f.createElement,m=f.isValidElement,h=[],v="function"==typeof n.replace,g=n.trim,y=0,b=t.length;y<b;y++)if(o=t[y],v&&m(u=n.replace(o)))b>1&&(u=d(u,{key:u.key||y})),h.push(u);else if("text"!==o.type){switch(c=o.attribs,l(o)?i(c.style,c):c&&(c=a(c)),s=null,o.type){case"script":case"style":o.children[0]&&(c.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?c.defaultValue=o.children[0].data:o.children&&o.children.length&&(s=e(o.children,n));break;default:continue}b>1&&(c.key=y),h.push(p(o.name,c,s))}else g?o.data.trim()&&h.push(o.data):h.push(o.data);return 1===h.length?h[0]:h}},function(e,t,n){var r=n(37),a=n(38),o=n(39),i=o.MUST_USE_PROPERTY,l=o.HAS_BOOLEAN_VALUE,u=o.HAS_NUMERIC_VALUE,c=o.HAS_POSITIVE_NUMERIC_VALUE,s=o.HAS_OVERLOADED_BOOLEAN_VALUE;function f(e,t){return(e&t)===t}function d(e,t,n){var r,a,o,d=e.Properties,p=e.DOMAttributeNames;for(a in d)r=p[a]||(n?a:a.toLowerCase()),o=d[a],t[r]={attributeName:r,propertyName:a,mustUseProperty:f(o,i),hasBooleanValue:f(o,l),hasNumericValue:f(o,u),hasPositiveNumericValue:f(o,c),hasOverloadedBooleanValue:f(o,s)}}var p={};d(r,p);var m={};d(a,m,!0);var h={};d(r,h),d(a,h,!0);e.exports={html:p,svg:m,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=r(n(41)),o=n(43);t.default=function(e,t){var n={};return e&&"string"==typeof e?(a.default(e,(function(e,r){e&&r&&(n[o.camelCase(e,t)]=r)})),n):n}},function(e,t,n){var r=n(42);e.exports=function(e,t){var n,a=null;if(!e||"string"!=typeof e)return a;for(var o,i,l=r(e),u="function"==typeof t,c=0,s=l.length;c<s;c++)o=(n=l[c]).property,i=n.value,u?t(o,i,n):i&&(a||(a={}),a[o]=i);return a}},function(e,t){var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,a=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g;function s(e){return e?e.replace(c,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var c=1,f=1;function d(e){var t=e.match(r);t&&(c+=t.length);var n=e.lastIndexOf("\n");f=~n?e.length-n:f+e.length}function p(){var e={line:c,column:f};return function(t){return t.position=new m(e),y(),t}}function m(e){this.start=e,this.end={line:c,column:f},this.source=t.source}m.prototype.content=e;var h=[];function v(n){var r=new Error(t.source+":"+c+":"+f+": "+n);if(r.reason=n,r.filename=t.source,r.line=c,r.column=f,r.source=e,!t.silent)throw r;h.push(r)}function g(t){var n=t.exec(e);if(n){var r=n[0];return d(r),e=e.slice(r.length),n}}function y(){g(a)}function b(e){var t;for(e=e||[];t=E();)!1!==t&&e.push(t);return e}function E(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,d(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function w(){var e=p(),t=g(o);if(t){if(E(),!g(i))return v("property missing ':'");var r=g(l),a=e({type:"declaration",property:s(t[0].replace(n,"")),value:r?s(r[0].replace(n,"")):""});return g(u),a}}return y(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()}},function(e,t,n){"use strict";t.__esModule=!0,t.camelCase=void 0;var r=/^--[a-zA-Z0-9-]+$/,a=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=function(e,t){return t.toUpperCase()},u=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||r.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(i,u)),e.replace(a,l))}},function(e,t,n){var r=n(45),a=n(24),o=a.formatDOM,i=a.isIE(9),l=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,n=e.match(l);return n&&n[1]&&(t=n[1],i&&(e=e.replace(n[0],""))),o(r(e),null,t)}},function(e,t,n){var r=n(24),a=/<([a-zA-Z]+[0-9]?)/,o=/<head.*>/i,i=/<body.*>/i,l=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,u=r.isIE(9),c=u||r.isIE(),s=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var d=new window.DOMParser,p=u?"text/xml":"text/html";s=f=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),u&&(e=e.replace(l,"<$1$2$3/>")),d.parseFromString(e,p)}}if(document.implementation){var m=document.implementation.createHTMLDocument(c?"html-dom-parser":void 0);s=function(e,t){if(t)return m.documentElement.getElementsByTagName(t)[0].innerHTML=e,m;try{return m.documentElement.innerHTML=e,m}catch(t){if(f)return f(e)}}}var h,v=document.createElement("template");v.content&&(h=function(e){return v.innerHTML=e,v.content.childNodes}),e.exports=function(e){var t,n,r,l,u=e.match(a);switch(u&&u[1]&&(t=u[1].toLowerCase()),t){case"html":return n=f(e),o.test(e)||(r=n.getElementsByTagName("head")[0])&&r.parentNode.removeChild(r),i.test(e)||(r=n.getElementsByTagName("body")[0])&&r.parentNode.removeChild(r),n.getElementsByTagName("html");case"head":case"body":return l=s(e).getElementsByTagName(t),i.test(e)&&o.test(e)?l[0].parentNode.childNodes:l;default:return h?h(e):s(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(1),a=n(3),o=n(4),i=n.n(o),l=n(0),u=n.n(l),c=n(7);var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return null!=e})).reduce((function(e,t){if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];e.apply(this,r),t.apply(this,r)}}),null)};function f(e){return!e||"#"===e.trim()}var d=u.a.forwardRef((function(e,t){var n=e.as,o=void 0===n?"a":n,i=e.disabled,l=e.onKeyDown,c=Object(a.a)(e,["as","disabled","onKeyDown"]),d=function(e){var t=c.href,n=c.onClick;(i||f(t))&&e.preventDefault(),i?e.stopPropagation():n&&n(e)};return f(c.href)&&(c.role=c.role||"button",c.href=c.href||"#"),i&&(c.tabIndex=-1,c["aria-disabled"]=!0),u.a.createElement(o,Object(r.a)({ref:t},c,{onClick:d,onKeyDown:s((function(e){" "===e.key&&(e.preventDefault(),d(e))}),l)}))}));d.displayName="SafeAnchor";var p=d,m=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.variant,l=e.size,s=e.active,f=e.className,d=e.block,m=e.type,h=e.as,v=Object(a.a)(e,["bsPrefix","variant","size","active","className","block","type","as"]),g=Object(c.a)(n,"btn"),y=i()(f,g,s&&"active",o&&g+"-"+o,d&&g+"-block",l&&g+"-"+l);if(v.href)return u.a.createElement(p,Object(r.a)({},v,{as:h,ref:t,className:i()(y,v.disabled&&"disabled")}));t&&(v.ref=t),m?v.type=m:h||(v.type="button");var b=h||"button";return u.a.createElement(b,Object(r.a)({},v,{className:y}))}));m.displayName="Button",m.defaultProps={variant:"primary",active:!1,disabled:!1};t.a=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(82)},,function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(20),i=n(49),l=n(13),u=n(17),c=n(16),s=n(11),f=n.n(s);function d(e){return(d="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})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var a=b(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(d,e);var t,n,r,s=v(d);function d(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),(t=s.call(this,e)).state={show:e.content.show,sending:!1,modal_props:{},label_step:e.label_step||"",content:e.content||[],ajax:e.ajax||[],steps:e.steps||0,logo_img:e.logo_img||"",assets_url:e.assets_url||""},t.onClick=t.onClick.bind(y(t)),t.onHide=t.onHide.bind(y(t)),t}return t=d,r=[{key:"getDerivedStateFromProps",value:function(e,t){return{content:e.content,show:e.content.show}}}],(n=[{key:"onHide",value:function(){var e=this.state;e.content.show=!1,this.props.on_close_popup(),this.setState(e)}},{key:"onClick",value:function(e){this.props.on_button_click(e,this.props.id)}},{key:"render",value:function(){var e=this,t=this.state.modal_props;function n(e){var t=e.popup,n="";return t.title?n=t.title:t.step&&(n=e.label_step+t.step),n?a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"title"},n)):null}function r(t){var n=t.step,r=parseInt(t.steps,10);if(!n)return null;for(var o=[],i=function(t){var r="step-"+t;t===n?o.push(a.a.createElement("li",{onClick:function(){return e.onClick(t)},key:r,className:"active"}," ")):o.push(a.a.createElement("li",{onClick:function(){return e.onClick(t)},key:r}," "))},l=1;l<=r;l++)i(l);return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"steps"},a.a.createElement("ul",null,o)))}function s(e){var t=e.image;return e.status?a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"logo"},a.a.createElement("img",{src:t}))):null}function d(e){var t=e.image;return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"image"},a.a.createElement("img",{src:t})))}function m(e){var t=e.text;return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"heading"},a.a.createElement("h1",null,t)))}function h(e){var t=e.text;if(!t)return null;var n=[];return t.forEach((function(e,t){n.push(a.a.createElement("p",{key:"text-"+t},f()(e)))})),a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"text"},n))}function v(e){var t=e.self,n=e.buttons;if(!n)return null;var r=[];return n.forEach((function(e,n){r.push(a.a.createElement(i.a,{key:"button-"+n,onClick:function(){return t.onClick(e)},variant:"link",className:e.classes},e.label))})),a.a.createElement("div",null,r)}return t.show=this.state.show,a.a.createElement(o.a,p({},t,{size:"lg","aria-labelledby":"contained-modal-title-vcenter",centered:!0,onHide:this.onHide.bind(this),className:"flexible-shipping-onboarding-popup "+this.state.content.id}),a.a.createElement(o.a.Header,{closeButton:!0}),a.a.createElement(o.a.Body,{style:{display:"flex",justifyContent:"center",alignItems:"center"}},a.a.createElement(l.a,null,a.a.createElement(n,{popup:this.state.content,label_step:this.state.label_step}),a.a.createElement(r,{step:this.state.content.step,steps:this.state.steps}),a.a.createElement(s,{status:this.state.content.logo,image:this.state.assets_url+"/images/"+this.state.logo_img}),a.a.createElement(d,{image:this.state.assets_url+"/images/onboarding/"+this.state.content.image}),a.a.createElement(m,{text:this.state.content.heading}),a.a.createElement(h,{text:this.state.content.text}))),a.a.createElement(o.a.Footer,null,a.a.createElement(v,{buttons:this.state.content.buttons,self:this})))}}])&&m(t.prototype,n),r&&m(t,r),d}(a.a.Component);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})(e)}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_(e);if(t){var a=_(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?C(e):t}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(i,e);var t,n,r,o=T(i);function i(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).state={ajax:e.ajax,popups:e.popups,logo_img:e.logo_img,label_step:e.label_step,assets_url:e.assets_url,open_auto:e.open_auto,current_step:0,steps:parseInt(e.steps,10)},t.onClick=t.onClick.bind(C(t)),t.onClose=t.onClose.bind(C(t));var n=document.querySelector(".js--open-onboarding");return t.displayOnboardingOnClick(n),t.displayOnboardingOnScroll(n),t}return t=i,(n=[{key:"displayOnboardingOnClick",value:function(e){var t=this;e.addEventListener("click",(function(e){e.preventDefault(),t.showPopup(t.state.current_step),t.state.open_auto=!1,t.sendAJAX(t.state.ajax.action.click)}))}},{key:"displayOnboardingOnScroll",value:function(e){if(this.state.open_auto){var t=this,n=!1;document.addEventListener("scroll",(function(r){!n&&t.isElementInViewport(e)&&(t.sendAJAX(t.state.ajax.action.auto_show_popup),t.showPopup(0),n=!0)}))}}},{key:"render",value:function(){var e=this;return this.state.popups.map((function(t,n){return a.a.createElement(E,{id:n,key:"popup-"+n,ajax:fs_onboarding_details.ajax,assets_url:e.state.assets_url,label_step:e.state.label_step,logo_img:e.state.logo_img,steps:e.state.steps,content:t,on_button_click:e.onClick,on_close_popup:e.onClose})}))}},{key:"isElementInViewport",value:function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}},{key:"onClick",value:function(e,t){if(this.hidePopup(t),"number"==typeof e)this.showPopup(e);else if(e.popup){var n=this.findPopupKey(e.popup);-1!==n&&this.showPopup(n)}else e.action&&this.state.open_auto&&this.sendTrackerDataEvent(e.action)}},{key:"onClose",value:function(){this.sendTrackerDataEvent("close")}},{key:"findPopupKey",value:function(e){return this.state.popups.findIndex((function(t){return t.id===e}))}},{key:"showPopup",value:function(e){var t=this.state;this.changePopupShow(e,!0),t.current_step=e,this.setState(t)}},{key:"hidePopup",value:function(e){this.changePopupShow(e,!1)}},{key:"changePopupShow",value:function(e,t){var n=this.state;n.popups[e].show=t,this.setState(n)}},{key:"sendAJAX",value:function(e,t){var n=new FormData;n.append("action",e),n.append("_ajax_nonce",this.state.ajax.nonce),t&&t.forEach((function(e,t){n.append(t,e)}));var r=new XMLHttpRequest;r.open("POST",this.state.ajax.url),r.send(n)}},{key:"sendTrackerDataEvent",value:function(e){var t=new FormData;t.append("event",e),t.append("step",this.state.current_step),this.sendAJAX(this.state.ajax.action.event,t)}}])&&k(t.prototype,n),r&&k(t,r),i}(a.a.Component),P=n(5);document.addEventListener("DOMContentLoaded",(function(){document.querySelector("#onboarding-container")&&Object(P.render)(a.a.createElement(O,fs_onboarding_details),document.getElementById("onboarding-container"))}),!1)}]);
|
32 |
*
|
33 |
* This source code is licensed under the MIT license found in the
|
34 |
* LICENSE file in the root directory of this source tree.
|
35 |
+
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},a=function(e,t){c=setTimeout(e,t)},o=function(){clearTimeout(c)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){window.cancelAnimationFrame;window.requestAnimationFrame}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var v=p.now();t.unstable_now=function(){return p.now()-v}}var g=!1,y=null,b=-1,E=5,w=0;i=function(){return t.unstable_now()>=w},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e||(E=0<e?Math.floor(1e3/e):5)};var k=new MessageChannel,x=k.port2;k.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();w=e+E;try{y(!0,e)?x.postMessage(null):(g=!1,y=null)}catch(e){throw x.postMessage(null),e}}else g=!1},r=function(e){y=e,g||(g=!0,x.postMessage(null))},a=function(e,n){b=m((function(){e(t.unstable_now())}),n)},o=function(){h(b),b=-1}}function T(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<_(a,t)))break e;e[r]=t,e[n]=a,n=r}}function S(e){return void 0===(e=e[0])?null:e}function C(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,u=e[l];if(void 0!==i&&0>_(i,n))void 0!==u&&0>_(u,i)?(e[r]=u,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==u&&0>_(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],P=[],N=1,R=null,j=3,M=!1,F=!1,D=!1;function z(e){for(var t=S(P);null!==t;){if(null===t.callback)C(P);else{if(!(t.startTime<=e))break;C(P),t.sortIndex=t.expirationTime,T(O,t)}t=S(P)}}function I(e){if(D=!1,z(e),!F)if(null!==S(O))F=!0,r(A);else{var t=S(P);null!==t&&a(I,t.startTime-e)}}function A(e,n){F=!1,D&&(D=!1,o()),M=!0;var r=j;try{for(z(n),R=S(O);null!==R&&(!(R.expirationTime>n)||e&&!i());){var l=R.callback;if(null!==l){R.callback=null,j=R.priorityLevel;var u=l(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?R.callback=u:R===S(O)&&C(O),z(n)}else C(O);R=S(O)}if(null!==R)var c=!0;else{var s=S(P);null!==s&&a(I,s.startTime-n),c=!1}return c}finally{R=null,j=r,M=!1}}function L(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||M||(F=!0,r(A))},t.unstable_getCurrentPriorityLevel=function(){return j},t.unstable_getFirstCallbackNode=function(){return S(O)},t.unstable_next=function(e){switch(j){case 1:case 2:case 3:var t=3;break;default:t=j}var n=j;j=t;try{return e()}finally{j=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=j;j=e;try{return t()}finally{j=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0<u?l+u:l,i="number"==typeof i.timeout?i.timeout:L(e)}else i=L(e),u=l;return e={id:N++,callback:n,priorityLevel:e,startTime:u,expirationTime:i=u+i,sortIndex:-1},u>l?(e.sortIndex=u,T(P,e),null===S(O)&&e===S(P)&&(D?o():D=!0,a(I,u-l))):(e.sortIndex=i,T(O,e),F||M||(F=!0,r(A))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();z(e);var n=S(O);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<R.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=j;return function(){var n=j;j=t;try{return e.apply(this,arguments)}finally{j=n}}}},function(e,t,n){"use strict";var r=n(34);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=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 l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={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:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=n(0),a=n(22),o=n(23),i=o.setStyleProp;function l(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&o.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var o,u,c,s,f=(n=n||{}).library||r,d=f.cloneElement,p=f.createElement,m=f.isValidElement,h=[],v="function"==typeof n.replace,g=n.trim,y=0,b=t.length;y<b;y++)if(o=t[y],v&&m(u=n.replace(o)))b>1&&(u=d(u,{key:u.key||y})),h.push(u);else if("text"!==o.type){switch(c=o.attribs,l(o)?i(c.style,c):c&&(c=a(c)),s=null,o.type){case"script":case"style":o.children[0]&&(c.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?c.defaultValue=o.children[0].data:o.children&&o.children.length&&(s=e(o.children,n));break;default:continue}b>1&&(c.key=y),h.push(p(o.name,c,s))}else g?o.data.trim()&&h.push(o.data):h.push(o.data);return 1===h.length?h[0]:h}},function(e,t,n){var r=n(37),a=n(38),o=n(39),i=o.MUST_USE_PROPERTY,l=o.HAS_BOOLEAN_VALUE,u=o.HAS_NUMERIC_VALUE,c=o.HAS_POSITIVE_NUMERIC_VALUE,s=o.HAS_OVERLOADED_BOOLEAN_VALUE;function f(e,t){return(e&t)===t}function d(e,t,n){var r,a,o,d=e.Properties,p=e.DOMAttributeNames;for(a in d)r=p[a]||(n?a:a.toLowerCase()),o=d[a],t[r]={attributeName:r,propertyName:a,mustUseProperty:f(o,i),hasBooleanValue:f(o,l),hasNumericValue:f(o,u),hasPositiveNumericValue:f(o,c),hasOverloadedBooleanValue:f(o,s)}}var p={};d(r,p);var m={};d(a,m,!0);var h={};d(r,h),d(a,h,!0);e.exports={html:p,svg:m,properties:h,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=r(n(41)),o=n(43);t.default=function(e,t){var n={};return e&&"string"==typeof e?(a.default(e,(function(e,r){e&&r&&(n[o.camelCase(e,t)]=r)})),n):n}},function(e,t,n){var r=n(42);e.exports=function(e,t){var n,a=null;if(!e||"string"!=typeof e)return a;for(var o,i,l=r(e),u="function"==typeof t,c=0,s=l.length;c<s;c++)o=(n=l[c]).property,i=n.value,u?t(o,i,n):i&&(a||(a={}),a[o]=i);return a}},function(e,t){var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,a=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g;function s(e){return e?e.replace(c,""):""}e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var c=1,f=1;function d(e){var t=e.match(r);t&&(c+=t.length);var n=e.lastIndexOf("\n");f=~n?e.length-n:f+e.length}function p(){var e={line:c,column:f};return function(t){return t.position=new m(e),y(),t}}function m(e){this.start=e,this.end={line:c,column:f},this.source=t.source}m.prototype.content=e;var h=[];function v(n){var r=new Error(t.source+":"+c+":"+f+": "+n);if(r.reason=n,r.filename=t.source,r.line=c,r.column=f,r.source=e,!t.silent)throw r;h.push(r)}function g(t){var n=t.exec(e);if(n){var r=n[0];return d(r),e=e.slice(r.length),n}}function y(){g(a)}function b(e){var t;for(e=e||[];t=E();)!1!==t&&e.push(t);return e}function E(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,d(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function w(){var e=p(),t=g(o);if(t){if(E(),!g(i))return v("property missing ':'");var r=g(l),a=e({type:"declaration",property:s(t[0].replace(n,"")),value:r?s(r[0].replace(n,"")):""});return g(u),a}}return y(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()}},function(e,t,n){"use strict";t.__esModule=!0,t.camelCase=void 0;var r=/^--[a-zA-Z0-9-]+$/,a=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=function(e,t){return t.toUpperCase()},u=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||r.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(i,u)),e.replace(a,l))}},function(e,t,n){var r=n(45),a=n(24),o=a.formatDOM,i=a.isIE(9),l=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,n=e.match(l);return n&&n[1]&&(t=n[1],i&&(e=e.replace(n[0],""))),o(r(e),null,t)}},function(e,t,n){var r=n(24),a=/<([a-zA-Z]+[0-9]?)/,o=/<head.*>/i,i=/<body.*>/i,l=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,u=r.isIE(9),c=u||r.isIE(),s=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var d=new window.DOMParser,p=u?"text/xml":"text/html";s=f=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),u&&(e=e.replace(l,"<$1$2$3/>")),d.parseFromString(e,p)}}if(document.implementation){var m=document.implementation.createHTMLDocument(c?"html-dom-parser":void 0);s=function(e,t){if(t)return m.documentElement.getElementsByTagName(t)[0].innerHTML=e,m;try{return m.documentElement.innerHTML=e,m}catch(t){if(f)return f(e)}}}var h,v=document.createElement("template");v.content&&(h=function(e){return v.innerHTML=e,v.content.childNodes}),e.exports=function(e){var t,n,r,l,u=e.match(a);switch(u&&u[1]&&(t=u[1].toLowerCase()),t){case"html":return n=f(e),o.test(e)||(r=n.getElementsByTagName("head")[0])&&r.parentNode.removeChild(r),i.test(e)||(r=n.getElementsByTagName("body")[0])&&r.parentNode.removeChild(r),n.getElementsByTagName("html");case"head":case"body":return l=s(e).getElementsByTagName(t),i.test(e)&&o.test(e)?l[0].parentNode.childNodes:l;default:return h?h(e):s(e,"body").getElementsByTagName("body")[0].childNodes}}},function(e,t){e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},,function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(1),a=n(3),o=n(4),i=n.n(o),l=n(0),u=n.n(l),c=n(7);var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return null!=e})).reduce((function(e,t){if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];e.apply(this,r),t.apply(this,r)}}),null)};function f(e){return!e||"#"===e.trim()}var d=u.a.forwardRef((function(e,t){var n=e.as,o=void 0===n?"a":n,i=e.disabled,l=e.onKeyDown,c=Object(a.a)(e,["as","disabled","onKeyDown"]),d=function(e){var t=c.href,n=c.onClick;(i||f(t))&&e.preventDefault(),i?e.stopPropagation():n&&n(e)};return f(c.href)&&(c.role=c.role||"button",c.href=c.href||"#"),i&&(c.tabIndex=-1,c["aria-disabled"]=!0),u.a.createElement(o,Object(r.a)({ref:t},c,{onClick:d,onKeyDown:s((function(e){" "===e.key&&(e.preventDefault(),d(e))}),l)}))}));d.displayName="SafeAnchor";var p=d,m=u.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.variant,l=e.size,s=e.active,f=e.className,d=e.block,m=e.type,h=e.as,v=Object(a.a)(e,["bsPrefix","variant","size","active","className","block","type","as"]),g=Object(c.a)(n,"btn"),y=i()(f,g,s&&"active",o&&g+"-"+o,d&&g+"-block",l&&g+"-"+l);if(v.href)return u.a.createElement(p,Object(r.a)({},v,{as:h,ref:t,className:i()(y,v.disabled&&"disabled")}));t&&(v.ref=t),m?v.type=m:h||(v.type="button");var b=h||"button";return u.a.createElement(b,Object(r.a)({},v,{className:y}))}));m.displayName="Button",m.defaultProps={variant:"primary",active:!1,disabled:!1};t.a=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(82)},,function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(20),i=n(49),l=n(13),u=n(17),c=n(16),s=n(11),f=n.n(s);function d(e){return(d="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})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var a=b(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(d,e);var t,n,r,s=v(d);function d(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),(t=s.call(this,e)).state={show:e.content.show,sending:!1,modal_props:{},label_step:e.label_step||"",content:e.content||[],ajax:e.ajax||[],steps:e.steps||0,logo_img:e.logo_img||"",assets_url:e.assets_url||""},t.onClick=t.onClick.bind(y(t)),t.onHide=t.onHide.bind(y(t)),t}return t=d,r=[{key:"getDerivedStateFromProps",value:function(e,t){return{content:e.content,show:e.content.show}}}],(n=[{key:"onHide",value:function(){var e=this.state;e.content.show=!1,this.props.on_close_popup(),this.setState(e)}},{key:"onClick",value:function(e){this.props.on_button_click(e,this.props.id)}},{key:"render",value:function(){var e=this,t=this.state.modal_props;function n(e){var t=e.popup,n="";return t.title?n=t.title:t.step&&(n=e.label_step+t.step),n?a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"title"},n)):null}function r(t){var n=t.step,r=parseInt(t.steps,10);if(!n)return null;for(var o=[],i=function(t){var r="step-"+t;t===n?o.push(a.a.createElement("li",{onClick:function(){return e.onClick(t)},key:r,className:"active"}," ")):o.push(a.a.createElement("li",{onClick:function(){return e.onClick(t)},key:r}," "))},l=1;l<=r;l++)i(l);return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"steps"},a.a.createElement("ul",null,o)))}function s(e){var t=e.image;return e.status?a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"logo"},a.a.createElement("img",{src:t}))):null}function d(e){var t=e.image;return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"image"},a.a.createElement("img",{src:t})))}function m(e){var t=e.text;return a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"heading"},a.a.createElement("h1",null,t)))}function h(e){var t=e.text;if(!t)return null;var n=[];return t.forEach((function(e,t){n.push(a.a.createElement("p",{key:"text-"+t},f()(e)))})),a.a.createElement(u.a,null,a.a.createElement(c.a,{className:"text"},n))}function v(e){var t=e.self,n=e.buttons;if(!n)return null;var r=[];return n.forEach((function(e,n){r.push(a.a.createElement(i.a,{key:"button-"+n,onClick:function(){return t.onClick(e)},variant:"link",className:e.classes},e.label))})),a.a.createElement("div",null,r)}return t.show=this.state.show,a.a.createElement(o.a,p({},t,{size:"lg","aria-labelledby":"contained-modal-title-vcenter",centered:!0,onHide:this.onHide.bind(this),className:"flexible-shipping-onboarding-popup "+this.state.content.id}),a.a.createElement(o.a.Header,{closeButton:!0}),a.a.createElement(o.a.Body,{style:{display:"flex",justifyContent:"center",alignItems:"center"}},a.a.createElement(l.a,null,a.a.createElement(n,{popup:this.state.content,label_step:this.state.label_step}),a.a.createElement(r,{step:this.state.content.step,steps:this.state.steps}),a.a.createElement(s,{status:this.state.content.logo,image:this.state.assets_url+"/images/"+this.state.logo_img}),a.a.createElement(d,{image:this.state.assets_url+"/images/onboarding/"+this.state.content.image}),a.a.createElement(m,{text:this.state.content.heading}),a.a.createElement(h,{text:this.state.content.text}))),a.a.createElement(o.a.Footer,null,a.a.createElement(v,{buttons:this.state.content.buttons,self:this})))}}])&&m(t.prototype,n),r&&m(t,r),d}(a.a.Component);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})(e)}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_(e);if(t){var a=_(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?C(e):t}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(i,e);var t,n,r,o=T(i);function i(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).state={ajax:e.ajax,popups:e.popups,logo_img:e.logo_img,label_step:e.label_step,assets_url:e.assets_url,open_auto:e.open_auto,current_step:0,steps:parseInt(e.steps,10)},t.onClick=t.onClick.bind(C(t)),t.onClose=t.onClose.bind(C(t));var n=document.querySelector(".js--open-onboarding");return t.displayOnboardingOnClick(n),t.displayOnboardingOnScroll(document.querySelector("#woocommerce_flexible_shipping_method_rules")),t}return t=i,(n=[{key:"displayOnboardingOnClick",value:function(e){var t=this;e.addEventListener("click",(function(e){e.preventDefault(),t.showPopup(t.state.current_step),t.state.open_auto=!1,t.sendAJAX(t.state.ajax.action.click)}))}},{key:"displayOnboardingOnScroll",value:function(e){if(this.state.open_auto){var t=this,n=!1;document.addEventListener("scroll",(function(r){!n&&t.isElementInViewport(e)&&(t.sendAJAX(t.state.ajax.action.auto_show_popup),t.showPopup(0),n=!0)}))}}},{key:"render",value:function(){var e=this;return this.state.popups.map((function(t,n){return a.a.createElement(E,{id:n,key:"popup-"+n,ajax:fs_onboarding_details.ajax,assets_url:e.state.assets_url,label_step:e.state.label_step,logo_img:e.state.logo_img,steps:e.state.steps,content:t,on_button_click:e.onClick,on_close_popup:e.onClose})}))}},{key:"isElementInViewport",value:function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}},{key:"onClick",value:function(e,t){if(this.hidePopup(t),"number"==typeof e)this.showPopup(e);else if(e.popup){var n=this.findPopupKey(e.popup);-1!==n&&this.showPopup(n)}else e.action&&this.state.open_auto&&this.sendTrackerDataEvent(e.action)}},{key:"onClose",value:function(){this.sendTrackerDataEvent("close")}},{key:"findPopupKey",value:function(e){return this.state.popups.findIndex((function(t){return t.id===e}))}},{key:"showPopup",value:function(e){var t=this.state;this.changePopupShow(e,!0),t.current_step=e,this.setState(t)}},{key:"hidePopup",value:function(e){this.changePopupShow(e,!1)}},{key:"changePopupShow",value:function(e,t){var n=this.state;n.popups[e].show=t,this.setState(n)}},{key:"sendAJAX",value:function(e,t){var n=new FormData;n.append("action",e),n.append("_ajax_nonce",this.state.ajax.nonce),t&&t.forEach((function(e,t){n.append(t,e)}));var r=new XMLHttpRequest;r.open("POST",this.state.ajax.url),r.send(n)}},{key:"sendTrackerDataEvent",value:function(e){var t=new FormData;t.append("event",e),t.append("step",this.state.current_step),this.sendAJAX(this.state.ajax.action.event,t)}}])&&k(t.prototype,n),r&&k(t,r),i}(a.a.Component),P=n(5);document.addEventListener("DOMContentLoaded",(function(){document.querySelector("#onboarding-container")&&Object(P.render)(a.a.createElement(O,fs_onboarding_details),document.getElementById("onboarding-container"))}),!1)}]);
|
classes/class-flexible-shipping-plugin.php
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
*/
|
7 |
|
8 |
use FSVendor\WPDesk\FS\Compatibility\PluginCompatibility;
|
|
|
9 |
use FSVendor\WPDesk\FS\TableRate\Logger\Assets;
|
10 |
use FSVendor\WPDesk\Logger\WPDeskLoggerFactory;
|
11 |
use FSVendor\WPDesk\Mutex\WordpressPostMutex;
|
@@ -32,12 +33,15 @@ use FSVendor\WPDesk\View\Resolver\WPThemeResolver;
|
|
32 |
use FSVendor\WPDesk\WooCommerce\CurrencySwitchers\ShippingIntegrations;
|
33 |
use Psr\Log\LoggerInterface;
|
34 |
use Psr\Log\NullLogger;
|
|
|
|
|
35 |
use WPDesk\FS\Integration\ExternalPluginAccess;
|
36 |
use WPDesk\FS\Nps\NpsDisplayDecision;
|
37 |
use WPDesk\FS\Nps\ShippingMethodFirstSettingsTime;
|
38 |
use WPDesk\FS\Onboarding\TableRate\Onboarding;
|
39 |
use WPDesk\FS\Onboarding\TableRate\FinishOption;
|
40 |
use WPDesk\FS\Onboarding\TableRate\OptionAjaxUpdater;
|
|
|
41 |
use WPDesk\FS\Plugin\PluginActivation;
|
42 |
use WPDesk\FS\TableRate\Beacon\Beacon;
|
43 |
use WPDesk\FS\TableRate\Beacon\BeaconClickedAjax;
|
@@ -63,8 +67,10 @@ use WPDesk\FS\TableRate\ShippingMethod\Convert\ConvertTracker;
|
|
63 |
use WPDesk\FS\TableRate\ShippingMethod\MethodTitle;
|
64 |
use WPDesk\FS\TableRate\ShippingMethod\MethodDescription;
|
65 |
use WPDesk\FS\TableRate\ShippingMethodSingle;
|
|
|
66 |
use WPDesk\FS\TableRate\UserFeedback;
|
67 |
use WPDesk\FS\TableRate\ContextualInfo;
|
|
|
68 |
|
69 |
/**
|
70 |
* Class Flexible_Shipping_Plugin
|
@@ -88,7 +94,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
88 |
*
|
89 |
* @var string
|
90 |
*/
|
91 |
-
private $scripts_version = '
|
92 |
|
93 |
/**
|
94 |
* Admin notices.
|
@@ -178,7 +184,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
178 |
|
179 |
$session_factory = new SessionFactory();
|
180 |
|
181 |
-
$this->add_hookable( new
|
182 |
|
183 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Bulk_Actions( $session_factory ) );
|
184 |
|
@@ -218,12 +224,21 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
218 |
$this->add_hookable( new UserFeedback() );
|
219 |
|
220 |
//Onboarding
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
$this->add_hookable( new MethodTitle() );
|
229 |
$this->add_hookable( new MethodDescription( $this->renderer ) );
|
@@ -249,7 +264,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
249 |
|
250 |
$this->add_hookable( new MultipleShippingZonesMatchedSameTerritoryTracker() );
|
251 |
|
252 |
-
$this->add_hookable( new
|
253 |
|
254 |
$this->init_nps();
|
255 |
}
|
@@ -292,12 +307,12 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
292 |
);
|
293 |
|
294 |
$nps->add_feedback_option( new FeedbackOption( __( 'More calculation conditions', 'flexible-shipping' ), __( 'What exactly should the conditions you need be based on?', 'flexible-shipping' ) ) )
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
|
302 |
$this->add_hookable( $nps );
|
303 |
|
@@ -530,7 +545,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
530 |
public function create_tracker() {
|
531 |
$tracker_factory = new WPDesk_Tracker_Factory();
|
532 |
$tracker_factory->create_tracker( basename( dirname( __FILE__ ) ) );
|
533 |
-
( new
|
534 |
}
|
535 |
|
536 |
/**
|
6 |
*/
|
7 |
|
8 |
use FSVendor\WPDesk\FS\Compatibility\PluginCompatibility;
|
9 |
+
use FSVendor\WPDesk\FS\Shipment\ShipmentFunctionality;
|
10 |
use FSVendor\WPDesk\FS\TableRate\Logger\Assets;
|
11 |
use FSVendor\WPDesk\Logger\WPDeskLoggerFactory;
|
12 |
use FSVendor\WPDesk\Mutex\WordpressPostMutex;
|
33 |
use FSVendor\WPDesk\WooCommerce\CurrencySwitchers\ShippingIntegrations;
|
34 |
use Psr\Log\LoggerInterface;
|
35 |
use Psr\Log\NullLogger;
|
36 |
+
use WPDesk\FS\Helpers\FlexibleShippingMethodsChecker;
|
37 |
+
use WPDesk\FS\Helpers\WooSettingsPageChecker;
|
38 |
use WPDesk\FS\Integration\ExternalPluginAccess;
|
39 |
use WPDesk\FS\Nps\NpsDisplayDecision;
|
40 |
use WPDesk\FS\Nps\ShippingMethodFirstSettingsTime;
|
41 |
use WPDesk\FS\Onboarding\TableRate\Onboarding;
|
42 |
use WPDesk\FS\Onboarding\TableRate\FinishOption;
|
43 |
use WPDesk\FS\Onboarding\TableRate\OptionAjaxUpdater;
|
44 |
+
use WPDesk\FS\Onboarding\TableRate\PopupData;
|
45 |
use WPDesk\FS\Plugin\PluginActivation;
|
46 |
use WPDesk\FS\TableRate\Beacon\Beacon;
|
47 |
use WPDesk\FS\TableRate\Beacon\BeaconClickedAjax;
|
67 |
use WPDesk\FS\TableRate\ShippingMethod\MethodTitle;
|
68 |
use WPDesk\FS\TableRate\ShippingMethod\MethodDescription;
|
69 |
use WPDesk\FS\TableRate\ShippingMethodSingle;
|
70 |
+
use WPDesk\FS\TableRate\Tax\Tracker;
|
71 |
use WPDesk\FS\TableRate\UserFeedback;
|
72 |
use WPDesk\FS\TableRate\ContextualInfo;
|
73 |
+
use WPDesk\FS\Tracker\TrackerNotices;
|
74 |
|
75 |
/**
|
76 |
* Class Flexible_Shipping_Plugin
|
94 |
*
|
95 |
* @var string
|
96 |
*/
|
97 |
+
private $scripts_version = '268';
|
98 |
|
99 |
/**
|
100 |
* Admin notices.
|
184 |
|
185 |
$session_factory = new SessionFactory();
|
186 |
|
187 |
+
$this->add_hookable( new ShipmentFunctionality( $this->logger, trailingslashit( $this->get_plugin_assets_url() ) . '../vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/assets/', $this->scripts_version ) );
|
188 |
|
189 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Bulk_Actions( $session_factory ) );
|
190 |
|
224 |
$this->add_hookable( new UserFeedback() );
|
225 |
|
226 |
//Onboarding
|
227 |
+
$setting_page_checker = new WooSettingsPageChecker();
|
228 |
+
$fs_methods_checker = new FlexibleShippingMethodsChecker();
|
229 |
+
|
230 |
+
$finish_option = new FinishOption();
|
231 |
+
$this->add_hookable( new OptionAjaxUpdater( $finish_option ) );
|
232 |
+
$this->add_hookable( new Onboarding(
|
233 |
+
$finish_option,
|
234 |
+
$this->scripts_version,
|
235 |
+
trailingslashit( $this->get_plugin_assets_url() ),
|
236 |
+
$setting_page_checker,
|
237 |
+
$fs_methods_checker,
|
238 |
+
( new PopupData() )->get_popups()
|
239 |
+
)
|
240 |
+
);
|
241 |
+
$this->add_hookable( new \WPDesk\FS\Onboarding\TableRate\Tracker( $finish_option ) );
|
242 |
|
243 |
$this->add_hookable( new MethodTitle() );
|
244 |
$this->add_hookable( new MethodDescription( $this->renderer ) );
|
264 |
|
265 |
$this->add_hookable( new MultipleShippingZonesMatchedSameTerritoryTracker() );
|
266 |
|
267 |
+
$this->add_hookable( new Tracker() );
|
268 |
|
269 |
$this->init_nps();
|
270 |
}
|
307 |
);
|
308 |
|
309 |
$nps->add_feedback_option( new FeedbackOption( __( 'More calculation conditions', 'flexible-shipping' ), __( 'What exactly should the conditions you need be based on?', 'flexible-shipping' ) ) )
|
310 |
+
->add_feedback_option( new FeedbackOption( __( 'More detailed documentation', 'flexible-shipping' ) ) )
|
311 |
+
->add_feedback_option( new FeedbackOption( __( 'Easier contact with support', 'flexible-shipping' ) ) )
|
312 |
+
->add_feedback_option( new FeedbackOption( __( 'More user-friendly interface', 'flexible-shipping' ) ) )
|
313 |
+
->add_feedback_option( new FeedbackOption( __( 'Less complicated settings', 'flexible-shipping' ) ) )
|
314 |
+
->add_feedback_option( new FeedbackOption( __( 'Too soon to say', 'flexible-shipping' ) ) )
|
315 |
+
->add_feedback_option( new FeedbackOption( __( 'Other', 'flexible-shipping' ), __( 'Please tell us what exactly can we do to improve our plugin?', 'flexible-shipping' ) ) );
|
316 |
|
317 |
$this->add_hookable( $nps );
|
318 |
|
545 |
public function create_tracker() {
|
546 |
$tracker_factory = new WPDesk_Tracker_Factory();
|
547 |
$tracker_factory->create_tracker( basename( dirname( __FILE__ ) ) );
|
548 |
+
( new TrackerNotices() )->hooks();
|
549 |
}
|
550 |
|
551 |
/**
|
flexible-shipping.php
CHANGED
@@ -3,15 +3,15 @@
|
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
-
* Version: 4.
|
7 |
* Author: WP Desk
|
8 |
* Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
* Requires at least: 5.2
|
12 |
* Tested up to: 5.9
|
13 |
-
* WC requires at least: 5.
|
14 |
-
* WC tested up to: 5.
|
15 |
* Requires PHP: 7.0
|
16 |
*
|
17 |
* Copyright 2017 WP Desk Ltd.
|
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
-
$plugin_version = '4.
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
+
* Version: 4.9.0
|
7 |
* Author: WP Desk
|
8 |
* Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
* Requires at least: 5.2
|
12 |
* Tested up to: 5.9
|
13 |
+
* WC requires at least: 5.5
|
14 |
+
* WC tested up to: 5.9
|
15 |
* Requires PHP: 7.0
|
16 |
*
|
17 |
* Copyright 2017 WP Desk Ltd.
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
+
$plugin_version = '4.9.0';
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
lang/flexible-shipping.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Flexible Shipping plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Flexible Shipping 4.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2021-10-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: flexible-shipping\n"
|
@@ -22,7 +22,7 @@ msgstr ""
|
|
22 |
#: classes/table-rate/settings/flexible-shipping.php:33
|
23 |
#: classes/table-rate/shipping-method.php:95
|
24 |
#: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:153
|
25 |
-
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:
|
26 |
msgid "Flexible Shipping"
|
27 |
msgstr ""
|
28 |
|
@@ -42,77 +42,77 @@ msgstr ""
|
|
42 |
msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: classes/class-flexible-shipping-plugin.php:
|
46 |
msgid "Hey, we are curious how would you grade your first impression on Flexible Shipping so far?"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: classes/class-flexible-shipping-plugin.php:
|
50 |
msgid "Wow, it's awesome!"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: classes/class-flexible-shipping-plugin.php:
|
54 |
msgid "Really poor"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: classes/class-flexible-shipping-plugin.php:
|
58 |
msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: classes/class-flexible-shipping-plugin.php:
|
62 |
msgid "More calculation conditions"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: classes/class-flexible-shipping-plugin.php:
|
66 |
msgid "What exactly should the conditions you need be based on?"
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: classes/class-flexible-shipping-plugin.php:
|
70 |
msgid "More detailed documentation"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: classes/class-flexible-shipping-plugin.php:
|
74 |
msgid "Easier contact with support"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: classes/class-flexible-shipping-plugin.php:
|
78 |
msgid "More user-friendly interface"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: classes/class-flexible-shipping-plugin.php:
|
82 |
msgid "Less complicated settings"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: classes/class-flexible-shipping-plugin.php:
|
86 |
msgid "Too soon to say"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: classes/class-flexible-shipping-plugin.php:
|
90 |
#: classes/views/deactivation_thickbox.php:106
|
91 |
msgid "Other"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: classes/class-flexible-shipping-plugin.php:
|
95 |
msgid "Please tell us what exactly can we do to improve our plugin?"
|
96 |
msgstr ""
|
97 |
|
98 |
#. Translators: link.
|
99 |
-
#: classes/class-flexible-shipping-plugin.php:
|
100 |
msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: classes/class-flexible-shipping-plugin.php:
|
104 |
msgid "Settings"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: classes/class-flexible-shipping-plugin.php:
|
108 |
msgid "Docs"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: classes/class-flexible-shipping-plugin.php:
|
112 |
msgid "Support"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: classes/class-flexible-shipping-plugin.php:
|
116 |
msgid "Upgrade"
|
117 |
msgstr ""
|
118 |
|
@@ -380,7 +380,7 @@ msgid "Shipping method %s updated."
|
|
380 |
msgstr ""
|
381 |
|
382 |
#: classes/table-rate/shipping-method.php:562
|
383 |
-
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:
|
384 |
msgid "Shipping cost added."
|
385 |
msgstr ""
|
386 |
|
@@ -510,7 +510,7 @@ msgstr ""
|
|
510 |
#: classes/table-rate/views/html-shipping-method-settings.php:46
|
511 |
#: classes/table-rate/views/html-shipping-method-settings.php:53
|
512 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
513 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
514 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
|
515 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
|
516 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
|
@@ -766,7 +766,7 @@ msgstr ""
|
|
766 |
msgid "Free Shipping"
|
767 |
msgstr ""
|
768 |
|
769 |
-
#: src/WPDesk/FS/Onboarding/TableRate/Onboarding.php:
|
770 |
msgid "Step #"
|
771 |
msgstr ""
|
772 |
|
@@ -1115,7 +1115,7 @@ msgstr ""
|
|
1115 |
|
1116 |
#. Translators: condition name.
|
1117 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:132
|
1118 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
1119 |
msgid "Condition: %1$s;"
|
1120 |
msgstr ""
|
1121 |
|
@@ -1126,7 +1126,7 @@ msgstr ""
|
|
1126 |
|
1127 |
#. Translators: matched condition.
|
1128 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
1129 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
1130 |
msgid " matched: %1$s"
|
1131 |
msgstr ""
|
1132 |
|
@@ -1134,18 +1134,18 @@ msgstr ""
|
|
1134 |
#. Translators: add method.
|
1135 |
#. Translators: free shipping.
|
1136 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
1137 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
1138 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
|
1139 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
|
1140 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
|
1141 |
msgid "no"
|
1142 |
msgstr ""
|
1143 |
|
1144 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
1145 |
msgid "Always"
|
1146 |
msgstr ""
|
1147 |
|
1148 |
-
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:
|
1149 |
msgid "Fixed shipping cost"
|
1150 |
msgstr ""
|
1151 |
|
@@ -1507,12 +1507,12 @@ msgstr ""
|
|
1507 |
msgid "Choose whether the shipping cost defined in the rules table should be inclusive or exclusive of tax."
|
1508 |
msgstr ""
|
1509 |
|
1510 |
-
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:
|
1511 |
msgid "A single Flexible Shipping method."
|
1512 |
msgstr ""
|
1513 |
|
1514 |
#. Translators: docs link.
|
1515 |
-
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:
|
1516 |
msgid "A single Flexible Shipping method. Learn %1$show to configure FS shipping method →%2$s"
|
1517 |
msgstr ""
|
1518 |
|
@@ -1530,7 +1530,7 @@ msgid "Need more? Check %1$sFlexible Shipping PRO%2$s to unleash its full potent
|
|
1530 |
msgstr ""
|
1531 |
|
1532 |
#. Translators: open tag, close tag.
|
1533 |
-
#: src/WPDesk/FS/TableRate/views/shipping-method-settings-rules.php:
|
1534 |
msgid "Want to find out how the table rate works? Hop on board and %1$slet us guide you through the whole setup →%2$s"
|
1535 |
msgstr ""
|
1536 |
|
2 |
# This file is distributed under the same license as the Flexible Shipping plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Flexible Shipping 4.9.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2021-10-21T06:33:36+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: flexible-shipping\n"
|
22 |
#: classes/table-rate/settings/flexible-shipping.php:33
|
23 |
#: classes/table-rate/shipping-method.php:95
|
24 |
#: src/WPDesk/FS/TableRate/ShippingMethod/CommonMethodSettings.php:153
|
25 |
+
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:63
|
26 |
msgid "Flexible Shipping"
|
27 |
msgstr ""
|
28 |
|
42 |
msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: classes/class-flexible-shipping-plugin.php:298
|
46 |
msgid "Hey, we are curious how would you grade your first impression on Flexible Shipping so far?"
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: classes/class-flexible-shipping-plugin.php:299
|
50 |
msgid "Wow, it's awesome!"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: classes/class-flexible-shipping-plugin.php:300
|
54 |
msgid "Really poor"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: classes/class-flexible-shipping-plugin.php:303
|
58 |
msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: classes/class-flexible-shipping-plugin.php:309
|
62 |
msgid "More calculation conditions"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: classes/class-flexible-shipping-plugin.php:309
|
66 |
msgid "What exactly should the conditions you need be based on?"
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: classes/class-flexible-shipping-plugin.php:310
|
70 |
msgid "More detailed documentation"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: classes/class-flexible-shipping-plugin.php:311
|
74 |
msgid "Easier contact with support"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: classes/class-flexible-shipping-plugin.php:312
|
78 |
msgid "More user-friendly interface"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: classes/class-flexible-shipping-plugin.php:313
|
82 |
msgid "Less complicated settings"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: classes/class-flexible-shipping-plugin.php:314
|
86 |
msgid "Too soon to say"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: classes/class-flexible-shipping-plugin.php:315
|
90 |
#: classes/views/deactivation_thickbox.php:106
|
91 |
msgid "Other"
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: classes/class-flexible-shipping-plugin.php:315
|
95 |
msgid "Please tell us what exactly can we do to improve our plugin?"
|
96 |
msgstr ""
|
97 |
|
98 |
#. Translators: link.
|
99 |
+
#: classes/class-flexible-shipping-plugin.php:760
|
100 |
msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: classes/class-flexible-shipping-plugin.php:841
|
104 |
msgid "Settings"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: classes/class-flexible-shipping-plugin.php:845
|
108 |
msgid "Docs"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: classes/class-flexible-shipping-plugin.php:846
|
112 |
msgid "Support"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: classes/class-flexible-shipping-plugin.php:852
|
116 |
msgid "Upgrade"
|
117 |
msgstr ""
|
118 |
|
380 |
msgstr ""
|
381 |
|
382 |
#: classes/table-rate/shipping-method.php:562
|
383 |
+
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:277
|
384 |
msgid "Shipping cost added."
|
385 |
msgstr ""
|
386 |
|
510 |
#: classes/table-rate/views/html-shipping-method-settings.php:46
|
511 |
#: classes/table-rate/views/html-shipping-method-settings.php:53
|
512 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
513 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:64
|
514 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
|
515 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
|
516 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
|
766 |
msgid "Free Shipping"
|
767 |
msgstr ""
|
768 |
|
769 |
+
#: src/WPDesk/FS/Onboarding/TableRate/Onboarding.php:115
|
770 |
msgid "Step #"
|
771 |
msgstr ""
|
772 |
|
1115 |
|
1116 |
#. Translators: condition name.
|
1117 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:132
|
1118 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:62
|
1119 |
msgid "Condition: %1$s;"
|
1120 |
msgstr ""
|
1121 |
|
1126 |
|
1127 |
#. Translators: matched condition.
|
1128 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
1129 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:64
|
1130 |
msgid " matched: %1$s"
|
1131 |
msgstr ""
|
1132 |
|
1134 |
#. Translators: add method.
|
1135 |
#. Translators: free shipping.
|
1136 |
#: src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php:151
|
1137 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:64
|
1138 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:252
|
1139 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:258
|
1140 |
#: src/WPDesk/FS/TableRate/ShippingMethod/RateCalculator.php:269
|
1141 |
msgid "no"
|
1142 |
msgstr ""
|
1143 |
|
1144 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:28
|
1145 |
msgid "Always"
|
1146 |
msgstr ""
|
1147 |
|
1148 |
+
#: src/WPDesk/FS/TableRate/Rule/Condition/None.php:29
|
1149 |
msgid "Fixed shipping cost"
|
1150 |
msgstr ""
|
1151 |
|
1507 |
msgid "Choose whether the shipping cost defined in the rules table should be inclusive or exclusive of tax."
|
1508 |
msgstr ""
|
1509 |
|
1510 |
+
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:64
|
1511 |
msgid "A single Flexible Shipping method."
|
1512 |
msgstr ""
|
1513 |
|
1514 |
#. Translators: docs link.
|
1515 |
+
#: src/WPDesk/FS/TableRate/ShippingMethodSingle.php:69
|
1516 |
msgid "A single Flexible Shipping method. Learn %1$show to configure FS shipping method →%2$s"
|
1517 |
msgstr ""
|
1518 |
|
1530 |
msgstr ""
|
1531 |
|
1532 |
#. Translators: open tag, close tag.
|
1533 |
+
#: src/WPDesk/FS/TableRate/views/shipping-method-settings-rules.php:66
|
1534 |
msgid "Want to find out how the table rate works? Hop on board and %1$slet us guide you through the whole setup →%2$s"
|
1535 |
msgstr ""
|
1536 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocomm
|
|
4 |
Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 4.
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -200,6 +200,10 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
|
|
200 |
|
201 |
== Changelog ==
|
202 |
|
|
|
|
|
|
|
|
|
203 |
= 4.8.5 - 2021-10-12 =
|
204 |
* Fixed integration metabox CSS
|
205 |
* Fixed fatal error on fs-shipment library
|
4 |
Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 4.9.0
|
8 |
Requires PHP: 7.0
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
200 |
|
201 |
== Changelog ==
|
202 |
|
203 |
+
= 4.9.0 - 2021-10-12 =
|
204 |
+
* Added default rule for new shipping method
|
205 |
+
* Added support for Onboarding in FS PRO
|
206 |
+
|
207 |
= 4.8.5 - 2021-10-12 =
|
208 |
* Fixed integration metabox CSS
|
209 |
* Fixed fatal error on fs-shipment library
|
src/WPDesk/FS/Helpers/FlexibleShippingMethodsChecker.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class FlexibleShippingMethodsChecker
|
4 |
+
*
|
5 |
+
* @package WPDesk\FS\Helpers
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDesk\FS\Helpers;
|
9 |
+
|
10 |
+
use WPDesk\FS\TableRate\DefaultRulesSettings;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Checker for FS Methods.
|
14 |
+
*/
|
15 |
+
class FlexibleShippingMethodsChecker {
|
16 |
+
/**
|
17 |
+
* @return bool
|
18 |
+
*/
|
19 |
+
public function is_new_shipping_method(): bool {
|
20 |
+
$shipping_methods = flexible_shipping_get_all_shipping_methods();
|
21 |
+
|
22 |
+
if ( ! isset( $shipping_methods['flexible_shipping'] ) ) {
|
23 |
+
return false;
|
24 |
+
}
|
25 |
+
|
26 |
+
$flexible_shipping_rates = array_values( $shipping_methods['flexible_shipping']->get_all_rates() );
|
27 |
+
|
28 |
+
if ( empty( $flexible_shipping_rates ) || count( $flexible_shipping_rates ) > 1 ) {
|
29 |
+
return false;
|
30 |
+
}
|
31 |
+
|
32 |
+
return isset( $flexible_shipping_rates[0]['method_rules'][0][ DefaultRulesSettings::NEW_FIELD ] );
|
33 |
+
}
|
34 |
+
}
|
src/WPDesk/FS/Helpers/WooSettingsPageChecker.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class WooSettingsPageChecker
|
4 |
+
*
|
5 |
+
* @package WPDesk\FS\Helpers
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDesk\FS\Helpers;
|
9 |
+
|
10 |
+
use WC_Shipping_Method;
|
11 |
+
use WC_Shipping_Zones;
|
12 |
+
use WPDesk\FS\TableRate\ShippingMethodSingle;
|
13 |
+
use WPDesk_Flexible_Shipping;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Helper for WooCommerce Settings Page.
|
17 |
+
*/
|
18 |
+
class WooSettingsPageChecker {
|
19 |
+
/**
|
20 |
+
* @return bool
|
21 |
+
*/
|
22 |
+
public function is_fs_instance_method_edit(): bool {
|
23 |
+
$tab = $this->filter_input( INPUT_GET, 'tab' );
|
24 |
+
$page = $this->filter_input( INPUT_GET, 'page' );
|
25 |
+
|
26 |
+
if ( 'wc-settings' !== $page || 'shipping' !== $tab ) {
|
27 |
+
return false;
|
28 |
+
}
|
29 |
+
|
30 |
+
$instance_id = absint( wp_unslash( $this->filter_input( INPUT_GET, 'instance_id' ) ) );
|
31 |
+
|
32 |
+
if ( ! $instance_id ) {
|
33 |
+
return false;
|
34 |
+
}
|
35 |
+
|
36 |
+
$shipping_method = $this->get_shipping_method( $instance_id );
|
37 |
+
|
38 |
+
if ( ! $shipping_method ) {
|
39 |
+
return false;
|
40 |
+
}
|
41 |
+
|
42 |
+
return is_a( $shipping_method, WPDesk_Flexible_Shipping::class ) || is_a( $shipping_method, ShippingMethodSingle::class );
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @param int $instance_id .
|
47 |
+
*
|
48 |
+
* @return bool|WC_Shipping_Method
|
49 |
+
* @codeCoverageIgnore
|
50 |
+
*/
|
51 |
+
protected function get_shipping_method( int $instance_id ) {
|
52 |
+
return WC_Shipping_Zones::get_shipping_method( $instance_id );
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param int $type .
|
57 |
+
* @param string $var_name .
|
58 |
+
*
|
59 |
+
* @return mixed
|
60 |
+
* @codeCoverageIgnore
|
61 |
+
*/
|
62 |
+
protected function filter_input( int $type, string $var_name ) {
|
63 |
+
return filter_input( $type, $var_name );
|
64 |
+
}
|
65 |
+
}
|
src/WPDesk/FS/Onboarding/TableRate/FinishOption.php
CHANGED
@@ -17,15 +17,15 @@ class FinishOption {
|
|
17 |
* Get option value.
|
18 |
*
|
19 |
* @param string $key .
|
20 |
-
* @param
|
21 |
*
|
22 |
* @return mixed
|
23 |
*/
|
24 |
-
public function get_option_value( $key = '', $default = false ) {
|
25 |
$options = $this->get_options();
|
26 |
|
27 |
if ( $key ) {
|
28 |
-
return
|
29 |
}
|
30 |
|
31 |
return $options;
|
@@ -36,7 +36,7 @@ class FinishOption {
|
|
36 |
*
|
37 |
* @return bool Option status.
|
38 |
*/
|
39 |
-
public function is_option_set() {
|
40 |
return false !== get_option( self::OPTION_NAME, false );
|
41 |
}
|
42 |
|
@@ -46,7 +46,7 @@ class FinishOption {
|
|
46 |
*
|
47 |
* @return bool
|
48 |
*/
|
49 |
-
public function update_option( $option_key, $option_value ) {
|
50 |
$options = $this->get_options();
|
51 |
|
52 |
$options[ $option_key ] = $option_value;
|
@@ -57,7 +57,7 @@ class FinishOption {
|
|
57 |
/**
|
58 |
* @return array
|
59 |
*/
|
60 |
-
private function get_options() {
|
61 |
$options = get_option( self::OPTION_NAME, [] );
|
62 |
|
63 |
if ( ! is_array( $options ) ) {
|
@@ -70,7 +70,7 @@ class FinishOption {
|
|
70 |
/**
|
71 |
* @return array
|
72 |
*/
|
73 |
-
private function get_default_option_values() {
|
74 |
return [
|
75 |
'clicks' => 0,
|
76 |
'event' => 'none',
|
17 |
* Get option value.
|
18 |
*
|
19 |
* @param string $key .
|
20 |
+
* @param mixed $default .
|
21 |
*
|
22 |
* @return mixed
|
23 |
*/
|
24 |
+
public function get_option_value( string $key = '', $default = false ) {
|
25 |
$options = $this->get_options();
|
26 |
|
27 |
if ( $key ) {
|
28 |
+
return $options[ $key ] ?? $default;
|
29 |
}
|
30 |
|
31 |
return $options;
|
36 |
*
|
37 |
* @return bool Option status.
|
38 |
*/
|
39 |
+
public function is_option_set(): bool {
|
40 |
return false !== get_option( self::OPTION_NAME, false );
|
41 |
}
|
42 |
|
46 |
*
|
47 |
* @return bool
|
48 |
*/
|
49 |
+
public function update_option( string $option_key, $option_value ): bool {
|
50 |
$options = $this->get_options();
|
51 |
|
52 |
$options[ $option_key ] = $option_value;
|
57 |
/**
|
58 |
* @return array
|
59 |
*/
|
60 |
+
private function get_options(): array {
|
61 |
$options = get_option( self::OPTION_NAME, [] );
|
62 |
|
63 |
if ( ! is_array( $options ) ) {
|
70 |
/**
|
71 |
* @return array
|
72 |
*/
|
73 |
+
private function get_default_option_values(): array {
|
74 |
return [
|
75 |
'clicks' => 0,
|
76 |
'event' => 'none',
|
src/WPDesk/FS/Onboarding/TableRate/Onboarding.php
CHANGED
@@ -7,16 +7,15 @@
|
|
7 |
|
8 |
namespace WPDesk\FS\Onboarding\TableRate;
|
9 |
|
10 |
-
use Flexible_Shipping_Plugin;
|
11 |
use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
12 |
-
use
|
13 |
-
use WPDesk\FS\
|
14 |
-
use WPDesk_Flexible_Shipping;
|
15 |
|
16 |
/**
|
17 |
* Onboarding hooks.
|
18 |
*/
|
19 |
class Onboarding implements Hookable {
|
|
|
20 |
/**
|
21 |
* @var FinishOption .
|
22 |
*/
|
@@ -33,31 +32,48 @@ class Onboarding implements Hookable {
|
|
33 |
private $plugin_assets_url;
|
34 |
|
35 |
/**
|
36 |
-
*
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
*/
|
42 |
-
public function __construct(
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
* Hooks.
|
50 |
*/
|
51 |
public function hooks() {
|
52 |
-
add_action( 'flexible-shipping/admin/enqueue_scripts',
|
53 |
-
|
54 |
-
add_action(
|
55 |
-
'flexible-shipping/method-rules-settings/table/before',
|
56 |
-
array(
|
57 |
-
$this,
|
58 |
-
'add_onboarding_container',
|
59 |
-
)
|
60 |
-
);
|
61 |
}
|
62 |
|
63 |
/**
|
@@ -67,26 +83,17 @@ class Onboarding implements Hookable {
|
|
67 |
include wp_normalize_path( __DIR__ . '/views/before-table-method-rules-settings.php' );
|
68 |
}
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
* @param string $suffix .
|
73 |
-
*/
|
74 |
-
public function register_scripts( Flexible_Shipping_Plugin $plugin, $suffix ) {
|
75 |
-
if ( ! $this->should_load_onboarding() ) {
|
76 |
return;
|
77 |
}
|
78 |
|
79 |
-
wp_enqueue_style(
|
80 |
-
'wpdesk_onboarding',
|
81 |
-
sprintf( '%scss/onboarding.css', $this->plugin_assets_url ),
|
82 |
-
array(),
|
83 |
-
$this->scripts_version
|
84 |
-
);
|
85 |
|
86 |
wp_enqueue_script(
|
87 |
'wpdesk_onboarding',
|
88 |
sprintf( '%sjs/onboarding.js', $this->plugin_assets_url ),
|
89 |
-
|
90 |
$this->scripts_version,
|
91 |
true
|
92 |
);
|
@@ -94,91 +101,31 @@ class Onboarding implements Hookable {
|
|
94 |
wp_localize_script(
|
95 |
'wpdesk_onboarding',
|
96 |
'fs_onboarding_details',
|
97 |
-
|
98 |
-
'ajax' =>
|
99 |
'url' => admin_url( 'admin-ajax.php' ),
|
100 |
'nonce' => wp_create_nonce( OptionAjaxUpdater::NONCE_ACTION ),
|
101 |
-
'action' =>
|
102 |
'event' => OptionAjaxUpdater::AJAX_ACTION_EVENT,
|
103 |
'click' => OptionAjaxUpdater::AJAX_ACTION_CLICK,
|
104 |
'auto_show_popup' => OptionAjaxUpdater::AJAX_ACTION_AUTO_SHOP_POPUP,
|
105 |
-
|
106 |
-
|
107 |
'assets_url' => untrailingslashit( $this->plugin_assets_url ),
|
108 |
'label_step' => __( 'Step #', 'flexible-shipping' ),
|
109 |
'logo_img' => 'logo-fs.svg',
|
110 |
'steps' => 4,
|
111 |
'locale' => get_user_locale(),
|
112 |
'open_auto' => $this->should_auto_load(),
|
113 |
-
'popups' =>
|
114 |
-
|
115 |
);
|
116 |
}
|
117 |
|
118 |
/**
|
119 |
* @return bool
|
120 |
*/
|
121 |
-
private function should_auto_load() {
|
122 |
-
|
123 |
-
return false;
|
124 |
-
}
|
125 |
-
|
126 |
-
if ( $this->has_fs_methods() ) {
|
127 |
-
return false;
|
128 |
-
}
|
129 |
-
|
130 |
-
return true;
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* @return bool
|
135 |
-
*/
|
136 |
-
private function has_fs_methods() {
|
137 |
-
$all_shipping_methods = flexible_shipping_get_all_shipping_methods();
|
138 |
-
$flexible_shipping = $all_shipping_methods['flexible_shipping'];
|
139 |
-
|
140 |
-
$flexible_shipping_rates = $flexible_shipping->get_all_rates();
|
141 |
-
|
142 |
-
if ( empty( $flexible_shipping_rates ) ) {
|
143 |
-
return false;
|
144 |
-
}
|
145 |
-
|
146 |
-
foreach ( $flexible_shipping_rates as $flexible_shipping_rate ) {
|
147 |
-
if ( isset( $flexible_shipping_rate['method_rules'][0]['cost_per_order'] ) ) {
|
148 |
-
return true;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* @return bool
|
157 |
-
*/
|
158 |
-
private function should_load_onboarding() {
|
159 |
-
$tab = filter_input( INPUT_GET, 'tab' );
|
160 |
-
$page = filter_input( INPUT_GET, 'page' );
|
161 |
-
|
162 |
-
if ( 'wc-settings' !== $page || 'shipping' !== $tab ) {
|
163 |
-
return false;
|
164 |
-
}
|
165 |
-
|
166 |
-
$instance_id = absint( wp_unslash( filter_input( INPUT_GET, 'instance_id' ) ) );
|
167 |
-
|
168 |
-
if ( ! $instance_id ) {
|
169 |
-
return false;
|
170 |
-
}
|
171 |
-
|
172 |
-
$shipping_method = WC_Shipping_Zones::get_shipping_method( $instance_id );
|
173 |
-
|
174 |
-
if ( ! $shipping_method ) {
|
175 |
-
return false;
|
176 |
-
}
|
177 |
-
|
178 |
-
if ( ! is_a( $shipping_method, WPDesk_Flexible_Shipping::class ) && ! is_a( $shipping_method, ShippingMethodSingle::class ) ) {
|
179 |
-
return false;
|
180 |
-
}
|
181 |
-
|
182 |
-
return true;
|
183 |
}
|
184 |
}
|
7 |
|
8 |
namespace WPDesk\FS\Onboarding\TableRate;
|
9 |
|
|
|
10 |
use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
11 |
+
use WPDesk\FS\Helpers\FlexibleShippingMethodsChecker;
|
12 |
+
use WPDesk\FS\Helpers\WooSettingsPageChecker;
|
|
|
13 |
|
14 |
/**
|
15 |
* Onboarding hooks.
|
16 |
*/
|
17 |
class Onboarding implements Hookable {
|
18 |
+
|
19 |
/**
|
20 |
* @var FinishOption .
|
21 |
*/
|
32 |
private $plugin_assets_url;
|
33 |
|
34 |
/**
|
35 |
+
* @var WooSettingsPageChecker
|
36 |
+
*/
|
37 |
+
private $setting_page_checker;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @var FlexibleShippingMethodsChecker
|
41 |
+
*/
|
42 |
+
private $fs_methods_checker;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @var array
|
46 |
+
*/
|
47 |
+
private $popups;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @param FinishOption $finish_option .
|
51 |
+
* @param string $scripts_version .
|
52 |
+
* @param string $plugin_assets_url .
|
53 |
+
* @param WooSettingsPageChecker $setting_page_checker .
|
54 |
*/
|
55 |
+
public function __construct(
|
56 |
+
FinishOption $finish_option,
|
57 |
+
string $scripts_version,
|
58 |
+
string $plugin_assets_url,
|
59 |
+
WooSettingsPageChecker $setting_page_checker,
|
60 |
+
FlexibleShippingMethodsChecker $fs_methods_checker,
|
61 |
+
array $popups
|
62 |
+
) {
|
63 |
+
$this->finish_option = $finish_option;
|
64 |
+
$this->scripts_version = $scripts_version;
|
65 |
+
$this->plugin_assets_url = $plugin_assets_url;
|
66 |
+
$this->setting_page_checker = $setting_page_checker;
|
67 |
+
$this->fs_methods_checker = $fs_methods_checker;
|
68 |
+
$this->popups = $popups;
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
* Hooks.
|
73 |
*/
|
74 |
public function hooks() {
|
75 |
+
add_action( 'flexible-shipping/admin/enqueue_scripts', [ $this, 'register_scripts' ] );
|
76 |
+
add_action( 'flexible-shipping/method-rules-settings/table/before', [ $this, 'add_onboarding_container' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
83 |
include wp_normalize_path( __DIR__ . '/views/before-table-method-rules-settings.php' );
|
84 |
}
|
85 |
|
86 |
+
public function register_scripts() {
|
87 |
+
if ( ! $this->setting_page_checker->is_fs_instance_method_edit() ) {
|
|
|
|
|
|
|
|
|
88 |
return;
|
89 |
}
|
90 |
|
91 |
+
wp_enqueue_style( 'wpdesk_onboarding', sprintf( '%scss/onboarding.css', $this->plugin_assets_url ), [], $this->scripts_version );
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
wp_enqueue_script(
|
94 |
'wpdesk_onboarding',
|
95 |
sprintf( '%sjs/onboarding.js', $this->plugin_assets_url ),
|
96 |
+
[ 'jquery' ],
|
97 |
$this->scripts_version,
|
98 |
true
|
99 |
);
|
101 |
wp_localize_script(
|
102 |
'wpdesk_onboarding',
|
103 |
'fs_onboarding_details',
|
104 |
+
[
|
105 |
+
'ajax' => [
|
106 |
'url' => admin_url( 'admin-ajax.php' ),
|
107 |
'nonce' => wp_create_nonce( OptionAjaxUpdater::NONCE_ACTION ),
|
108 |
+
'action' => [
|
109 |
'event' => OptionAjaxUpdater::AJAX_ACTION_EVENT,
|
110 |
'click' => OptionAjaxUpdater::AJAX_ACTION_CLICK,
|
111 |
'auto_show_popup' => OptionAjaxUpdater::AJAX_ACTION_AUTO_SHOP_POPUP,
|
112 |
+
],
|
113 |
+
],
|
114 |
'assets_url' => untrailingslashit( $this->plugin_assets_url ),
|
115 |
'label_step' => __( 'Step #', 'flexible-shipping' ),
|
116 |
'logo_img' => 'logo-fs.svg',
|
117 |
'steps' => 4,
|
118 |
'locale' => get_user_locale(),
|
119 |
'open_auto' => $this->should_auto_load(),
|
120 |
+
'popups' => $this->popups,
|
121 |
+
]
|
122 |
);
|
123 |
}
|
124 |
|
125 |
/**
|
126 |
* @return bool
|
127 |
*/
|
128 |
+
private function should_auto_load(): bool {
|
129 |
+
return ! $this->finish_option->is_option_set() && $this->fs_methods_checker->is_new_shipping_method();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
}
|
131 |
}
|
src/WPDesk/FS/Onboarding/TableRate/OptionAjaxUpdater.php
CHANGED
@@ -29,7 +29,7 @@ class OptionAjaxUpdater implements Hookable {
|
|
29 |
*
|
30 |
* @param FinishOption $option .
|
31 |
*/
|
32 |
-
public function __construct( $option ) {
|
33 |
$this->option = $option;
|
34 |
}
|
35 |
|
@@ -50,17 +50,17 @@ class OptionAjaxUpdater implements Hookable {
|
|
50 |
public function handle_ajax_action_event() {
|
51 |
check_ajax_referer( self::NONCE_ACTION );
|
52 |
|
53 |
-
$event = filter_input( INPUT_POST, 'event' );
|
54 |
-
$step = (int) filter_input( INPUT_POST, 'step' );
|
55 |
|
56 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
57 |
wp_send_json_error();
|
58 |
}
|
59 |
-
|
60 |
-
$this->option->update_option( 'event', sanitize_text_field( $event ) );
|
61 |
-
$this->option->update_option( 'step', $step );
|
62 |
-
|
63 |
-
wp_send_json_success();
|
64 |
}
|
65 |
|
66 |
/**
|
@@ -91,4 +91,15 @@ class OptionAjaxUpdater implements Hookable {
|
|
91 |
|
92 |
wp_send_json_success();
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
29 |
*
|
30 |
* @param FinishOption $option .
|
31 |
*/
|
32 |
+
public function __construct( FinishOption $option ) {
|
33 |
$this->option = $option;
|
34 |
}
|
35 |
|
50 |
public function handle_ajax_action_event() {
|
51 |
check_ajax_referer( self::NONCE_ACTION );
|
52 |
|
53 |
+
$event = $this->filter_input( INPUT_POST, 'event' );
|
54 |
+
$step = (int) $this->filter_input( INPUT_POST, 'step' );
|
55 |
|
56 |
+
if ( $event ) {
|
57 |
+
$this->option->update_option( 'event', sanitize_text_field( $event ) );
|
58 |
+
$this->option->update_option( 'step', $step );
|
59 |
+
|
60 |
+
wp_send_json_success();
|
61 |
+
} else {
|
62 |
wp_send_json_error();
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
|
66 |
/**
|
91 |
|
92 |
wp_send_json_success();
|
93 |
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @param int $type .
|
97 |
+
* @param string $var_name .
|
98 |
+
*
|
99 |
+
* @return mixed
|
100 |
+
* @codeCoverageIgnore
|
101 |
+
*/
|
102 |
+
protected function filter_input( int $type, string $var_name ) {
|
103 |
+
return filter_input( $type, $var_name );
|
104 |
+
}
|
105 |
}
|
src/WPDesk/FS/Onboarding/TableRate/PopupData.php
CHANGED
@@ -16,21 +16,21 @@ class PopupData {
|
|
16 |
/**
|
17 |
* @return array[]
|
18 |
*/
|
19 |
-
public function get_popups() {
|
20 |
-
return
|
21 |
$this->get_popup_data_step_0(),
|
22 |
$this->get_popup_data_step_1(),
|
23 |
$this->get_popup_data_step_2(),
|
24 |
$this->get_popup_data_step_3(),
|
25 |
$this->get_popup_data_step_4(),
|
26 |
-
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
* @return array
|
31 |
*/
|
32 |
-
private function get_popup_data_step_0() {
|
33 |
-
return
|
34 |
'id' => 'step_0',
|
35 |
'logo' => true,
|
36 |
'title' => null,
|
@@ -38,34 +38,34 @@ class PopupData {
|
|
38 |
'show' => false,
|
39 |
'image' => 'start@2x.png',
|
40 |
'heading' => __( 'Find out how the rules table works', 'flexible-shipping' ),
|
41 |
-
'text' =>
|
42 |
sprintf(
|
43 |
// Translators: open and close strong tag.
|
44 |
__( '%1$sWe do our best to develop our plugins in response to your expectations. Not only do we want them to fit your needs but also offer a vast array of features and be easy to use at the same time. Explore the possibilities and learn how to use the rules table in just 4 steps!%2$s', 'flexible-shipping' ),
|
45 |
'<strong>',
|
46 |
'</strong>'
|
47 |
),
|
48 |
-
|
49 |
-
'buttons' =>
|
50 |
-
|
51 |
'label' => __( 'No, thank you.', 'flexible-shipping' ),
|
52 |
'action' => 'cancel',
|
53 |
'classes' => 'btn-link',
|
54 |
-
|
55 |
-
|
56 |
'label' => __( 'Start the tutorial', 'flexible-shipping' ),
|
57 |
'popup' => 'step_1',
|
58 |
'classes' => 'btn-success',
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* @return array
|
66 |
*/
|
67 |
-
private function get_popup_data_step_1() {
|
68 |
-
return
|
69 |
'id' => 'step_1',
|
70 |
'logo' => false,
|
71 |
'title' => null,
|
@@ -73,7 +73,7 @@ class PopupData {
|
|
73 |
'show' => false,
|
74 |
'image' => 'steps/' . $this->get_locale() . '/step-1.gif',
|
75 |
'heading' => __( 'Choose what the rule should be based on', 'flexible-shipping' ),
|
76 |
-
'text' =>
|
77 |
sprintf(
|
78 |
// Translators: open and close strong tag.
|
79 |
__( '%1$sIn the \'When\' column select the condition which the rule you are about to add will be based on and calculated.%2$s', 'flexible-shipping' ),
|
@@ -98,27 +98,27 @@ class PopupData {
|
|
98 |
'<strong>',
|
99 |
'</strong>'
|
100 |
),
|
101 |
-
|
102 |
-
'buttons' =>
|
103 |
-
|
104 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
105 |
'popup' => 'step_0',
|
106 |
'classes' => 'btn-link',
|
107 |
-
|
108 |
-
|
109 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
110 |
'popup' => 'step_2',
|
111 |
'classes' => 'btn-success',
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
* @return array
|
119 |
*/
|
120 |
-
private function get_popup_data_step_2() {
|
121 |
-
return
|
122 |
'id' => 'step_2',
|
123 |
'logo' => false,
|
124 |
'title' => null,
|
@@ -126,7 +126,7 @@ class PopupData {
|
|
126 |
'show' => false,
|
127 |
'image' => 'steps/' . $this->get_locale() . '/step-2.gif',
|
128 |
'heading' => __( 'Define the rule’s range', 'flexible-shipping' ),
|
129 |
-
'text' =>
|
130 |
__( 'Enter the minimum and maximum value for the selected condition to define the range when the rule will be applied.', 'flexible-shipping' ),
|
131 |
sprintf(
|
132 |
// Translators: open and close strong tag.
|
@@ -150,27 +150,27 @@ class PopupData {
|
|
150 |
'<strong>',
|
151 |
'</strong>'
|
152 |
),
|
153 |
-
|
154 |
-
'buttons' =>
|
155 |
-
|
156 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
157 |
'popup' => 'step_1',
|
158 |
'classes' => 'btn-link',
|
159 |
-
|
160 |
-
|
161 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
162 |
'popup' => 'step_3',
|
163 |
'classes' => 'btn-success',
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
}
|
168 |
|
169 |
/**
|
170 |
* @return array
|
171 |
*/
|
172 |
-
private function get_popup_data_step_3() {
|
173 |
-
return
|
174 |
'id' => 'step_3',
|
175 |
'logo' => false,
|
176 |
'title' => null,
|
@@ -178,7 +178,7 @@ class PopupData {
|
|
178 |
'show' => false,
|
179 |
'image' => 'steps/' . $this->get_locale() . '/step-3.gif',
|
180 |
'heading' => __( 'Determine the shipping cost', 'flexible-shipping' ),
|
181 |
-
'text' =>
|
182 |
__( 'Enter the shipping cost, which will be added to the order’s price when the condition you’ve set in the previous step is met.', 'flexible-shipping' ),
|
183 |
sprintf(
|
184 |
// Translators: open and close strong tag.
|
@@ -188,27 +188,27 @@ class PopupData {
|
|
188 |
'<strong>',
|
189 |
'</strong>'
|
190 |
),
|
191 |
-
|
192 |
-
'buttons' =>
|
193 |
-
|
194 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
195 |
'popup' => 'step_2',
|
196 |
'classes' => 'btn-link',
|
197 |
-
|
198 |
-
|
199 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
200 |
'popup' => 'step_4',
|
201 |
'classes' => 'btn-success',
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
}
|
206 |
|
207 |
/**
|
208 |
* @return array
|
209 |
*/
|
210 |
-
private function get_popup_data_step_4() {
|
211 |
-
return
|
212 |
'id' => 'step_4',
|
213 |
'logo' => false,
|
214 |
'title' => null,
|
@@ -216,7 +216,7 @@ class PopupData {
|
|
216 |
'show' => false,
|
217 |
'image' => 'steps/' . $this->get_locale() . '/step-4.gif',
|
218 |
'heading' => __( 'Add more and combine the rules!', 'flexible-shipping' ),
|
219 |
-
'text' =>
|
220 |
sprintf(
|
221 |
// Translators: open and close strong tag.
|
222 |
__( 'Configure even the most advanced shipping scenarios by adding and combining the shipping cost calculation rules. Precisely define how the shipping cost should be calculated or import and adapt one of our %1$sready-to-use scenarios%2$s to your needs. Read the %3$sFlexible Shipping plugin documentation%4$s and discover its endless possibilities!', 'flexible-shipping' ),
|
@@ -233,29 +233,29 @@ class PopupData {
|
|
233 |
),
|
234 |
'</a>'
|
235 |
),
|
236 |
-
|
237 |
-
'buttons' =>
|
238 |
-
|
239 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
240 |
'popup' => 'step_3',
|
241 |
'classes' => 'btn-link',
|
242 |
-
|
243 |
-
|
244 |
'label' => __( 'Proceed to adding the rules', 'flexible-shipping' ),
|
245 |
'action' => 'finish',
|
246 |
'classes' => 'btn-success',
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
}
|
251 |
|
252 |
/**
|
253 |
* @return string
|
254 |
*/
|
255 |
-
private function get_locale() {
|
256 |
$locale = get_user_locale();
|
257 |
|
258 |
-
if (
|
259 |
return $locale;
|
260 |
}
|
261 |
|
16 |
/**
|
17 |
* @return array[]
|
18 |
*/
|
19 |
+
public function get_popups(): array {
|
20 |
+
return [
|
21 |
$this->get_popup_data_step_0(),
|
22 |
$this->get_popup_data_step_1(),
|
23 |
$this->get_popup_data_step_2(),
|
24 |
$this->get_popup_data_step_3(),
|
25 |
$this->get_popup_data_step_4(),
|
26 |
+
];
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
* @return array
|
31 |
*/
|
32 |
+
private function get_popup_data_step_0(): array {
|
33 |
+
return [
|
34 |
'id' => 'step_0',
|
35 |
'logo' => true,
|
36 |
'title' => null,
|
38 |
'show' => false,
|
39 |
'image' => 'start@2x.png',
|
40 |
'heading' => __( 'Find out how the rules table works', 'flexible-shipping' ),
|
41 |
+
'text' => [
|
42 |
sprintf(
|
43 |
// Translators: open and close strong tag.
|
44 |
__( '%1$sWe do our best to develop our plugins in response to your expectations. Not only do we want them to fit your needs but also offer a vast array of features and be easy to use at the same time. Explore the possibilities and learn how to use the rules table in just 4 steps!%2$s', 'flexible-shipping' ),
|
45 |
'<strong>',
|
46 |
'</strong>'
|
47 |
),
|
48 |
+
],
|
49 |
+
'buttons' => [
|
50 |
+
[
|
51 |
'label' => __( 'No, thank you.', 'flexible-shipping' ),
|
52 |
'action' => 'cancel',
|
53 |
'classes' => 'btn-link',
|
54 |
+
],
|
55 |
+
[
|
56 |
'label' => __( 'Start the tutorial', 'flexible-shipping' ),
|
57 |
'popup' => 'step_1',
|
58 |
'classes' => 'btn-success',
|
59 |
+
],
|
60 |
+
],
|
61 |
+
];
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* @return array
|
66 |
*/
|
67 |
+
private function get_popup_data_step_1(): array {
|
68 |
+
return [
|
69 |
'id' => 'step_1',
|
70 |
'logo' => false,
|
71 |
'title' => null,
|
73 |
'show' => false,
|
74 |
'image' => 'steps/' . $this->get_locale() . '/step-1.gif',
|
75 |
'heading' => __( 'Choose what the rule should be based on', 'flexible-shipping' ),
|
76 |
+
'text' => [
|
77 |
sprintf(
|
78 |
// Translators: open and close strong tag.
|
79 |
__( '%1$sIn the \'When\' column select the condition which the rule you are about to add will be based on and calculated.%2$s', 'flexible-shipping' ),
|
98 |
'<strong>',
|
99 |
'</strong>'
|
100 |
),
|
101 |
+
],
|
102 |
+
'buttons' => [
|
103 |
+
[
|
104 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
105 |
'popup' => 'step_0',
|
106 |
'classes' => 'btn-link',
|
107 |
+
],
|
108 |
+
[
|
109 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
110 |
'popup' => 'step_2',
|
111 |
'classes' => 'btn-success',
|
112 |
+
],
|
113 |
+
],
|
114 |
+
];
|
115 |
}
|
116 |
|
117 |
/**
|
118 |
* @return array
|
119 |
*/
|
120 |
+
private function get_popup_data_step_2(): array {
|
121 |
+
return [
|
122 |
'id' => 'step_2',
|
123 |
'logo' => false,
|
124 |
'title' => null,
|
126 |
'show' => false,
|
127 |
'image' => 'steps/' . $this->get_locale() . '/step-2.gif',
|
128 |
'heading' => __( 'Define the rule’s range', 'flexible-shipping' ),
|
129 |
+
'text' => [
|
130 |
__( 'Enter the minimum and maximum value for the selected condition to define the range when the rule will be applied.', 'flexible-shipping' ),
|
131 |
sprintf(
|
132 |
// Translators: open and close strong tag.
|
150 |
'<strong>',
|
151 |
'</strong>'
|
152 |
),
|
153 |
+
],
|
154 |
+
'buttons' => [
|
155 |
+
[
|
156 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
157 |
'popup' => 'step_1',
|
158 |
'classes' => 'btn-link',
|
159 |
+
],
|
160 |
+
[
|
161 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
162 |
'popup' => 'step_3',
|
163 |
'classes' => 'btn-success',
|
164 |
+
],
|
165 |
+
],
|
166 |
+
];
|
167 |
}
|
168 |
|
169 |
/**
|
170 |
* @return array
|
171 |
*/
|
172 |
+
private function get_popup_data_step_3(): array {
|
173 |
+
return [
|
174 |
'id' => 'step_3',
|
175 |
'logo' => false,
|
176 |
'title' => null,
|
178 |
'show' => false,
|
179 |
'image' => 'steps/' . $this->get_locale() . '/step-3.gif',
|
180 |
'heading' => __( 'Determine the shipping cost', 'flexible-shipping' ),
|
181 |
+
'text' => [
|
182 |
__( 'Enter the shipping cost, which will be added to the order’s price when the condition you’ve set in the previous step is met.', 'flexible-shipping' ),
|
183 |
sprintf(
|
184 |
// Translators: open and close strong tag.
|
188 |
'<strong>',
|
189 |
'</strong>'
|
190 |
),
|
191 |
+
],
|
192 |
+
'buttons' => [
|
193 |
+
[
|
194 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
195 |
'popup' => 'step_2',
|
196 |
'classes' => 'btn-link',
|
197 |
+
],
|
198 |
+
[
|
199 |
'label' => __( 'Next step', 'flexible-shipping' ),
|
200 |
'popup' => 'step_4',
|
201 |
'classes' => 'btn-success',
|
202 |
+
],
|
203 |
+
],
|
204 |
+
];
|
205 |
}
|
206 |
|
207 |
/**
|
208 |
* @return array
|
209 |
*/
|
210 |
+
private function get_popup_data_step_4(): array {
|
211 |
+
return [
|
212 |
'id' => 'step_4',
|
213 |
'logo' => false,
|
214 |
'title' => null,
|
216 |
'show' => false,
|
217 |
'image' => 'steps/' . $this->get_locale() . '/step-4.gif',
|
218 |
'heading' => __( 'Add more and combine the rules!', 'flexible-shipping' ),
|
219 |
+
'text' => [
|
220 |
sprintf(
|
221 |
// Translators: open and close strong tag.
|
222 |
__( 'Configure even the most advanced shipping scenarios by adding and combining the shipping cost calculation rules. Precisely define how the shipping cost should be calculated or import and adapt one of our %1$sready-to-use scenarios%2$s to your needs. Read the %3$sFlexible Shipping plugin documentation%4$s and discover its endless possibilities!', 'flexible-shipping' ),
|
233 |
),
|
234 |
'</a>'
|
235 |
),
|
236 |
+
],
|
237 |
+
'buttons' => [
|
238 |
+
[
|
239 |
'label' => __( 'Previous step', 'flexible-shipping' ),
|
240 |
'popup' => 'step_3',
|
241 |
'classes' => 'btn-link',
|
242 |
+
],
|
243 |
+
[
|
244 |
'label' => __( 'Proceed to adding the rules', 'flexible-shipping' ),
|
245 |
'action' => 'finish',
|
246 |
'classes' => 'btn-success',
|
247 |
+
],
|
248 |
+
],
|
249 |
+
];
|
250 |
}
|
251 |
|
252 |
/**
|
253 |
* @return string
|
254 |
*/
|
255 |
+
private function get_locale(): string {
|
256 |
$locale = get_user_locale();
|
257 |
|
258 |
+
if ( 'pl_PL' === $locale ) {
|
259 |
return $locale;
|
260 |
}
|
261 |
|
src/WPDesk/FS/Onboarding/TableRate/Tracker.php
CHANGED
@@ -13,6 +13,7 @@ use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
|
13 |
* Class Tracker
|
14 |
*/
|
15 |
class Tracker implements Hookable {
|
|
|
16 |
/**
|
17 |
* @var FinishOption
|
18 |
*/
|
@@ -23,7 +24,7 @@ class Tracker implements Hookable {
|
|
23 |
*
|
24 |
* @param FinishOption $option .
|
25 |
*/
|
26 |
-
public function __construct( $option ) {
|
27 |
$this->option = $option;
|
28 |
}
|
29 |
|
@@ -31,7 +32,7 @@ class Tracker implements Hookable {
|
|
31 |
* Hooks.
|
32 |
*/
|
33 |
public function hooks() {
|
34 |
-
add_filter( 'wpdesk_tracker_data',
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -41,7 +42,7 @@ class Tracker implements Hookable {
|
|
41 |
*
|
42 |
* @return array
|
43 |
*/
|
44 |
-
public function add_tracking_data( $data ) {
|
45 |
$data['flexible_shipping']['onboarding']['table_rate'] = $this->option->get_option_value();
|
46 |
|
47 |
return $data;
|
13 |
* Class Tracker
|
14 |
*/
|
15 |
class Tracker implements Hookable {
|
16 |
+
|
17 |
/**
|
18 |
* @var FinishOption
|
19 |
*/
|
24 |
*
|
25 |
* @param FinishOption $option .
|
26 |
*/
|
27 |
+
public function __construct( FinishOption $option ) {
|
28 |
$this->option = $option;
|
29 |
}
|
30 |
|
32 |
* Hooks.
|
33 |
*/
|
34 |
public function hooks() {
|
35 |
+
add_filter( 'wpdesk_tracker_data', [ $this, 'add_tracking_data' ], 12 );
|
36 |
}
|
37 |
|
38 |
/**
|
42 |
*
|
43 |
* @return array
|
44 |
*/
|
45 |
+
public function add_tracking_data( $data ): array {
|
46 |
$data['flexible_shipping']['onboarding']['table_rate'] = $this->option->get_option_value();
|
47 |
|
48 |
return $data;
|
src/WPDesk/FS/TableRate/DefaultRulesSettings.php
CHANGED
@@ -7,22 +7,35 @@
|
|
7 |
|
8 |
namespace WPDesk\FS\TableRate;
|
9 |
|
|
|
|
|
10 |
/**
|
11 |
* Can provide default settings for rules.
|
12 |
*/
|
13 |
class DefaultRulesSettings {
|
|
|
14 |
|
15 |
/**
|
16 |
* @return array
|
17 |
*/
|
18 |
-
public function get_normalized_settings() {
|
19 |
return apply_filters( 'flexible-shipping/shipping-method/default-rules-settings', $this->get_default_settings() );
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* @return array
|
24 |
*/
|
25 |
-
private function get_default_settings() {
|
26 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
}
|
7 |
|
8 |
namespace WPDesk\FS\TableRate;
|
9 |
|
10 |
+
use WPDesk\FS\TableRate\Rule\Condition\None;
|
11 |
+
|
12 |
/**
|
13 |
* Can provide default settings for rules.
|
14 |
*/
|
15 |
class DefaultRulesSettings {
|
16 |
+
const NEW_FIELD = 'new';
|
17 |
|
18 |
/**
|
19 |
* @return array
|
20 |
*/
|
21 |
+
public function get_normalized_settings(): array {
|
22 |
return apply_filters( 'flexible-shipping/shipping-method/default-rules-settings', $this->get_default_settings() );
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
* @return array
|
27 |
*/
|
28 |
+
private function get_default_settings(): array {
|
29 |
+
return [
|
30 |
+
[
|
31 |
+
'conditions' => [
|
32 |
+
[
|
33 |
+
'condition_id' => None::CONDITION_ID,
|
34 |
+
],
|
35 |
+
],
|
36 |
+
'cost_per_order' => '0',
|
37 |
+
self::NEW_FIELD => true,
|
38 |
+
],
|
39 |
+
];
|
40 |
}
|
41 |
}
|
src/WPDesk/FS/TableRate/Rule/Condition/None.php
CHANGED
@@ -16,13 +16,15 @@ use WPDesk\FS\TableRate\Rule\ShippingContents\ShippingContents;
|
|
16 |
*/
|
17 |
class None extends AbstractCondition {
|
18 |
|
|
|
|
|
19 |
/**
|
20 |
* None constructor.
|
21 |
*
|
22 |
* @param int $priority .
|
23 |
*/
|
24 |
public function __construct( $priority = 10 ) {
|
25 |
-
$this->condition_id =
|
26 |
$this->name = __( 'Always', 'flexible-shipping' );
|
27 |
$this->description = __( 'Fixed shipping cost', 'flexible-shipping' );
|
28 |
$this->priority = $priority;
|
@@ -45,7 +47,7 @@ class None extends AbstractCondition {
|
|
45 |
* @return Field[]
|
46 |
*/
|
47 |
public function get_fields() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -63,5 +65,4 @@ class None extends AbstractCondition {
|
|
63 |
|
64 |
return $formatted_for_log;
|
65 |
}
|
66 |
-
|
67 |
}
|
16 |
*/
|
17 |
class None extends AbstractCondition {
|
18 |
|
19 |
+
const CONDITION_ID = 'none';
|
20 |
+
|
21 |
/**
|
22 |
* None constructor.
|
23 |
*
|
24 |
* @param int $priority .
|
25 |
*/
|
26 |
public function __construct( $priority = 10 ) {
|
27 |
+
$this->condition_id = self::CONDITION_ID;
|
28 |
$this->name = __( 'Always', 'flexible-shipping' );
|
29 |
$this->description = __( 'Fixed shipping cost', 'flexible-shipping' );
|
30 |
$this->priority = $priority;
|
47 |
* @return Field[]
|
48 |
*/
|
49 |
public function get_fields() {
|
50 |
+
return [];
|
51 |
}
|
52 |
|
53 |
/**
|
65 |
|
66 |
return $formatted_for_log;
|
67 |
}
|
|
|
68 |
}
|
src/WPDesk/FS/TableRate/ShippingMethodSingle.php
CHANGED
@@ -45,7 +45,8 @@ class ShippingMethodSingle extends WC_Shipping_Method {
|
|
45 |
* @param int $instance_id .
|
46 |
*/
|
47 |
public function __construct( $instance_id = 0 ) {
|
48 |
-
|
|
|
49 |
$this->id = self::SHIPPING_METHOD_ID;
|
50 |
$this->init();
|
51 |
}
|
@@ -53,7 +54,7 @@ class ShippingMethodSingle extends WC_Shipping_Method {
|
|
53 |
/**
|
54 |
* Init.
|
55 |
*/
|
56 |
-
|
57 |
$this->supports = [
|
58 |
'shipping-zones',
|
59 |
'instance-settings',
|
45 |
* @param int $instance_id .
|
46 |
*/
|
47 |
public function __construct( $instance_id = 0 ) {
|
48 |
+
$this->instance_id = absint( $instance_id );
|
49 |
+
|
50 |
$this->id = self::SHIPPING_METHOD_ID;
|
51 |
$this->init();
|
52 |
}
|
54 |
/**
|
55 |
* Init.
|
56 |
*/
|
57 |
+
protected function init() {
|
58 |
$this->supports = [
|
59 |
'shipping-zones',
|
60 |
'instance-settings',
|
src/WPDesk/FS/TableRate/views/shipping-method-settings-rules.php
CHANGED
@@ -56,21 +56,21 @@ $rule_table_settings = [
|
|
56 |
);
|
57 |
?>
|
58 |
</p>
|
59 |
-
|
60 |
-
<p>
|
61 |
-
<?php
|
62 |
-
echo wp_kses_post(
|
63 |
-
sprintf(
|
64 |
-
// Translators: open tag, close tag.
|
65 |
-
__( 'Want to find out how the table rate works? Hop on board and %1$slet us guide you through the whole setup →%2$s', 'flexible-shipping' ),
|
66 |
-
'<a href="#0" class="js--open-onboarding">',
|
67 |
-
'</a>'
|
68 |
-
)
|
69 |
-
);
|
70 |
-
?>
|
71 |
-
</p>
|
72 |
<?php endif; ?>
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
<p>
|
75 |
<?php echo wp_kses_post( __( 'Please mind that the ranges you define must not overlap each other and make sure there are no gaps between them.', 'flexible-shipping' ) ); ?>
|
76 |
<br/>
|
56 |
);
|
57 |
?>
|
58 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
<?php endif; ?>
|
60 |
|
61 |
+
<p>
|
62 |
+
<?php
|
63 |
+
echo wp_kses_post(
|
64 |
+
sprintf(
|
65 |
+
// Translators: open tag, close tag.
|
66 |
+
__( 'Want to find out how the table rate works? Hop on board and %1$slet us guide you through the whole setup →%2$s', 'flexible-shipping' ),
|
67 |
+
'<a href="#0" class="js--open-onboarding">',
|
68 |
+
'</a>'
|
69 |
+
)
|
70 |
+
);
|
71 |
+
?>
|
72 |
+
</p>
|
73 |
+
|
74 |
<p>
|
75 |
<?php echo wp_kses_post( __( 'Please mind that the ranges you define must not overlap each other and make sure there are no gaps between them.', 'flexible-shipping' ) ); ?>
|
76 |
<br/>
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitae94aac76b47c5e7451e7cac4c05fc4f::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -437,7 +437,9 @@ return array(
|
|
437 |
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
438 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
439 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
|
440 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => $baseDir . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
|
|
441 |
'WPDesk\\FS\\Info\\FSIE' => $baseDir . '/src/WPDesk/FS/Info/FSIE.php',
|
442 |
'WPDesk\\FS\\Info\\FSPro' => $baseDir . '/src/WPDesk/FS/Info/FSPro.php',
|
443 |
'WPDesk\\FS\\Info\\FSWalkthrough' => $baseDir . '/src/WPDesk/FS/Info/FSWalkthrough.php',
|
437 |
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
438 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
439 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
440 |
+
'WPDesk\\FS\\Helpers\\FlexibleShippingMethodsChecker' => $baseDir . '/src/WPDesk/FS/Helpers/FlexibleShippingMethodsChecker.php',
|
441 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => $baseDir . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
442 |
+
'WPDesk\\FS\\Helpers\\WooSettingsPageChecker' => $baseDir . '/src/WPDesk/FS/Helpers/WooSettingsPageChecker.php',
|
443 |
'WPDesk\\FS\\Info\\FSIE' => $baseDir . '/src/WPDesk/FS/Info/FSIE.php',
|
444 |
'WPDesk\\FS\\Info\\FSPro' => $baseDir . '/src/WPDesk/FS/Info/FSPro.php',
|
445 |
'WPDesk\\FS\\Info\\FSWalkthrough' => $baseDir . '/src/WPDesk/FS/Info/FSWalkthrough.php',
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitf0d013492303014bdddf5c3cb47d4f23
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitae94aac76b47c5e7451e7cac4c05fc4f
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitae94aac76b47c5e7451e7cac4c05fc4f', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitae94aac76b47c5e7451e7cac4c05fc4f', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'P' =>
|
@@ -456,7 +456,9 @@ class ComposerStaticInitf0d013492303014bdddf5c3cb47d4f23
|
|
456 |
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
457 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
458 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
|
459 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
|
|
460 |
'WPDesk\\FS\\Info\\FSIE' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSIE.php',
|
461 |
'WPDesk\\FS\\Info\\FSPro' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSPro.php',
|
462 |
'WPDesk\\FS\\Info\\FSWalkthrough' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSWalkthrough.php',
|
@@ -605,10 +607,10 @@ class ComposerStaticInitf0d013492303014bdddf5c3cb47d4f23
|
|
605 |
public static function getInitializer(ClassLoader $loader)
|
606 |
{
|
607 |
return \Closure::bind(function () use ($loader) {
|
608 |
-
$loader->prefixLengthsPsr4 =
|
609 |
-
$loader->prefixDirsPsr4 =
|
610 |
-
$loader->fallbackDirsPsr4 =
|
611 |
-
$loader->classMap =
|
612 |
|
613 |
}, null, ClassLoader::class);
|
614 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'P' =>
|
456 |
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
457 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
458 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
459 |
+
'WPDesk\\FS\\Helpers\\FlexibleShippingMethodsChecker' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/FlexibleShippingMethodsChecker.php',
|
460 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
461 |
+
'WPDesk\\FS\\Helpers\\WooSettingsPageChecker' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/WooSettingsPageChecker.php',
|
462 |
'WPDesk\\FS\\Info\\FSIE' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSIE.php',
|
463 |
'WPDesk\\FS\\Info\\FSPro' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSPro.php',
|
464 |
'WPDesk\\FS\\Info\\FSWalkthrough' => __DIR__ . '/../..' . '/src/WPDesk/FS/Info/FSWalkthrough.php',
|
607 |
public static function getInitializer(ClassLoader $loader)
|
608 |
{
|
609 |
return \Closure::bind(function () use ($loader) {
|
610 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f::$prefixLengthsPsr4;
|
611 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f::$prefixDirsPsr4;
|
612 |
+
$loader->fallbackDirsPsr4 = ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f::$fallbackDirsPsr4;
|
613 |
+
$loader->classMap = ComposerStaticInitae94aac76b47c5e7451e7cac4c05fc4f::$classMap;
|
614 |
|
615 |
}, null, ClassLoader::class);
|
616 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/FormContentRenderer.php
CHANGED
@@ -36,6 +36,12 @@ class FormContentRenderer
|
|
36 |
* @return string
|
37 |
*/
|
38 |
public function render() : string
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
{
|
40 |
$plugin_license = new \FSVendor\WPDesk\License\PluginLicense($this->plugin_info);
|
41 |
$is_active = $plugin_license->is_active();
|
@@ -46,9 +52,7 @@ class FormContentRenderer
|
|
46 |
$errors = $this->errors;
|
47 |
$my_account_link = $this->prapare_my_account_link_according_to_locale_and_shop(\get_locale(), $this->plugin_info->get_plugin_shops());
|
48 |
$docs_link = $this->prapare_docs_link_according_to_locale_and_shop(\get_locale(), $this->plugin_info->get_plugin_shops());
|
49 |
-
\ob_start();
|
50 |
include __DIR__ . '/views/activation-form-content.php';
|
51 |
-
return \ob_get_clean();
|
52 |
}
|
53 |
/**
|
54 |
* @param string $locale .
|
36 |
* @return string
|
37 |
*/
|
38 |
public function render() : string
|
39 |
+
{
|
40 |
+
\ob_start();
|
41 |
+
$this->output_render();
|
42 |
+
return \ob_get_clean();
|
43 |
+
}
|
44 |
+
public function output_render()
|
45 |
{
|
46 |
$plugin_license = new \FSVendor\WPDesk\License\PluginLicense($this->plugin_info);
|
47 |
$is_active = $plugin_license->is_active();
|
52 |
$errors = $this->errors;
|
53 |
$my_account_link = $this->prapare_my_account_link_according_to_locale_and_shop(\get_locale(), $this->plugin_info->get_plugin_shops());
|
54 |
$docs_link = $this->prapare_docs_link_according_to_locale_and_shop(\get_locale(), $this->plugin_info->get_plugin_shops());
|
|
|
55 |
include __DIR__ . '/views/activation-form-content.php';
|
|
|
56 |
}
|
57 |
/**
|
58 |
* @param string $locale .
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/PluginsPageRenderer.php
CHANGED
@@ -34,7 +34,7 @@ class PluginsPageRenderer implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hooka
|
|
34 |
*/
|
35 |
public function display_activation_form_in_table_row($plugin_file, $plugin_data, $status)
|
36 |
{
|
37 |
-
|
38 |
}
|
39 |
/**
|
40 |
* @param string $plugin_file
|
@@ -44,12 +44,15 @@ class PluginsPageRenderer implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hooka
|
|
44 |
public function render(string $plugin_file)
|
45 |
{
|
46 |
\ob_start();
|
|
|
|
|
|
|
|
|
|
|
47 |
$plugin_license = new \FSVendor\WPDesk\License\PluginLicense($this->plugin_info);
|
48 |
$plugin_slug = $this->plugin_info->get_plugin_slug();
|
49 |
-
$
|
50 |
-
$form_content = $renderer->render();
|
51 |
$is_active = $plugin_license->is_active();
|
52 |
include __DIR__ . '/views/plugins-page-row.php';
|
53 |
-
return \ob_get_clean();
|
54 |
}
|
55 |
}
|
34 |
*/
|
35 |
public function display_activation_form_in_table_row($plugin_file, $plugin_data, $status)
|
36 |
{
|
37 |
+
$this->output_render($plugin_file);
|
38 |
}
|
39 |
/**
|
40 |
* @param string $plugin_file
|
44 |
public function render(string $plugin_file)
|
45 |
{
|
46 |
\ob_start();
|
47 |
+
$this->output_render($plugin_file);
|
48 |
+
return \ob_get_clean();
|
49 |
+
}
|
50 |
+
public function output_render(string $plugin_file)
|
51 |
+
{
|
52 |
$plugin_license = new \FSVendor\WPDesk\License\PluginLicense($this->plugin_info);
|
53 |
$plugin_slug = $this->plugin_info->get_plugin_slug();
|
54 |
+
$form_content = new \FSVendor\WPDesk\License\ActivationForm\Renderer($this->plugin_info);
|
|
|
55 |
$is_active = $plugin_license->is_active();
|
56 |
include __DIR__ . '/views/plugins-page-row.php';
|
|
|
57 |
}
|
58 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/Renderer.php
CHANGED
@@ -21,12 +21,15 @@ class Renderer
|
|
21 |
*/
|
22 |
public function render()
|
23 |
{
|
24 |
-
|
25 |
-
$
|
|
|
|
|
|
|
|
|
|
|
26 |
$plugin_slug = $this->plugin_info->get_plugin_slug();
|
27 |
$plugin_file = $this->plugin_info->get_plugin_file_name();
|
28 |
-
\ob_start();
|
29 |
include __DIR__ . '/views/activation-form.php';
|
30 |
-
return \ob_get_clean();
|
31 |
}
|
32 |
}
|
21 |
*/
|
22 |
public function render()
|
23 |
{
|
24 |
+
\ob_start();
|
25 |
+
$this->output_render();
|
26 |
+
return \ob_get_clean();
|
27 |
+
}
|
28 |
+
public function output_render()
|
29 |
+
{
|
30 |
+
$form_content = new \FSVendor\WPDesk\License\ActivationForm\FormContentRenderer($this->plugin_info);
|
31 |
$plugin_slug = $this->plugin_info->get_plugin_slug();
|
32 |
$plugin_file = $this->plugin_info->get_plugin_file_name();
|
|
|
33 |
include __DIR__ . '/views/activation-form.php';
|
|
|
34 |
}
|
35 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/views/activation-form.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
namespace FSVendor;
|
4 |
|
5 |
/**
|
6 |
-
* @var $plugin_slug
|
7 |
-
* @var $plugin_file
|
8 |
-
* @var $form_content
|
9 |
*/
|
10 |
use FSVendor\WPDesk\License\ActivationForm\AjaxHandler;
|
11 |
?>
|
@@ -55,8 +55,7 @@ echo \esc_html($plugin_slug);
|
|
55 |
</style>
|
56 |
<div class="wpdesk-license-activation-form-content">
|
57 |
<?php
|
58 |
-
|
59 |
-
// phpcs:ignore.
|
60 |
?>
|
61 |
</div>
|
62 |
<script type="text/javascript">
|
3 |
namespace FSVendor;
|
4 |
|
5 |
/**
|
6 |
+
* @var string $plugin_slug
|
7 |
+
* @var string $plugin_file
|
8 |
+
* @var \WPDesk\License\ActivationForm\FormContentRenderer $form_content
|
9 |
*/
|
10 |
use FSVendor\WPDesk\License\ActivationForm\AjaxHandler;
|
11 |
?>
|
55 |
</style>
|
56 |
<div class="wpdesk-license-activation-form-content">
|
57 |
<?php
|
58 |
+
$form_content->output_render();
|
|
|
59 |
?>
|
60 |
</div>
|
61 |
<script type="text/javascript">
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ActivationForm/views/plugins-page-row.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
namespace FSVendor;
|
4 |
|
5 |
/**
|
6 |
-
* @var $status
|
7 |
-
* @var $is_active
|
8 |
-
* @var $plugin_slug
|
9 |
-
* @var $plugin_file
|
10 |
-
* @var $form_content
|
11 |
*/
|
12 |
?><tr class="plugin-update-tr plugin-wpdesk-license-tr active" id="<?php
|
13 |
echo \esc_attr($plugin_slug);
|
@@ -23,8 +23,7 @@ echo \esc_attr($plugin_slug);
|
|
23 |
echo \esc_html($is_active ? 'notice-success' : 'notice-warning');
|
24 |
?>">
|
25 |
<?php
|
26 |
-
|
27 |
-
// phpcs:ignore.
|
28 |
?>
|
29 |
</div>
|
30 |
<script type="text/javascript">
|
3 |
namespace FSVendor;
|
4 |
|
5 |
/**
|
6 |
+
* @var string $status
|
7 |
+
* @var bool $is_active
|
8 |
+
* @var string $plugin_slug
|
9 |
+
* @var string $plugin_file
|
10 |
+
* @var WPDesk\License\ActivationForm\Renderer $form_content
|
11 |
*/
|
12 |
?><tr class="plugin-update-tr plugin-wpdesk-license-tr active" id="<?php
|
13 |
echo \esc_attr($plugin_slug);
|
23 |
echo \esc_html($is_active ? 'notice-success' : 'notice-warning');
|
24 |
?>">
|
25 |
<?php
|
26 |
+
$form_content->output_render();
|
|
|
27 |
?>
|
28 |
</div>
|
29 |
<script type="text/javascript">
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php
CHANGED
@@ -36,7 +36,7 @@ if (!\class_exists('FSVendor\\WPDesk_API_MENU')) {
|
|
36 |
/* screen_icon(); */
|
37 |
?>
|
38 |
<h2><?php
|
39 |
-
\
|
40 |
?></h2>
|
41 |
<?php
|
42 |
\settings_errors();
|
@@ -45,7 +45,7 @@ if (!\class_exists('FSVendor\\WPDesk_API_MENU')) {
|
|
45 |
<?php
|
46 |
foreach ($settings_tabs as $tab_page => $tab_name) {
|
47 |
$active_tab = $current_tab == $tab_page ? 'nav-tab-active' : '';
|
48 |
-
echo '<a class="nav-tab ' . $active_tab . '" href="?page=' . $this->api_manager->activation_tab_key . '&tab=' . $tab_page . '">' . $tab_name . '</a>';
|
49 |
}
|
50 |
?>
|
51 |
</h2>
|
@@ -94,27 +94,27 @@ if (!\class_exists('FSVendor\\WPDesk_API_MENU')) {
|
|
94 |
$license_status = $this->license_key_status();
|
95 |
$license_status_check = !empty($license_status['status_check']) && $license_status['status_check'] == 'active' ? 'Activated' : 'Deactivated';
|
96 |
if (!empty($license_status_check)) {
|
97 |
-
echo $license_status_check;
|
98 |
}
|
99 |
}
|
100 |
// Returns API License text field
|
101 |
public function wc_am_api_key_field()
|
102 |
{
|
103 |
-
echo "<input id='api_key' name='" . $this->api_manager->data_key . "[" . $this->api_manager->api_key . "]' size='55' type='text' value='" . $this->api_manager->options[$this->api_manager->api_key] . "' />";
|
104 |
if ($this->api_manager->options[$this->api_manager->api_key]) {
|
105 |
-
echo "<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/complete.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>";
|
106 |
} else {
|
107 |
-
echo "<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/warn.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>";
|
108 |
}
|
109 |
}
|
110 |
// Returns API License email text field
|
111 |
public function wc_am_api_email_field()
|
112 |
{
|
113 |
-
echo "<input id='activation_email' name='" . $this->api_manager->data_key . "[" . $this->api_manager->activation_email . "]' size='55' type='text' value='" . $this->api_manager->options[$this->api_manager->activation_email] . "' />";
|
114 |
if ($this->api_manager->options[$this->api_manager->activation_email]) {
|
115 |
-
echo "<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/complete.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>";
|
116 |
} else {
|
117 |
-
echo "<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/warn.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>";
|
118 |
}
|
119 |
}
|
120 |
// Sanitizes and validates all input and output for Dashboard
|
@@ -302,11 +302,11 @@ if (!\class_exists('FSVendor\\WPDesk_API_MENU')) {
|
|
302 |
}
|
303 |
public function wc_am_deactivate_textarea()
|
304 |
{
|
305 |
-
echo '<input type="checkbox" id="' . $this->api_manager->deactivate_checkbox . '" name="' . $this->api_manager->deactivate_checkbox . '" value="on"';
|
306 |
-
echo \checked(\get_option($this->api_manager->deactivate_checkbox), 'on');
|
307 |
-
echo '/>';
|
308 |
?><span class="description"><?php
|
309 |
-
\
|
310 |
?></span>
|
311 |
<?php
|
312 |
}
|
36 |
/* screen_icon(); */
|
37 |
?>
|
38 |
<h2><?php
|
39 |
+
echo \wp_kses_post(\__($this->api_manager->settings_title, $this->api_manager->text_domain));
|
40 |
?></h2>
|
41 |
<?php
|
42 |
\settings_errors();
|
45 |
<?php
|
46 |
foreach ($settings_tabs as $tab_page => $tab_name) {
|
47 |
$active_tab = $current_tab == $tab_page ? 'nav-tab-active' : '';
|
48 |
+
echo \wp_kses_post('<a class="nav-tab ' . $active_tab . '" href="?page=' . $this->api_manager->activation_tab_key . '&tab=' . $tab_page . '">' . $tab_name . '</a>');
|
49 |
}
|
50 |
?>
|
51 |
</h2>
|
94 |
$license_status = $this->license_key_status();
|
95 |
$license_status_check = !empty($license_status['status_check']) && $license_status['status_check'] == 'active' ? 'Activated' : 'Deactivated';
|
96 |
if (!empty($license_status_check)) {
|
97 |
+
echo \esc_html($license_status_check);
|
98 |
}
|
99 |
}
|
100 |
// Returns API License text field
|
101 |
public function wc_am_api_key_field()
|
102 |
{
|
103 |
+
echo \wp_kses_post("<input id='api_key' name='" . $this->api_manager->data_key . "[" . $this->api_manager->api_key . "]' size='55' type='text' value='" . $this->api_manager->options[$this->api_manager->api_key] . "' />");
|
104 |
if ($this->api_manager->options[$this->api_manager->api_key]) {
|
105 |
+
echo \wp_kses_post("<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/complete.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>");
|
106 |
} else {
|
107 |
+
echo \wp_kses_post("<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/warn.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>");
|
108 |
}
|
109 |
}
|
110 |
// Returns API License email text field
|
111 |
public function wc_am_api_email_field()
|
112 |
{
|
113 |
+
echo \wp_kses_post("<input id='activation_email' name='" . $this->api_manager->data_key . "[" . $this->api_manager->activation_email . "]' size='55' type='text' value='" . $this->api_manager->options[$this->api_manager->activation_email] . "' />");
|
114 |
if ($this->api_manager->options[$this->api_manager->activation_email]) {
|
115 |
+
echo \wp_kses_post("<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/complete.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>");
|
116 |
} else {
|
117 |
+
echo \wp_kses_post("<span class='icon-pos'><img src='" . \plugins_url("wpdesk-helper/assets/images/warn.png") . "' title='' style='padding-bottom: 4px; vertical-align: middle; margin-right:3px;' /></span>");
|
118 |
}
|
119 |
}
|
120 |
// Sanitizes and validates all input and output for Dashboard
|
302 |
}
|
303 |
public function wc_am_deactivate_textarea()
|
304 |
{
|
305 |
+
echo \wp_kses_post('<input type="checkbox" id="' . $this->api_manager->deactivate_checkbox . '" name="' . $this->api_manager->deactivate_checkbox . '" value="on"');
|
306 |
+
echo \wp_kses_post(\checked(\get_option($this->api_manager->deactivate_checkbox), 'on'));
|
307 |
+
echo \wp_kses_post('/>');
|
308 |
?><span class="description"><?php
|
309 |
+
\wp_kses_post(\__('Deactivates an API Key so it can be used on another blog.', $this->api_manager->text_domain));
|
310 |
?></span>
|
311 |
<?php
|
312 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php
CHANGED
@@ -205,7 +205,7 @@ if (!\class_exists('FSVendor\\WPDesk_API_Manager_With_Update_Flag')) {
|
|
205 |
{
|
206 |
\add_action('in_plugin_update_message-' . $this->plugin_name, function (array $plugin_data, \stdClass $response) {
|
207 |
if (isset($response, $response->package) && empty($response->package)) {
|
208 |
-
echo \sprintf(\__('%1$sEnter a valid subscription key for automatic updates.', 'flexible-shipping'), ' ');
|
209 |
}
|
210 |
if (isset($response->changelog) && !empty($response->changelog)) {
|
211 |
$this->display_changelog($plugin_data['Version'], $response->changelog);
|
@@ -364,7 +364,7 @@ if (!\class_exists('FSVendor\\WPDesk_API_Manager_With_Update_Flag')) {
|
|
364 |
$changelog->set_changelog_types($parser->get_types());
|
365 |
$formatted_changelog = $changelog->prepare_formatted_html();
|
366 |
if ($formatted_changelog) {
|
367 |
-
echo '<br /><br />' . $formatted_changelog;
|
368 |
}
|
369 |
}
|
370 |
}
|
205 |
{
|
206 |
\add_action('in_plugin_update_message-' . $this->plugin_name, function (array $plugin_data, \stdClass $response) {
|
207 |
if (isset($response, $response->package) && empty($response->package)) {
|
208 |
+
echo \esc_html(\sprintf(\__('%1$sEnter a valid subscription key for automatic updates.', 'flexible-shipping'), ' '));
|
209 |
}
|
210 |
if (isset($response->changelog) && !empty($response->changelog)) {
|
211 |
$this->display_changelog($plugin_data['Version'], $response->changelog);
|
364 |
$changelog->set_changelog_types($parser->get_types());
|
365 |
$formatted_changelog = $changelog->prepare_formatted_html();
|
366 |
if ($formatted_changelog) {
|
367 |
+
echo \wp_kses_post('<br /><br />' . $formatted_changelog);
|
368 |
}
|
369 |
}
|
370 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-plugin-update.php
CHANGED
@@ -330,7 +330,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
330 |
*/
|
331 |
public function expired_license_error_notice($message)
|
332 |
{
|
333 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The API key for %s has expired. You can reactivate or purchase a API key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
334 |
}
|
335 |
/**
|
336 |
* Display subscription on-hold error notice
|
@@ -341,7 +341,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
341 |
*/
|
342 |
public function on_hold_subscription_error_notice($message)
|
343 |
{
|
344 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s is on-hold. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
345 |
}
|
346 |
/**
|
347 |
* Display subscription cancelled error notice
|
@@ -352,7 +352,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
352 |
*/
|
353 |
public function cancelled_subscription_error_notice($message)
|
354 |
{
|
355 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been cancelled. You can renew the subscription from your account <a href="%s" target="_blank">dashboard</a>. A new API key will be emailed to you after your order has been completed.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
356 |
}
|
357 |
/**
|
358 |
* Display subscription expired error notice
|
@@ -363,7 +363,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
363 |
*/
|
364 |
public function expired_subscription_error_notice($message)
|
365 |
{
|
366 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has expired. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
367 |
}
|
368 |
/**
|
369 |
* Display subscription expired error notice
|
@@ -374,7 +374,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
374 |
*/
|
375 |
public function suspended_subscription_error_notice($message)
|
376 |
{
|
377 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been suspended. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
378 |
}
|
379 |
/**
|
380 |
* Display subscription expired error notice
|
@@ -385,7 +385,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
385 |
*/
|
386 |
public function pending_subscription_error_notice($message)
|
387 |
{
|
388 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s is still pending. You can check on the status of the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
389 |
}
|
390 |
/**
|
391 |
* Display subscription expired error notice
|
@@ -396,7 +396,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
396 |
*/
|
397 |
public function trash_subscription_error_notice($message)
|
398 |
{
|
399 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been placed in the trash and will be deleted soon. You can purchase a new subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
400 |
}
|
401 |
/**
|
402 |
* Display subscription expired error notice
|
@@ -407,7 +407,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
407 |
*/
|
408 |
public function no_subscription_error_notice($message)
|
409 |
{
|
410 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('A subscription for %s could not be found. You can purchase a subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
411 |
}
|
412 |
/**
|
413 |
* Display missing key error notice
|
@@ -418,7 +418,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
418 |
*/
|
419 |
public function no_key_error_notice($message)
|
420 |
{
|
421 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('A API key for %s could not be found. Maybe you forgot to enter a API key when setting up %s, or the key was deactivated in your account. You can reactivate or purchase a subscription key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->product_id, $this->renew_license_url);
|
422 |
}
|
423 |
/**
|
424 |
* Display missing download permission revoked error notice
|
@@ -429,7 +429,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
429 |
*/
|
430 |
public function download_revoked_error_notice($message)
|
431 |
{
|
432 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('Download permission for %s has been revoked possibly due to a API key or subscription expiring. You can reactivate or purchase a API key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
433 |
}
|
434 |
/**
|
435 |
* Display no activation error notice
|
@@ -440,7 +440,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
440 |
*/
|
441 |
public function no_activation_error_notice($message)
|
442 |
{
|
443 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('%s has not been activated. Go to the settings page and enter the API key and subscription email to activate %s.', $this->text_domain) . '</p></div>', $this->product_id, $this->product_id);
|
444 |
}
|
445 |
/**
|
446 |
* Display switched activation error notice
|
@@ -451,7 +451,7 @@ if (!\class_exists('FSVendor\\WPDesk_Update_API_Check')) {
|
|
451 |
*/
|
452 |
public function switched_subscription_error_notice($message)
|
453 |
{
|
454 |
-
echo \sprintf('<div id="message" class="error"><p>' . \__('You changed the subscription for %s, so you will need to enter your new API Key in the settings page. The API Key should have arrived in your email inbox, if not you can get it by logging into your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url);
|
455 |
}
|
456 |
}
|
457 |
// class WPDesk_Update_API_Check
|
330 |
*/
|
331 |
public function expired_license_error_notice($message)
|
332 |
{
|
333 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The API key for %s has expired. You can reactivate or purchase a API key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
334 |
}
|
335 |
/**
|
336 |
* Display subscription on-hold error notice
|
341 |
*/
|
342 |
public function on_hold_subscription_error_notice($message)
|
343 |
{
|
344 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s is on-hold. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
345 |
}
|
346 |
/**
|
347 |
* Display subscription cancelled error notice
|
352 |
*/
|
353 |
public function cancelled_subscription_error_notice($message)
|
354 |
{
|
355 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been cancelled. You can renew the subscription from your account <a href="%s" target="_blank">dashboard</a>. A new API key will be emailed to you after your order has been completed.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
356 |
}
|
357 |
/**
|
358 |
* Display subscription expired error notice
|
363 |
*/
|
364 |
public function expired_subscription_error_notice($message)
|
365 |
{
|
366 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has expired. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
367 |
}
|
368 |
/**
|
369 |
* Display subscription expired error notice
|
374 |
*/
|
375 |
public function suspended_subscription_error_notice($message)
|
376 |
{
|
377 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been suspended. You can reactivate the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
378 |
}
|
379 |
/**
|
380 |
* Display subscription expired error notice
|
385 |
*/
|
386 |
public function pending_subscription_error_notice($message)
|
387 |
{
|
388 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s is still pending. You can check on the status of the subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
389 |
}
|
390 |
/**
|
391 |
* Display subscription expired error notice
|
396 |
*/
|
397 |
public function trash_subscription_error_notice($message)
|
398 |
{
|
399 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('The subscription for %s has been placed in the trash and will be deleted soon. You can purchase a new subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
400 |
}
|
401 |
/**
|
402 |
* Display subscription expired error notice
|
407 |
*/
|
408 |
public function no_subscription_error_notice($message)
|
409 |
{
|
410 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('A subscription for %s could not be found. You can purchase a subscription from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
411 |
}
|
412 |
/**
|
413 |
* Display missing key error notice
|
418 |
*/
|
419 |
public function no_key_error_notice($message)
|
420 |
{
|
421 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('A API key for %s could not be found. Maybe you forgot to enter a API key when setting up %s, or the key was deactivated in your account. You can reactivate or purchase a subscription key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->product_id, $this->renew_license_url));
|
422 |
}
|
423 |
/**
|
424 |
* Display missing download permission revoked error notice
|
429 |
*/
|
430 |
public function download_revoked_error_notice($message)
|
431 |
{
|
432 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('Download permission for %s has been revoked possibly due to a API key or subscription expiring. You can reactivate or purchase a API key from your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
433 |
}
|
434 |
/**
|
435 |
* Display no activation error notice
|
440 |
*/
|
441 |
public function no_activation_error_notice($message)
|
442 |
{
|
443 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('%s has not been activated. Go to the settings page and enter the API key and subscription email to activate %s.', $this->text_domain) . '</p></div>', $this->product_id, $this->product_id));
|
444 |
}
|
445 |
/**
|
446 |
* Display switched activation error notice
|
451 |
*/
|
452 |
public function switched_subscription_error_notice($message)
|
453 |
{
|
454 |
+
echo \wp_kses_post(\sprintf('<div id="message" class="error"><p>' . \__('You changed the subscription for %s, so you will need to enter your new API Key in the settings page. The API Key should have arrived in your email inbox, if not you can get it by logging into your account <a href="%s" target="_blank">dashboard</a>.', $this->text_domain) . '</p></div>', $this->product_id, $this->renew_license_url));
|
455 |
}
|
456 |
}
|
457 |
// class WPDesk_Update_API_Check
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/license-actions.php
CHANGED
@@ -11,24 +11,24 @@ if (!\defined('ABSPATH')) {
|
|
11 |
<table class="wpdesk_helper_key_table">
|
12 |
<tr>
|
13 |
<td><?php
|
14 |
-
\
|
15 |
?></td>
|
16 |
<td><input class="wpdesk_helper_input" name="api_key" type="text"
|
17 |
value="<?php
|
18 |
-
echo $api_key;
|
19 |
?>" <?php
|
20 |
-
echo $disabled;
|
21 |
?> /></td>
|
22 |
</tr>
|
23 |
<tr>
|
24 |
<td><?php
|
25 |
-
\
|
26 |
?></td>
|
27 |
<td><input class="wpdesk_helper_input" name="activation_email" type="email"
|
28 |
value="<?php
|
29 |
-
echo $activation_email;
|
30 |
?>" <?php
|
31 |
-
echo $disabled;
|
32 |
?> /></td>
|
33 |
</tr>
|
34 |
<tr>
|
@@ -38,13 +38,13 @@ echo $disabled;
|
|
38 |
if ($activation_status == 'Deactivated') {
|
39 |
?>
|
40 |
<button class="wpdesk_helper_button button button-primary"><?php
|
41 |
-
\
|
42 |
?></button>
|
43 |
<?php
|
44 |
} else {
|
45 |
?>
|
46 |
<button class="wpdesk_helper_button button"><?php
|
47 |
-
\
|
48 |
?></button>
|
49 |
<?php
|
50 |
}
|
@@ -53,7 +53,7 @@ if ($activation_status == 'Deactivated') {
|
|
53 |
</tr>
|
54 |
</table>
|
55 |
<input type="hidden" name="plugin" value="<?php
|
56 |
-
echo $plugin;
|
57 |
?>"/>
|
58 |
<?php
|
59 |
if ($activation_status == 'Deactivated') {
|
11 |
<table class="wpdesk_helper_key_table">
|
12 |
<tr>
|
13 |
<td><?php
|
14 |
+
\esc_html(\__('Key:', 'flexible-shipping'));
|
15 |
?></td>
|
16 |
<td><input class="wpdesk_helper_input" name="api_key" type="text"
|
17 |
value="<?php
|
18 |
+
echo \esc_attr($api_key);
|
19 |
?>" <?php
|
20 |
+
echo \esc_attr($disabled);
|
21 |
?> /></td>
|
22 |
</tr>
|
23 |
<tr>
|
24 |
<td><?php
|
25 |
+
\esc_html(\__('Email:', 'flexible-shipping'));
|
26 |
?></td>
|
27 |
<td><input class="wpdesk_helper_input" name="activation_email" type="email"
|
28 |
value="<?php
|
29 |
+
echo \esc_attr($activation_email);
|
30 |
?>" <?php
|
31 |
+
echo \esc_attr($disabled);
|
32 |
?> /></td>
|
33 |
</tr>
|
34 |
<tr>
|
38 |
if ($activation_status == 'Deactivated') {
|
39 |
?>
|
40 |
<button class="wpdesk_helper_button button button-primary"><?php
|
41 |
+
echo \esc_html(\__('Activate', 'flexible-shipping'));
|
42 |
?></button>
|
43 |
<?php
|
44 |
} else {
|
45 |
?>
|
46 |
<button class="wpdesk_helper_button button"><?php
|
47 |
+
echo \esc_html(\__('Deactivate', 'flexible-shipping'));
|
48 |
?></button>
|
49 |
<?php
|
50 |
}
|
53 |
</tr>
|
54 |
</table>
|
55 |
<input type="hidden" name="plugin" value="<?php
|
56 |
+
echo \esc_attr($plugin);
|
57 |
?>"/>
|
58 |
<?php
|
59 |
if ($activation_status == 'Deactivated') {
|
vendor_prefixed/wpdesk/wp-wpdesk-license/src/Page/License/views/licenses.php
CHANGED
@@ -24,7 +24,7 @@ if (!\defined('ABSPATH')) {
|
|
24 |
?>
|
25 |
|
26 |
<h1><?php
|
27 |
-
\
|
28 |
?></h1>
|
29 |
|
30 |
<p class="mb0">
|
@@ -35,7 +35,7 @@ if (\get_locale() === 'pl_PL') {
|
|
35 |
$url = 'https://www.wpdesk.net/my-account/';
|
36 |
}
|
37 |
$link = \sprintf(\__('Get your subscription keys <a href="%s" target="_blank">here</a>. You can activate/deactivate API keys <strong>unlimited times on different domains</strong> as long as you have an active subscription.', 'flexible-shipping'), \esc_url($url));
|
38 |
-
echo $link;
|
39 |
?>
|
40 |
</p>
|
41 |
|
24 |
?>
|
25 |
|
26 |
<h1><?php
|
27 |
+
\esc_html_e('WP Desk Subscriptions', 'flexible-shipping');
|
28 |
?></h1>
|
29 |
|
30 |
<p class="mb0">
|
35 |
$url = 'https://www.wpdesk.net/my-account/';
|
36 |
}
|
37 |
$link = \sprintf(\__('Get your subscription keys <a href="%s" target="_blank">here</a>. You can activate/deactivate API keys <strong>unlimited times on different domains</strong> as long as you have an active subscription.', 'flexible-shipping'), \esc_url($url));
|
38 |
+
echo \wp_kses_post($link);
|
39 |
?>
|
40 |
</p>
|
41 |
|