403Webshell
Server IP : 104.21.14.103  /  Your IP : 18.119.106.78
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/khowordpress.com/wp-content/plugins/duplicator-pro/classes/utilities/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/khowordpress.com/wp-content/plugins/duplicator-pro/classes/utilities/tests/class.u.test.result.php
<?php
defined("ABSPATH") or die("");

/**
 * Test result object
 *
 * Standard: PSR-2
 * @link http://www.php-fig.org/psr/psr-2
 *
 * @package DUP_PRO
 * @subpackage classes/utilities/test
 * @copyright (c) 2017, Snapcreek LLC
 * @license	https://opensource.org/licenses/GPL-3.0 GNU Public License
 * @since 3.7.9
 *
 */
class DUP_PRO_U_Test_result
{
    const TEST_FAIL    = -1;
    const TEST_PASS    = 0;
    const TEST_INFO    = 1;
    const TEST_WARNING = 2;
    const TEST_WAIT    = 3;

    public $pass      = self::TEST_FAIL;
    public $title     = '';
    public $desc      = '';
    public $htmlClass = '';

    /**
     *
     * @param int $pass
     * @param string $title
     * @param string $desc
     */
    public function __construct($pass = self::TEST_FAIL, $title = '', $desc = '', $htmlClass = '')
    {
        $this->pass      = $pass;
        $this->title     = $title;
        $this->desc      = $desc;
        $this->htmlClass = $htmlClass;
    }

    /**
     *
     * @param string $title
     * @param string $content // html string
     */
    public function addDescSection($title, $content)
    {
        $this->desc .= self::getDescSection($title, $content);
    }

    /**
     * Return test desc html section
     *
     * @param string $title
     * @param string $content // html string
     * @return string // html formatted
     */
    protected static function getDescSection($title, $content)
    {
        ob_start();
        ?>
        <fieldset class="d_section" >
            <legend><?php echo esc_html($title) ?></legend>
            <?php echo $content; ?>
        </fieldset>
        <?php
        return ob_get_clean();
    }

    public function getTestHtmlPassCheck()
    {
        return '<span class="'.$this->getTestPassClasses().'">'.$this->getTestPassLabel().'</span>';
    }

    public function getTestPassClasses()
    {
        $result = 'test-check ';

        switch ($this->pass) {
            case self::TEST_PASS:
                $result .= 'pass';
                break;
            case self::TEST_INFO:
                $result .= 'info';
                break;
            case self::TEST_WARNING:
                $result .= 'warning';
                break;
            case self::TEST_WAIT:
                $result .= 'wait';
                break;
            case self::TEST_FAIL:
            default:
                $result .= 'fail';
                break;
        }

        return $result;
    }

    public function getTestPassLabel()
    {
        $result = '';
        switch ($this->pass) {
            case self::TEST_PASS:
                $result .= 'Pass';
                break;
            case self::TEST_INFO:
                $result .= 'Info';
                break;
            case self::TEST_WARNING:
                $result .= 'Warn';
                break;
            case self::TEST_WAIT:
                $result .= '<i class="fas fa-circle-notch fa-spin"></i> Wait';
                break;
            case self::TEST_FAIL:
            default:
                $result .= 'Fail';
                break;
        }
        return $result;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit