PluginProbe ʕ •ᴥ•ʔ
Email Encoder – Protect Email Addresses and Phone Numbers / 2.2.0
Email Encoder – Protect Email Addresses and Phone Numbers v2.2.0
2.5.0 2.4.8 trunk 0.10 0.11 0.12 0.20 0.21 0.22 0.30 0.31 0.32 0.40 0.41 0.42 0.50 0.60 0.70 0.71 0.80 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5 1.5.2 1.51 1.53 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7
email-encoder-bundle / core / class-email-encoder-bundle.php
email-encoder-bundle / core Last commit date
includes 2 years ago class-email-encoder-bundle.php 2 years ago index.php 2 years ago
class-email-encoder-bundle.php
150 lines
1 <?php
2 if ( ! class_exists( 'Email_Encoder' ) ) :
3
4 /**
5 * Main Email_Encoder Class.
6 *
7 * @since 2.0.0
8 * @package EEB
9 * @author Ironikus <info@ironikus.com>
10 */
11 final class Email_Encoder {
12
13 /**
14 * The real instance
15 *
16 * @var Email_Encoder
17 * @since 2.0.0
18 */
19 private static $instance;
20
21 /**
22 * EEB settings Object.
23 *
24 * @var object|Email_Encoder_Settings
25 * @since 2.0.0
26 */
27 public $settings;
28
29 /**
30 * EEB helpers Object.
31 *
32 * @var object|Email_Encoder_Helpers
33 * @since 2.0.0
34 */
35 public $helpers;
36
37 /**
38 * EEB validate Object.
39 *
40 * @var object|Email_Encoder_Validate
41 * @since 2.0.0
42 */
43 public $validate;
44
45 /**
46 * Throw error on object clone.
47 *
48 * Cloning instances of the class is forbidden.
49 *
50 * @since 2.0.0
51 * @return void
52 */
53 public function __clone() {
54 _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'email-encoder-bundle' ), '2.0.0' );
55 }
56
57 /**
58 * Disable unserializing of the class.
59 *
60 * @since 2.0.0
61 * @return void
62 */
63 public function __wakeup() {
64 _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'email-encoder-bundle' ), '2.0.0' );
65 }
66
67 /**
68 * Main Email_Encoder Instance.
69 *
70 * Insures that only one instance of Email_Encoder exists in memory at any one
71 * time. Also prevents needing to define globals all over the place.
72 *
73 * @since 2.0.0
74 * @static
75 * @staticvar array $instance
76 * @return object|Email_Encoder The one true Email_Encoder
77 */
78 public static function instance() {
79 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Email_Encoder ) ) {
80 self::$instance = new Email_Encoder;
81 self::$instance->base_hooks();
82 self::$instance->includes();
83 self::$instance->helpers = new Email_Encoder_Helpers();
84 self::$instance->settings = new Email_Encoder_Settings();
85 self::$instance->validate = new Email_Encoder_Validate();
86
87 new Email_Encoder_Ajax();
88 new EEB_Integrations_Loader();
89 new Email_Encoder_Run();
90
91 /**
92 * Fire a custom action to allow extensions to register
93 * after Email Encoder was successfully registered
94 */
95 do_action( 'eeb_plugin_loaded' );
96 }
97
98 return self::$instance;
99 }
100
101 /**
102 * Include required files.
103 *
104 * @access private
105 * @since 2.0.0
106 * @return void
107 */
108 private function includes() {
109 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-helpers.php';
110 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-settings.php';
111 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-validate.php';
112
113 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-ajax.php';
114 require_once EEB_PLUGIN_DIR . 'core/includes/functions/template-tags.php';
115
116 require_once EEB_PLUGIN_DIR . 'core/includes/integrations/loader.php';
117
118 if( is_admin() ){
119 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-run-admin.php';
120 } else {
121 require_once EEB_PLUGIN_DIR . 'core/includes/classes/class-email-encoder-bundle-run.php';
122 }
123
124 }
125
126 /**
127 * Add base hooks for the core functionality
128 *
129 * @access private
130 * @since 2.0.0
131 * @return void
132 */
133 private function base_hooks() {
134 add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
135 }
136
137 /**
138 * Loads the plugin language files.
139 *
140 * @access public
141 * @since 2.0.0
142 * @return void
143 */
144 public function load_textdomain() {
145 load_plugin_textdomain( EEB_TEXTDOMAIN, FALSE, dirname( plugin_basename( EEB_PLUGIN_FILE ) ) . '/languages/' );
146 }
147
148 }
149
150 endif; // End if class_exists check.