# yaymail/3.4.1/includes/Plugin.php

YayMail – WooCommerce Email Customizer, version 3.4.1. 51 lines.

- Page: https://pluginprobe.com/plugins/yaymail/3.4.1/code/includes/Plugin.php
- Raw: https://pluginprobe.com/plugins/yaymail/3.4.1/raw/includes/Plugin.php
- Modified: 2023-12-04T14:12:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yaymail/3.4.1/code/includes/Plugin.php#L10-L20`.

```php
<?php
namespace YayMail;

use YayMail\Page\Source\CustomPostType;

defined( 'ABSPATH' ) || exit;
/**
 * Plugin activate/deactivate logic
 */
class Plugin {

	protected static $instance = null;

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

		return self::$instance;
	}

	private function do_hooks() {
		add_action( 'init', array( $this, 'init' ) );
	}

	public function init() {
		$versionCurrent = YAYMAIL_VERSION;
		$versionOld     = get_option( 'yaymail_version' );
		if ( $versionCurrent != $versionOld ) {
			self::activate();
		}
	}

	/**
	 *
	 * Plugin activated hook
	 */
	public static function activate() {
		Helper\ActivePlugin::getInstance();
	}

	/**
	 *
	 * Plugin deactivate hook
	 */
	public static function deactivate() {

	}
}

```
