PluginProbe
Email Log / 2.1.0
Email Log v2.1.0
2.63 2.4.8 2.4.9 2.6 2.61 2.62 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8.1 0.9 0.9.1 0.9.2 1.1 1.5 1.5.1 1.5.2 1.5.3 1.5.4 All 61 releases
email-log / include / Addon / EmailLogAddon.php

EmailLogAddon.php in Email Log 2.1.0, at include/Addon/EmailLogAddon.php

59 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace EmailLog\Addon;
2
3 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
4
5 /**
6 * Base Email Log Addon.
7 *
8 * @since 2.0.0
9 */
10 abstract class EmailLogAddon {
11
12 protected $addon_file;
13 protected $addon_name = '';
14 protected $addon_version = '';
15 protected $addon_author = 'Sudar Muthu';
16
17 /**
18 * Addon Updater.
19 *
20 * @var \EmailLog\Addon\AddonUpdater
21 */
22 private $updater;
23
24 /**
25 * Initialize add-on data.
26 *
27 * @access protected
28 * @return void
29 */
30 abstract protected function initialize();
31
32 /**
33 * Construct a new EmailLogAddon instance.
34 *
35 * @param string $addon_file Addon main file.
36 * @param \EmailLog\Addon\AddonUpdater|null $updater Addon Updater.
37 */
38 public function __construct( $addon_file, $updater = null ) {
39 $this->addon_file = $addon_file;
40 $this->updater = $updater;
41
42 $this->initialize();
43 }
44
45 /**
46 * Load the add-on and setup hooks.
47 *
48 * @inheritdoc
49 */
50 public function load() {
51 if ( is_null( $this->updater ) ) {
52 return;
53 }
54
55 $this->updater->set_addon_data( $this->addon_name, $this->addon_version, $this->addon_author );
56 $this->updater->load();
57 }
58 }
59