PluginProbe
SMTP for SendGrid – YaySMTP / trunk
SMTP for SendGrid – YaySMTP vtrunk
trunk 1.3 1.3.1 1.4 1.5 1.5.1
smtp-sendgrid / includes / Plugin.php

Plugin.php in SMTP for SendGrid – YaySMTP trunk, at includes/Plugin.php

43 lines 951 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace YaySMTPSendgrid;
3
4 defined( 'ABSPATH' ) || exit;
5
6 /**
7 * Plugin activate/deactivate logic
8 */
9 class Plugin {
10 protected static $instance = null;
11
12 public static function getInstance() {
13 if ( null == self::$instance ) {
14 self::$instance = new self();
15 self::$instance->doHooks();
16 }
17
18 return self::$instance;
19 }
20
21 private function doHooks() {
22 $optionVersion = YAY_SMTP_SENDGRID_PREFIX . '_version';
23 $current_version = get_option( $optionVersion );
24 if ( version_compare( YAY_SMTP_SENDGRID_VERSION, $current_version, '>' ) ) {
25 self::activate();
26 update_option( $optionVersion, YAY_SMTP_SENDGRID_VERSION );
27 }
28 Page\Settings::getInstance();
29 PluginCore::getInstance();
30 Functions::getInstance();
31 }
32
33 private function __construct() {}
34
35 /** Plugin activated hook */
36 public static function activate() {
37 Helper\Installer::getInstance();
38 }
39
40 /** Plugin deactivate hook */
41 public static function deactivate() {}
42 }
43