HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpamazingsecret/wp-content/plugins_/woo-discount-rules/v1/index.php
<?php
if (!defined('ABSPATH')) exit; // Exit if accessed directly

/**
 * Plugin Directory URI.
 */
define('WOO_DISCOUNT_URI', untrailingslashit(plugin_dir_url(__FILE__)));

Class WDRV1Deprecated {

    /**
     * Init events
     * */
    public function init(){
        add_action('admin_menu', array(__CLASS__, 'adminMenu'));
    }

    /**
     * Load admin menu
     * */
    public static function adminMenu(){
        if (!is_admin()) return;
        global $submenu;
        if (isset($submenu['woocommerce'])) {
            add_submenu_page(
                'woocommerce',
                __('Woo Discount Rules', 'woo-discount-rules'),
                __('Woo Discount Rules', 'woo-discount-rules'),
                'manage_woocommerce', 'woo_discount_rules',
                array(__CLASS__, 'loadWDRV1DeprecatedHTML')
            );
        }
    }

    /**
     * Load HTML content
     * */
    public static function loadWDRV1DeprecatedHTML(){
        include_once(__DIR__ . "/menu-html.php");
    }

    /**
     * Create nonce for v1
     * @param int $action
     * @return mixed
     */
    public static function createNonce($action = -1){
        return wp_create_nonce($action);
    }

    /**
     * Verify nonce
     * @param $nonce
     * @param int $action
     * @return bool
     */
    protected static function verifyNonce($nonce, $action = -1 ){
        if (wp_verify_nonce($nonce, $action)){
            return true;
        } else {
            return false;
        }
    }

    /**
     * check valid nonce for v1
     * @param $method
     * @param null $wdr_nonce
     * @return bool
     */
    public static function validateRequest($method, $wdr_nonce = null){
        if($wdr_nonce === null){
            if(isset($_REQUEST['wdr_nonce']) && !empty($_REQUEST['wdr_nonce'])){
                if(self::verifyNonce(wp_unslash($_REQUEST['wdr_nonce']), $method)){
                    return true;
                }
            }
        } else {
            if(self::verifyNonce(wp_unslash($wdr_nonce), $method)){
                return true;
            }
        }

        die(__('Invalid token', 'woo-discount-rules'));
    }
}

(new WDRV1Deprecated())->init();