HEX
Server: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System: Linux panel.ctvbarranquilla.com 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
User: bastidas (1002)
PHP: 8.2.18
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
Upload Files
File: /home/bastidas/web/bastidas.tv/public_html/wp-content/plugins/unbounce/UBEvents.php
<?php

class UBEvents
{

    public static function successful_authorization_event($data)
    {
        return UBEvents::event(
            'WordPressSuccessfulAuthorizationEventV1.0',
            UBEvents::authorization_event($data)
        );
    }

    public static function failed_authorization_event($data)
    {
        return UBEvents::event(
            'WordPressFailedAuthorizationEventV1.0',
            UBEvents::authorization_event($data)
        );
    }

    /**
     * @param array $environment
     * @param array|null $sitemapRequest
     * @param string|null $previousVersion
     *
     * @return array
     */
    public static function activationEvent($environment, $sitemapRequest, $previousVersion = null)
    {
        $data = array('environment' => $environment, 'sitemap_request' => $sitemapRequest);

        if ($previousVersion) {
            $data['previous_version'] = $previousVersion;
        }

        return UBEvents::event('WordpressActivationEventV1.0', $data);
    }

    public static function log_event($data)
    {
        return UBEvents::event('WordpressLogV1.0', $data);
    }

    private static function authorization_event($data)
    {
        $event = array(
        'domain_name' => $data['domain_name'],
        'first_authorization' => (boolean) $data['first_authorization'],
        'metadata' => array()
        );

        if ($data['domain_id']) {
            $event['domain_id'] = UBEvents::maybe_convert_to_int($data['domain_id']);
        }

        if ($data['user_id']) {
            $event['metadata']['user_id'] = UBEvents::maybe_convert_to_int($data['user_id']);
        }

        if ($data['client_id']) {
            $event['metadata']['client_id'] = UBEvents::maybe_convert_to_int($data['client_id']);
        }

        return $event;
    }

    private static function maybe_convert_to_int($str)
    {
        if (is_numeric($str)) {
            return intval($str);
        } else {
            return $str;
        }
    }

    private static function event($type, $data)
    {
        $event = array_merge(
            array('type' => $type),
            UBEvents::default_attributes(),
            $data
        );
        $json_unescaped = json_encode($event);
        return str_replace('\\/', '/', $json_unescaped);
    }

    private static function default_attributes()
    {
        $datetime = new DateTime('NOW', new DateTimeZone('UTC'));
        return array('id' => uniqid(),
                 'time_sent' => $datetime->format('Y-m-d\TH:i:s\Z'),
                 'source' => UBConfig::UB_USER_AGENT . ' ' . gethostname());
    }
}