PluginProbe ʕ •ᴥ•ʔ
Firebase Authentication / 1.7.0
Firebase Authentication v1.7.0
1.7.0 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-mo-firebase-authentication.php
firebase-authentication / includes Last commit date
images 1 day ago class-mo-firebase-authentication-deactivator.php 1 day ago class-mo-firebase-authentication-loader.php 1 day ago class-mo-firebase-authentication.php 1 day ago
class-mo-firebase-authentication.php
191 lines
1 <?php
2 /**
3 * The file that defines the core plugin class
4 *
5 * A class definition that includes attributes and functions used across both the
6 * public-facing side of the site and the admin area.
7 *
8 * @link https://miniorange.com
9 * @since 1.0.0
10 *
11 * @package Firebase_Authentication
12 * @subpackage Firebase_Authentication/includes
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * The core plugin class.
21 *
22 * This is used to define internationalization, admin-specific hooks, and
23 * public-facing site hooks.
24 *
25 * Also maintains the unique identifier of this plugin as well as the current
26 * version of the plugin.
27 *
28 * @since 1.0.0
29 * @package Firebase_Authentication
30 * @subpackage Firebase_Authentication/includes
31 * @author miniOrange <info@miniorange.com>
32 */
33 class MO_Firebase_Authentication {
34
35 /**
36 * The loader that's responsible for maintaining and registering all hooks that power
37 * the plugin.
38 *
39 * @since 1.0.0
40 * @access protected
41 * @var MO_Firebase_Authentication_Loader $loader Maintains and registers all hooks for the plugin.
42 */
43 protected $loader;
44
45 /**
46 * The unique identifier of this plugin.
47 *
48 * @since 1.0.0
49 * @access protected
50 * @var string $plugin_name The string used to uniquely identify this plugin.
51 */
52 protected $plugin_name;
53
54 /**
55 * The current version of the plugin.
56 *
57 * @since 1.0.0
58 * @access protected
59 * @var string $version The current version of the plugin.
60 */
61 protected $version;
62
63 /**
64 * Define the core functionality of the plugin.
65 *
66 * Set the plugin name and the plugin version that can be used throughout the plugin.
67 * Load the dependencies, define the locale, and set the hooks for the admin area and
68 * the public-facing side of the site.
69 *
70 * @since 1.0.0
71 */
72 public function __construct() {
73 if ( defined( 'MO_FIREBASE_AUTHENTICATION_VERSION' ) ) {
74 $this->version = MO_FIREBASE_AUTHENTICATION_VERSION;
75 } else {
76 $this->version = '1.0.0';
77 }
78 update_option( 'mo_firebase_authentication_current_plugin_version ', $this->version );
79 $this->plugin_name = 'firebase-authentication';
80
81 $this->load_dependencies();
82 $this->define_admin_hooks();
83 }
84
85 /**
86 * Load the required dependencies for this plugin.
87 *
88 * Include the following files that make up the plugin:
89 *
90 * - MO_Firebase_Authentication_Loader. Orchestrates the hooks of the plugin.
91 * - MO_Firebase_Authentication_Admin. Defines all hooks for the admin area.
92 *
93 * Create an instance of the loader which will be used to register the hooks
94 * with WordPress.
95 *
96 * @since 1.0.0
97 * @access private
98 */
99 private function load_dependencies() {
100
101 /**
102 * The class responsible for orchestrating the actions and filters of the
103 * core plugin.
104 */
105 require_once MO_FIREBASE_AUTHENTICATION_DIR . 'includes' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-loader.php';
106
107 /**
108 * The class responsible for defining all actions that occur in the admin area.
109 */
110 require_once MO_FIREBASE_AUTHENTICATION_DIR . 'admin' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin.php';
111
112 $this->loader = new MO_Firebase_Authentication_Loader();
113
114 }
115
116 /**
117 * Register all of the hooks related to the admin area functionality
118 * of the plugin.
119 *
120 * @since 1.0.0
121 * @access private
122 */
123 private function define_admin_hooks() {
124
125 $plugin_admin = new MO_Firebase_Authentication_Admin( $this->get_plugin_name(), $this->get_version() );
126 add_action( 'admin_menu', array( $this, 'miniorange_firebase_menu' ) );
127 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
128 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
129 }
130
131 /**
132 * Add miniOrange plugin to the menu
133 *
134 * @return void
135 */
136 public function miniorange_firebase_menu() {
137 $page = add_menu_page( 'Configuration', 'Firebase Authentication', 'manage_options', 'mo_firebase_authentication', array( $this, 'mo_firebase_auth_options' ), MO_FIREBASE_AUTHENTICATION_URL . 'public/images/miniorange.png' );
138 }
139
140 /**
141 * Initialize plugin screen from admin menu
142 *
143 * @return void
144 */
145 public function mo_firebase_auth_options() {
146 $plugin_admin = new MO_Firebase_Authentication_Admin( $this->get_plugin_name(), $this->get_version() );
147 $plugin_admin->mo_firebase_auth_page();
148 }
149
150 /**
151 * Run the loader to execute all of the hooks with WordPress.
152 *
153 * @since 1.0.0
154 */
155 public function run() {
156 $this->loader->run();
157 }
158
159 /**
160 * The name of the plugin used to uniquely identify it within the context of
161 * WordPress and to define internationalization functionality.
162 *
163 * @since 1.0.0
164 * @return string The name of the plugin.
165 */
166 public function get_plugin_name() {
167 return $this->plugin_name;
168 }
169
170 /**
171 * The reference to the class that orchestrates the hooks with the plugin.
172 *
173 * @since 1.0.0
174 * @return MO_Firebase_Authentication_Loader Orchestrates the hooks of the plugin.
175 */
176 public function get_loader() {
177 return $this->loader;
178 }
179
180 /**
181 * Retrieve the version number of the plugin.
182 *
183 * @since 1.0.0
184 * @return string The version number of the plugin.
185 */
186 public function get_version() {
187 return $this->version;
188 }
189
190 }
191