Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


namespace MO_CAW\PRO;

use MO_CAW\PRO\Constants;
use MO_CAW\Common\DB_Utils;
use MO_CAW\Common\Utils as Common_Utils;
class Utils extends Common_Utils
{
    const BASIC_API_CREATION_PLAN = 1;
    const BASIC_API_CREATION_PLAN_DISPLAY_NAME = "Basic API Creation";
    const ADVANCED_API_CREATION_PLAN = 2;
    const ADVANCED_API_CREATION_PLAN_DISPLAY_NAME = "Advance API Creation";
    const EXTERNAL_API_INTEGRATION_PLAN = 3;
    const EXTERNAL_API_INTEGRATION_PLAN_DISPLAY_NAME = "External API Connection";
    const INCLUSIVE_PLAN = 4;
    const INCLUSIVE_PLAN_DISPLAY_NAME = "All Inclusive";
    public static function check_plan_capabilities($Zt)
    {
        $yc = self::get_version();
        $wj = false;
        switch ($Zt) {
            case Constants::BASIC_API_CREATION_PLAN_NAME:
                if (!(parent::STANDARD_PLAN !== $yc && self::EXTERNAL_API_INTEGRATION_PLAN !== $yc)) {
                    goto ke;
                }
                $wj = true;
                ke:
                goto li;
            case Constants::ADVANCE_API_CREATION_PLAN_NAME:
                if (!(self::ADVANCED_API_CREATION_PLAN === $yc || self::INCLUSIVE_PLAN === $yc)) {
                    goto BJ;
                }
                $wj = true;
                BJ:
                goto li;
            case Constants::EXTERNAL_API_CONNECTION_PLAN_NAME:
                if (!(self::EXTERNAL_API_INTEGRATION_PLAN === $yc || self::INCLUSIVE_PLAN === $yc)) {
                    goto Nr;
                }
                $wj = true;
                Nr:
                goto li;
            case Constants::ALL_INCLUSIVE_PLAN_NAME:
                if (!(self::INCLUSIVE_PLAN === $yc)) {
                    goto u6;
                }
                $wj = true;
                u6:
                goto li;
            case Constants::STANDARD_PLAN_NAME:
                if (!(parent::STANDARD_PLAN === $yc)) {
                    goto hO;
                }
                $wj = true;
                hO:
                goto li;
            default:
                $wj = false;
        }
        AR:
        li:
        return $wj;
    }
    public static function get_plugin_display_name()
    {
        switch (Constants::PLAN_NAME) {
            case Constants::BASIC_API_CREATION_PLAN_NAME:
                return self::BASIC_API_CREATION_PLAN_DISPLAY_NAME;
            case Constants::ADVANCE_API_CREATION_PLAN_NAME:
                return self::ADVANCED_API_CREATION_PLAN_DISPLAY_NAME;
            case Constants::EXTERNAL_API_CONNECTION_PLAN_NAME:
                return self::EXTERNAL_API_INTEGRATION_PLAN_DISPLAY_NAME;
            case Constants::ALL_INCLUSIVE_PLAN_NAME:
                return self::INCLUSIVE_PLAN_DISPLAY_NAME;
            case Constants::STANDARD_PLAN_NAME:
                return self::STANDARD_PLAN_DISPLAY_NAME;
            default:
                return parent::STANDARD_PLAN_DISPLAY_NAME;
        }
        T5:
        iV:
    }
    public static function get_version()
    {
        switch (Constants::PLAN_NAME) {
            case Constants::BASIC_API_CREATION_PLAN_NAME:
                return self::BASIC_API_CREATION_PLAN;
            case Constants::ADVANCE_API_CREATION_PLAN_NAME:
                return self::ADVANCED_API_CREATION_PLAN;
            case Constants::EXTERNAL_API_CONNECTION_PLAN_NAME:
                return self::EXTERNAL_API_INTEGRATION_PLAN;
            case Constants::ALL_INCLUSIVE_PLAN_NAME:
                return self::INCLUSIVE_PLAN;
            case Constants::STANDARD_PLAN_NAME:
                return self::STANDARD_PLAN;
            default:
                return parent::STANDARD_PLAN;
        }
        pL:
        kU:
    }
    public static function schedule_cron($aj)
    {
        $DN = isset($aj["configuration"]["cron_settings"]) ? $aj["configuration"]["cron_settings"] : array();
        $PG = array("api_name" => $aj["connection_name"], "request_method" => $aj["method"]);
        if (wp_next_scheduled("mo_caw_cron_handler", $PG)) {
            goto zH;
        }
        if (isset($DN["is_cron_enabled"])) {
            goto ob;
        }
        goto Bo;
        zH:
        wp_clear_scheduled_hook("mo_caw_cron_handler", $PG);
        goto Bo;
        ob:
        $Ze = $DN["date_and_time"];
        $Ze = new \DateTime($Ze, new \DateTimeZone(wp_timezone_string()));
        $Wj = $Ze->getTimestamp();
        $j_ = strtolower($DN["frequency"]);
        wp_schedule_event($Wj, $j_, "mo_caw_cron_handler", $PG);
        Bo:
    }
    public static function miniorange_encoder($Fd)
    {
        $ql = base64_encode("mo_caw_user_details");
        $Wi = DB_Utils::get_option($ql, array());
        $mh = base64_encode("mo_caw_customer_token");
        $Uj = $Wi[$mh] ?? false;
        $Uj = false !== $Uj ? base64_decode($Uj) : $Uj;
        if ($Uj) {
            goto VX;
        }
        return false;
        VX:
        $Uj = str_split(str_pad('', strlen($Fd), $Uj, STR_PAD_RIGHT));
        $HN = str_split($Fd);
        foreach ($HN as $Ya => $vR) {
            $xP = ord($vR) + ord($Uj[$Ya]);
            $HN[$Ya] = chr($xP > 255 ? $xP - 256 : $xP);
            uR:
        }
        iE:
        return base64_encode(join('', $HN));
    }
    public static function miniorange_decoder($Fd)
    {
        $ql = base64_encode("mo_caw_user_details");
        $Wi = DB_Utils::get_option($ql, array());
        $mh = base64_encode("mo_caw_customer_token");
        $Uj = $Wi[$mh] ?? false;
        $Uj = false !== $Uj ? base64_decode($Uj) : $Uj;
        if ($Uj) {
            goto lP;
        }
        return false;
        lP:
        $Uj = str_split(str_pad('', strlen($Fd), $Uj, STR_PAD_RIGHT));
        $HN = str_split(base64_decode($Fd));
        foreach ($HN as $Ya => $vR) {
            $xP = ord($vR) - ord($Uj[$Ya]);
            $HN[$Ya] = chr($xP < 0 ? $xP + 256 : $xP);
            KK:
        }
        s5:
        return join('', $HN);
    }
    public static function get_nested_attribute_value($qq, $NM, $oP = false)
    {
        if (is_array($NM)) {
            goto KJ;
        }
        $NM = (array) $NM;
        KJ:
        $ng = !empty($NM[$qq]) ? $NM[$qq] : $oP;
        if (!(strpos($qq, "->") !== false)) {
            goto RU;
        }
        $xz = explode("->", $qq);
        $ZS = 0;
        foreach ($xz as $qq) {
            $NM = isset($NM[$qq]) ? $NM[$qq] : array();
            $NM = is_object($NM) ? (array) $NM : $NM;
            if (count($xz) - 1 === $ZS) {
                goto AA;
            }
            $NM = is_array($NM) ? $NM : array();
            goto hS;
            AA:
            $NM = !empty($NM) ? $NM : $oP;
            hS:
            ++$ZS;
            bC:
        }
        Mv:
        $ng = $NM;
        RU:
        return $ng;
    }
    public static function validate_license_expiry()
    {
        global $GT;
        if (!(true === $GT::is_license_expired()["STATUS"])) {
            goto Ud;
        }
        $Ma = $GT::get_expiry_date();
        $Wi = DB_Utils::get_option("mo_caw_user_display_details", array());
        $AO = $Wi["user_email"] ?? '';
        $nm = array("status" => Constants::ERROR, "code" => 403, "error" => Constants::FORBIDDEN, "error_description" => "Your " . self::get_plugin_display_name() . " plan for the miniOrange Custom API for WP Plugin under account " . $AO . " has already expired on " . $Ma . ". If have any questions regarding renewal, kindly contact us immediately at apisupport@xecurify.com.");
        wp_send_json_error($nm);
        Ud:
    }
    public static function send_custom_api_response($bS, $tN)
    {
        $jZ = $bS["status_code"] ?? 200;
        if ($tN) {
            goto PY;
        }
        $bS = $bS["data"] ?? $bS;
        wp_send_json($bS, $jZ);
        PY:
        $nm = self::get_dynamic_response($bS, $tN);
        wp_send_json($nm, $jZ);
    }
    public static function get_dynamic_response($bS, $nm = array())
    {
        foreach ($nm as $O0 => $I4) {
            if (is_string($I4) && "$response_data" === stripslashes($I4)) {
                goto UT;
            }
            if (is_array($I4)) {
                goto PD;
            }
            goto KM;
            UT:
            $nm[$O0] = !empty($bS["data"]) ? $bS["data"] : false;
            goto KM;
            PD:
            foreach ($I4 as $v8 => $RU) {
                if (!(is_string($RU) && "$response_data" === stripslashes($RU))) {
                    goto bT;
                }
                $I4[$v8] = !empty($bS["data"]) ? $bS["data"] : false;
                bT:
                w_:
            }
            cM:
            $nm[$O0] = $I4;
            KM:
            m4:
        }
        F8:
        return $nm;
    }
}



© 2023 Quttera Ltd. All rights reserved.