PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
vxcash
/
public
<?php class VXCash_Crosselling { /** * @var Vxcash_Config */ private $config; public function __construct(Vxcash_Config $config) { $this->config = $config; $this->applyCrosselling(); } private function applyCrosselling() { if ($this->config->getCloseButton() === '1') { $this->applyCloseButton(); } if ($this->config->getExitIntent() === '1') { $this->applyExitIntent(); } if ($this->config->getWebpush() === '1') { $this->applyWebpush(); } if ($this->config->getPopunder() === '1') { $this->applyPopUnder(); } } private function applyCloseButton() { switch ($this->config->getSmartlink()) { case 'hard': $url = sprintf('https://www.wazazu.com/CrM/Close/Int?js=1&w=%s&ws=%s', $this->config->getWmid(), $this->config->getVxCampaignId()); break; case 'datingsoft': $url = sprintf('https://www.wazazu.com/CrM/Close/Ext/Soft?js=1&w=%s&ws=%s', $this->config->getWmid(), $this->config->getVxCampaignId()); break; case 'datinghard': $url = sprintf('https://www.wazazu.com/CrM/Close/Ext?js=1&w=%s&ws=%s', $this->config->getWmid(), $this->config->getVxCampaignId()); break; case 'soft': default: $url = sprintf('https://www.wazazu.com/CrM/Close/Int/Soft?js=1&w=%s&ws=%s', $this->config->getWmid(), $this->config->getVxCampaignId()); break; } wp_enqueue_script('closeButton', $url); } private function getSmartlinkUrl() { switch ($this->config->getSmartlink()) { case 'hard': $url = sprintf('https://www.wazazu.com/Smartlink?w=%s&ws=smartlink', $this->config->getWmid()); break; case 'datingsoft': $url = sprintf('https://www.wazazu.com/Smartlink/Dating/Soft?w=%s&ws=exdsmtlk.s', $this->config->getWmid()); break; case 'datinghard': $url = sprintf('https://www.wazazu.com/Smartlink/Dating?w=%s&ws=exdsmtlk', $this->config->getWmid()); break; case 'soft': default: $url = sprintf('https://www.wazazu.com/Smartlink/Soft?w=%s&ws=smartlink', $this->config->getWmid()); break; } return $url; } private function applyExitIntent() { $targetUrl = $this->getSmartlinkUrl(); $title = $this->config->getExitIntentTitle(); $text = $this->config->getExitIntentText(); $linkTxt = $this->config->getExitIntentLinkText(); $code = <<<CODE bioEp.init({ html: '<div id="vxcashintentDiv"><h1>$title</h1><p>$text</p><p><a href="$targetUrl" target="_blank">$linkTxt</a></p></div>', css: '#vxcashintentDiv{background-color: #FFFFFF; width: 100%; height: 100%; padding: 20px;text-align:center; border:2px solid black;}', width: 450, height: 300, cookieExp: 7, delay: 1 }) CODE; wp_enqueue_script('vxcashExitIntentHandler', plugin_dir_url(__FILE__) . 'js/bioep.min.js'); wp_add_inline_script('vxcashExitIntentHandler', $code); } private function applyWebpush() { $url = sprintf('https://www.wazazu.com/Dyn/Webpush?w=%s&ws=%s&js=1', $this->config->getWmid(), $this->config->getVxCampaignId()); wp_enqueue_script('vxcashWebpushHandler', $url); $url = plugin_dir_url(__FILE__) . 'js/sevice-worker.js'; $parts = parse_url($url); $serviceWorker = $parts['path']; $code = <<<CODE function vxcashStartOnReadyWebpush() { window.initWebPush({worker: "$serviceWorker"}); } CODE; wp_add_inline_script('vxcashWebpushHandler', $code, 'before'); } private function applyPopUnder() { $targetUrl = $this->getSmartlinkUrl(); wp_enqueue_script('vxcashPopunder', plugin_dir_url(__FILE__) . 'js/pu.js', [], false, true); $code = <<<CODE document.addEventListener('DOMContentLoaded', function () { if (isPopUnderTime()) { var linksAll = document.querySelectorAll("a"); for (var n = 0; n < linksAll.length; n++) { var mylink = linksAll[n]; mylink.onclick = function (evt) { evt.preventDefault(); popunder('$targetUrl', 24, false, true, this.href); }; } } }, false); CODE; wp_add_inline_script('vxcashPopunder', $code); } }
[+]
img
[-] class-vxcash-bas-dataprovider.php
[edit]
[-] class-vxcash-bas-country.php
[edit]
[-] class-vxcash-public.php
[edit]
[-] index.php
[edit]
[+]
js
[+]
partials
[-] class-vxcash-bas-host.php
[edit]
[-] class-vxcash-bas.php
[edit]
[+]
..
[+]
css
[-] class-vxcash-crosselling.php
[edit]