HEX
Server: LiteSpeed
System: Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User: swifizcd (1555)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/swifizcd/mitmeherbals.com.ng/wp-content/plugins/yaysmtp/includes/Dashboard.php
<?php
namespace YaySMTP;

use YaySMTP\Helper\Utils;

defined( 'ABSPATH' ) || exit;

class Dashboard {
	protected static $instance = null;

	public static function getInstance() {
		if ( null == self::$instance ) {
			self::$instance = new self();
			self::$instance->doHooks();
		}

		return self::$instance;
	}

	private function doHooks() {
		if ( current_user_can( 'manage_options' ) ) {
			add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
		}
	}

	private function __construct() {}

	public function init() {
		wp_add_dashboard_widget( 'yaysmtp_analytics_email', __( 'YaySMTP Stats', 'yay-smtp' ), array( $this, 'analyticsEmailWidget' ), null, null, 'normal', 'high' );
	}

	public function analyticsEmailWidget() {
		$templatePart = YAY_SMTP_PLUGIN_PATH . 'includes/Views/template-part';
		Utils::getTemplatePart( $templatePart, 'analytics-email-widget-tpl', array() );
	}
}