PluginProbe
EmailKit – Email Customizer for WooCommerce & WP / 1.6.9
EmailKit – Email Customizer for WooCommerce & WP v1.6.9
1.6.9 1.6.8 1.6.7 trunk 1.0.0 1.2.0 1.4.0 1.4.5 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6
← All changes | EmailKit.php +58 -7 1.2.01.6.9 View file →
@@ -4,9 +4,10 @@
4 4 * Plugin Name: EmailKit
5 5 * Plugin URI: https://wpmet.com/plugin/emailkit/
6 6 * Description: EmailKit is the most-complete drag-and-drop Email template builder.
7 7 * Author: wpmet
8 - * Version: 1.2.0
8 + * Author URI: https://wpmet.com
9 + * Version: 1.6.9
9 10 * Text Domain: emailkit
10 11 * License: GPLv3
11 12 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
12 13 */
@@ -14,8 +15,9 @@
14 15 exit;
15 16 }
16 17
17 18 require_once __DIR__ . '/vendor/autoload.php';
19 +require_once __DIR__ . '/traits/singleton.php';
18 20
19 21 /**
20 22 * The main plugin class
21 23 */
@@ -34,10 +36,14 @@
34 36 private function __construct()
35 37 {
36 38 $this->define_constants();
37 39 register_activation_hook(__FILE__, [$this, 'activate']);
40 + register_deactivation_hook(__FILE__, [$this,'deactivate_emailkit']);
38 41
39 - add_action('plugins_loaded', [$this, 'init_plugin']);
42 + add_action('plugins_loaded', [$this, 'init_plugin'], 112);
43 + add_action('init', [$this, 'load_textdomain'], 0);
44 + add_action('init', [$this, 'init_promotional'], 10);
45 + add_action( 'admin_enqueue_scripts',[$this, 'emailkit_global_assets'] );
40 46 }
41 47
42 48 /**
43 49 * Initializes a singleton instance
@@ -63,20 +69,20 @@
63 69 * @return void
64 70 */
65 71 public function define_constants()
66 72 {
67 - define('EMAILKIT_VERSION', '1.2.0'.time());
73 + define('EMAILKIT_VERSION', '1.6.9');
68 74 define('EMAILKIT_TEXTDOMAIN', 'emailkit');
69 75 define('EMAILKIT_FILE', __FILE__);
70 76 define('EMAILKIT_PATH', __DIR__);
71 77 define('EMAILKIT_URL', trailingslashit(plugin_dir_url(EMAILKIT_FILE)));
72 78 define('EMAILKIT_DIR', trailingslashit(plugin_dir_path(__FILE__)));
73 - define('EMAILKIT_TEMAPLTE_DIR', EMAILKIT_DIR . '/includes/admin/');
74 - define('EMAILKIT_ASSETS', EMAILKIT_URL . '/assets');
79 + define('EMAILKIT_INC', EMAILKIT_URL . 'includes/');
80 + define('EMAILKIT_ADMIN', EMAILKIT_INC . 'Admin/');
81 + define('EMAILKIT_ASSETS', EMAILKIT_URL . 'assets');
75 82 define('EMAILKIT_CONFIG', []);
76 83 }
77 84
78 -
79 85
80 86 /**
81 87 * Initialize the plugin
82 88 *
@@ -83,12 +89,44 @@
83 89 * @return void
84 90 */
85 91 public function init_plugin()
86 92 {
93 + do_action('emailkit/before_loaded');
94 +
87 95 new EmailKit\Admin();
96 +
97 + do_action('emailkit/after_loaded');
88 98 }
89 99
90 100 /**
101 + * Load the plugin translations
102 + *
103 + * @return void
104 + */
105 + public function load_textdomain()
106 + {
107 + load_plugin_textdomain('emailkit', false, dirname(plugin_basename(EMAILKIT_FILE)) . '/languages');
108 + }
109 +
110 + /**
111 + * Initialize the promotional classes
112 + *
113 + * Runs on `init` because these classes translate strings while booting,
114 + * and translations must not be loaded before `init`.
115 + *
116 + * @return void
117 + */
118 + public function init_promotional()
119 + {
120 + (new EmailKit\Promotional\Promotional())->init();
121 + }
122 +
123 + public function emailkit_global_assets()
124 + {
125 + wp_enqueue_style('emailkit-admin-style', EMAILKIT_URL . 'assets/admin/css/emailkit-global.css', [], EMAILKIT_VERSION);
126 + }
127 +
128 + /**
91 129 * Do stuff upon plugin activation
92 130 */
93 131 public function activate()
94 132 {
@@ -106,9 +144,23 @@
106 144 *
107 145 * @param string $option
108 146 */
109 147 update_option('emailkit_version', EMAILKIT_VERSION);
148 +
149 + // After Active Plugin CPT menu for EmailKit
150 + $cpt = new EmailKit\Admin\CPT();
151 + $cpt->postType();
152 + $cpt->add_role();
153 +
154 + flush_rewrite_rules();
155 +
110 156 }
157 +
158 + // Deactivate plugin
159 + function deactivate_emailkit() {
160 + }
161 +
162 +
111 163 }
112 164 /**.
113 165 * Initializes the main plugin
114 166 *
@@ -113,7 +165,6 @@
113 165 * Initializes the main plugin
114 166 *
115 167 * @return \EmailKit
116 168 */
117 -
118 169
119 170 EmailKit::init();