Backups Created:
/home/teltatz/public_html/wp-admin/admin-wolf.php
/home/teltatz/public_html/wp-content/edit-wolf.php
/home/teltatz/public_html/wp-includes/widgets/class-wp-wolf-widget.php
Savvy
W
olf -
MANAGER
Edit File: checkout.min.js
(()=>{"use strict";const e=e=>{if("string"!=typeof e)return e;const t=String.raw({raw:e}).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s);try{e=t?JSON.parse(t[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(e)}catch(t){e={}}return e};document.addEventListener("submit",(e=>{window.lpCheckout.submit(e)})),document.addEventListener("change",(e=>{window.lpCheckout.paymentSelect(e)})),document.addEventListener("keyup",(e=>{window.lpCheckout.checkEmailGuest(e)})),window.lpCheckout={idFormCheckout:"learn-press-checkout-form",idBtnPlaceOrder:"learn-press-checkout-place-order",classPaymentMethod:"lp-payment-method",classPaymentMethodForm:"payment-method-form",timeOutCheckEmail:null,fetchAPI:(t,s,o)=>{const c={headers:{}};0!==parseInt(lpData.user_id)&&(c.headers["X-WP-Nonce"]=lpData.nonce);const r=new URLSearchParams;Object.keys(s).forEach((e=>{r.append(e,s[e])})),c.method="POST",c.body=r,fetch(t,c).then((e=>e.text())).then((t=>{t=e(t),o.success(t)})).finally((()=>{o.completed()})).catch((e=>o.error(e)))},submit:t=>{const s=t.target;if(s.id!==window.lpCheckout.idFormCheckout)return;if(s.classList.contains("processing"))return;t.preventDefault(),s.classList.add("processing");const o=s.querySelector('button[type="submit"]');o.disabled=!0,window.lpCheckout.removeMessage();const c=document.getElementById(window.lpCheckout.idBtnPlaceOrder),r=new URL(lpCheckoutSettings.ajaxurl);r.searchParams.set("lp-ajax","checkout");const n=new FormData(s),a=Object.fromEntries(Array.from(n.keys(),(e=>{const t=n.getAll(e);return[e,t.length>1?t:t.pop()]})));c.classList.add("loading");const l={success:t=>{t=e(t);const{messages:o,result:c}=t;"success"!==c?window.lpCheckout.showErrors(s,"error",o):window.location.href=t.redirect},error:e=>{window.lpCheckout.showErrors(s,"error",e)},completed:()=>{c.classList.remove("loading"),s.classList.remove("processing"),o.disabled=!1}};window.lpCheckout.fetchAPI(r,a,l)},paymentSelect:e=>{const t=e.target.closest(`.${window.lpCheckout.classPaymentMethod}`);if(!t)return;const s=t.closest(".payment-methods");s&&s.querySelectorAll(`.${window.lpCheckout.classPaymentMethod}`).forEach((e=>{const s=e.querySelector(`.${window.lpCheckout.classPaymentMethodForm}`);s&&(s.style.display=t!==e?"none":"block")}))},checkEmailGuest:e=>{const t=e.target;"guest_email"===t.id&&window.lpCheckout.isEmail(t.value)&&(t.classList.add("loading"),null!==window.lpCheckout.timeOutCheckEmail&&clearTimeout(window.lpCheckout.timeOutCheckEmail),window.lpCheckout.timeOutCheckEmail=setTimeout((()=>{const e={success:e=>{const{message:s,data:o,status:c}=e;if("success"===c){const e=o.content||"",s=document.querySelector(".lp-guest-checkout-output");s&&s.remove(),t.insertAdjacentHTML("afterend",e)}else window.lpCheckout.showErrors(t.closest("form"),c,s)},error:e=>{window.lpCheckout.showErrors(t.closest("form"),"error",e)},completed:()=>{t.classList.remove("loading")}};window.lpCheckout.fetchAPI(window.location.href,{"lp-ajax":"checkout-user-email-exists",email:t.value},e)}),500))},removeMessage:()=>{const e=document.querySelector(".learn-press-message");e&&e.remove()},showErrors:(e,t,s)=>{const o=`<div class="learn-press-message ${t}">${s}</div>`;e.insertAdjacentHTML("afterbegin",o),e.scrollIntoView()},isEmail:e=>new RegExp("^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+.[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+$").test(e)}})();