HEX
Server: Apache
System: Linux webm003.cluster111.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: assotraipi (849654)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/assotraipi/www/wp-content/plugins/download-monitor/src/Admin/Settings/Fields/ActionButton.php
<?php

class DLM_Admin_Fields_Field_ActionButton extends DLM_Admin_Fields_Field {

	/** @var string */
	private $link;

	/** @var string */
	private $label;

	/**
	 * DLM_Admin_Fields_Field constructor.
	 *
	 * @param String $name
	 * @param String $link
	 * @param String $label
	 */
	public function __construct( $name, $link, $label ) {
		$this->link  = $link;
		$this->label = $label;
		parent::__construct( $name, '', '' );
	}

	/**
     * Generate nonce
     *
	 * @return string
	 */
	private function generate_nonce() {
		return wp_create_nonce( $this->get_name() );
	}

	/**
     * Get prepped URL
     *
	 * @return string
	 */
	private function get_url() {
		return add_query_arg( array(
			'dlm_action' => $this->get_name(),
			'dlm_nonce'  => $this->generate_nonce()
		), $this->link );
    }

	/**
	 * Renders field
	 *
	 * The Button is quite an odd 'field'. It's basically just an a tag.
	 */
	public function render() {
		?>
        <a class="button" href="<?php echo esc_url( $this->get_url() ); ?>"><?php echo esc_html( $this->label ); ?></a>
		<?php
	}

}