HEX
Server: Apache/2
System: Linux vps32496.sdns.vn 3.10.0-1160.99.1.el7.x86_64 #1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64
User: khuondaotc (1075)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/khuondaotc/domains/khuondaotct.com/private_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());
    }
}