PluginProbe ʕ •ᴥ•ʔ
Firebase Authentication / 1.1.2
Firebase Authentication v1.1.2
trunk 1.0.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.8 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 1.6.7 1.6.8 1.6.9
firebase-authentication / includes / class-firebase-authentication.php
firebase-authentication / includes Last commit date
images 6 years ago class-firebase-authentication-activator.php 6 years ago class-firebase-authentication-deactivator.php 6 years ago class-firebase-authentication-i18n.php 6 years ago class-firebase-authentication-loader.php 6 years ago class-firebase-authentication.php 6 years ago index.php 6 years ago
class-firebase-authentication.php
231 lines
1 <?php
2
3 /**
4 * The file that defines the core plugin class
5 *
6 * A class definition that includes attributes and functions used across both the
7 * public-facing side of the site and the admin area.
8 *
9 * @link https://miniorange.com
10 * @since 1.0.0
11 *
12 * @package Firebase_Authentication
13 * @subpackage Firebase_Authentication/includes
14 */
15
16 /**
17 * The core plugin class.
18 *
19 * This is used to define internationalization, admin-specific hooks, and
20 * public-facing site hooks.
21 *
22 * Also maintains the unique identifier of this plugin as well as the current
23 * version of the plugin.
24 *
25 * @since 1.0.0
26 * @package Firebase_Authentication
27 * @subpackage Firebase_Authentication/includes
28 * @author miniOrange <info@miniorange.com>
29 */
30 class MO_Firebase_Authentication {
31
32 /**
33 * The loader that's responsible for maintaining and registering all hooks that power
34 * the plugin.
35 *
36 * @since 1.0.0
37 * @access protected
38 * @var MO_Firebase_Authentication_Loader $loader Maintains and registers all hooks for the plugin.
39 */
40 protected $loader;
41
42 /**
43 * The unique identifier of this plugin.
44 *
45 * @since 1.0.0
46 * @access protected
47 * @var string $plugin_name The string used to uniquely identify this plugin.
48 */
49 protected $plugin_name;
50
51 /**
52 * The current version of the plugin.
53 *
54 * @since 1.0.0
55 * @access protected
56 * @var string $version The current version of the plugin.
57 */
58 protected $version;
59
60 /**
61 * Define the core functionality of the plugin.
62 *
63 * Set the plugin name and the plugin version that can be used throughout the plugin.
64 * Load the dependencies, define the locale, and set the hooks for the admin area and
65 * the public-facing side of the site.
66 *
67 * @since 1.0.0
68 */
69 public function __construct() {
70 if ( defined( 'FIREBASE_AUTHENTICATION_VERSION' ) ) {
71 $this->version = FIREBASE_AUTHENTICATION_VERSION;
72 } else {
73 $this->version = '1.0.0';
74 }
75 $this->plugin_name = 'firebase-authentication';
76
77 $this->load_dependencies();
78 $this->set_locale();
79 $this->define_admin_hooks();
80 //$this->define_public_hooks();
81
82 }
83
84 /**
85 * Load the required dependencies for this plugin.
86 *
87 * Include the following files that make up the plugin:
88 *
89 * - MO_Firebase_Authentication_Loader. Orchestrates the hooks of the plugin.
90 * - MO_Firebase_Authentication_i18n. Defines internationalization functionality.
91 * - MO_Firebase_Authentication_Admin. Defines all hooks for the admin area.
92 * - MO_Firebase_Authentication_Public. Defines all hooks for the public side of the site.
93 *
94 * Create an instance of the loader which will be used to register the hooks
95 * with WordPress.
96 *
97 * @since 1.0.0
98 * @access private
99 */
100 private function load_dependencies() {
101
102 /**
103 * The class responsible for orchestrating the actions and filters of the
104 * core plugin.
105 */
106 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-firebase-authentication-loader.php';
107
108 /**
109 * The class responsible for defining internationalization functionality
110 * of the plugin.
111 */
112 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-firebase-authentication-i18n.php';
113
114 /**
115 * The class responsible for defining all actions that occur in the admin area.
116 */
117 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-firebase-authentication-admin.php';
118
119 /**
120 * The class responsible for defining all actions that occur in the public-facing
121 * side of the site.
122 */
123 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-firebase-authentication-public.php';
124
125 $this->loader = new MO_Firebase_Authentication_Loader();
126
127 }
128
129 /**
130 * Define the locale for this plugin for internationalization.
131 *
132 * Uses the MO_Firebase_Authentication_i18n class in order to set the domain and to register the hook
133 * with WordPress.
134 *
135 * @since 1.0.0
136 * @access private
137 */
138 private function set_locale() {
139
140 $plugin_i18n = new MO_Firebase_Authentication_i18n();
141
142 $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
143
144 }
145
146 /**
147 * Register all of the hooks related to the admin area functionality
148 * of the plugin.
149 *
150 * @since 1.0.0
151 * @access private
152 */
153 private function define_admin_hooks() {
154
155 $plugin_admin = new MO_Firebase_Authentication_Admin( $this->get_plugin_name(), $this->get_version() );
156 add_action( 'admin_menu', array( $this, 'miniorange_firebase_menu' ) );
157 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
158 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
159 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_admin, 'enqueue_firebase_scripts' );
160 $this->loader->add_action( 'login_footer', $plugin_admin, 'enqueue_firebase_wp_login_scripts' );
161
162 }
163
164 /**
165 * Register all of the hooks related to the public-facing functionality
166 * of the plugin.
167 *
168 * @since 1.0.0
169 * @access private
170 */
171 /*private function define_public_hooks() {
172
173 $plugin_public = new MO_Firebase_Authentication_Public( $this->get_plugin_name(), $this->get_version() );
174
175 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
176 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
177
178 }*/
179
180 function miniorange_firebase_menu() {
181 //Add miniOrange plugin to the menu
182 $page = add_menu_page("Configuration", "Firebase Authentication","manage_options", "mo_firebase_configuration",array($this, 'mo_firebase_auth_options') ,plugin_dir_url(__FILE__) . '../public/images/miniorange.png' );
183 }
184
185 function mo_firebase_auth_options() {
186 $plugin_admin = new MO_Firebase_Authentication_Admin( $this->get_plugin_name(), $this->get_version() );
187 $plugin_admin->mo_firebase_auth_page();
188 }
189
190 /**
191 * Run the loader to execute all of the hooks with WordPress.
192 *
193 * @since 1.0.0
194 */
195 public function run() {
196 $this->loader->run();
197 }
198
199 /**
200 * The name of the plugin used to uniquely identify it within the context of
201 * WordPress and to define internationalization functionality.
202 *
203 * @since 1.0.0
204 * @return string The name of the plugin.
205 */
206 public function get_plugin_name() {
207 return $this->plugin_name;
208 }
209
210 /**
211 * The reference to the class that orchestrates the hooks with the plugin.
212 *
213 * @since 1.0.0
214 * @return MO_Firebase_Authentication_Loader Orchestrates the hooks of the plugin.
215 */
216 public function get_loader() {
217 return $this->loader;
218 }
219
220 /**
221 * Retrieve the version number of the plugin.
222 *
223 * @since 1.0.0
224 * @return string The version number of the plugin.
225 */
226 public function get_version() {
227 return $this->version;
228 }
229
230 }
231