PluginProbe ʕ •ᴥ•ʔ
Firebase Authentication / 1.6.7
Firebase Authentication v1.6.7
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 / admin / partials / class-mo-firebase-authentication-admin-display.php
firebase-authentication / admin / partials Last commit date
account 1 year ago config 1 year ago support 1 year ago class-mo-firebase-authentication-admin-display.php 1 year ago
class-mo-firebase-authentication-admin-display.php
220 lines
1 <?php
2 /**
3 * Firebase Authentication
4 *
5 * @package firebase-authentication
6 */
7
8 /**
9 * Including the required php files to render admin conf file
10 */
11 require 'config' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-config.php';
12 require 'config' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-advsettings.php';
13 require 'config' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-loginsettings.php';
14 require 'config' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-licensing-plans.php';
15 require 'support' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-support.php';
16 require 'support' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-demo.php';
17 require 'account' . DIRECTORY_SEPARATOR . 'class-mo-firebase-authentication-admin-account.php';
18
19
20 /**
21 * Caller function to admin menu
22 *
23 * @return void
24 */
25 function mo_firebase_authentication_main_menu() {
26
27 $currenttab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Ignoring nonce verification because we are fetching data from URL and not on form submission.
28
29 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_menu( $currenttab );
30 echo '
31 <div id="mo_firebase_authentication_settings">';
32 echo '
33 <div class="miniorange_container">';
34 echo '
35 <table style="width:100%;">
36 <tr>
37 <td style="vertical-align:top;width:65%;" class="mo_firebase_authentication_content">';
38 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_tab( $currenttab );
39 Mo_Firebase_Authentication_Admin_Display::mo_firebase_auth_show_support_sidebar( $currenttab );
40 echo '</tr>
41 </table>
42 <div class="mo_firebase_authentication_tutorial_overlay" id="mo_firebase_authentication_tutorial_overlay" hidden></div>
43 </div>';
44 }
45
46 /**
47 * [Description Mo_Firebase_Authentication_Admin_Display]
48 */
49 class Mo_Firebase_Authentication_Admin_Display {
50
51 /**
52 * Dispplays the menu items
53 *
54 * @param mixed $currenttab tab name.
55 *
56 * @return void
57 */
58 public static function mo_firebase_auth_show_menu( $currenttab ) {
59 ?>
60 <!-- <div class="mo_firebase_auth_success_container" style="display:none;" id="mo_firebase_auth_success_container">
61 <div class="alert alert-success alert-dismissable" id="mo_firebase_auth_success_alert" data-fade="3000">
62 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
63 Configurations saved successfully.
64 </div>
65 </div> -->
66 <!-- <div class="mo_firebase_auth_error_container" style="display:none;" id="mo_firebase_auth_error_container">
67 <div class="alert alert-danger alert-dismissable" id="mo_firebase_auth_error_alert" data-fade="3000">
68 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
69 Please enter required fields.
70 </div>
71 </div> -->
72
73 <div style="margin-left:5px; overflow:hidden">
74 <div class="wrap">
75 <div class="wrap">
76 <div><img style="float:left;" src="<?php echo esc_url( MO_FIREBASE_AUTHENTICATION_URL . 'admin/images/logo.png' ); ?>"></div>
77 </div>
78 <h1>
79 miniOrange Firebase Authentication&nbsp
80 <a class="firebase-navbar-button" style="color:white;background: #2271b1;" href="https://plugins.miniorange.com/woocommerce-cloud-firestore-integration" target="_blank">Firestore Integrator</a>
81 <a class="firebase-navbar-button" href="https://forum.miniorange.com/" target="_blank">Ask questions on our forum</a>
82 <a class="firebase-navbar-button" href="https://developers.miniorange.com/docs/wordpress-firebase/hide-password-field-firebase" target="_blank">Feature Details</a>
83 <a class="firebase-navbar-button firebase-review-us" href="https://wordpress.org/support/plugin/firebase-authentication/reviews/?filter=5" target="_blank">Write a Review </a>
84 </h1>
85 </div>
86 <br>
87
88 <div class="row">
89 <div class="row mo_firebase_authentication_nav" style="border-bottom: 1px solid #cdcdcd">
90 <a href="admin.php?page=mo_firebase_authentication&tab=config" class="nav-tab
91 <?php
92 if ( '' === $currenttab || 'config' === $currenttab ) {
93 echo 'nav-tab-active';}
94 ?>
95 ">Configure</a>
96 <a href="admin.php?page=mo_firebase_authentication&tab=advsettings" class="nav-tab
97 <?php
98 if ( 'advsettings' === $currenttab ) {
99 echo 'nav-tab-active';}
100 ?>
101 ">Advanced Settings</a>
102 <a href="admin.php?page=mo_firebase_authentication&tab=loginsettings"class="nav-tab
103 <?php
104 if ( 'loginsettings' === $currenttab ) {
105 echo 'nav-tab-active';}
106 ?>
107 ">Login Settings</a>
108 <a href="admin.php?page=mo_firebase_authentication&tab=requestfordemo" class="nav-tab
109 <?php
110 if ( 'requestfordemo' === $currenttab ) {
111 echo 'nav-tab-active';}
112 ?>
113 ">Trials Available</a>
114 <a href="admin.php?page=mo_firebase_authentication&tab=account" class="nav-tab
115 <?php
116 if ( 'account' === $currenttab ) {
117 echo 'nav-tab-active';}
118 ?>
119 ">Account Setup</a>
120 <a href="admin.php?page=mo_firebase_authentication&tab=licensing_plans" class="nav-tab
121 <?php
122 if ( 'licensing_plans' === $currenttab ) {
123 echo 'nav-tab-active';}
124 ?>
125 ">Licensing Plans</a>
126
127 </div>
128 </div>
129 </div>
130
131 <script>
132 /*jQuery("#mo_firebase_auth_contact_us_phone").intlTelInput();
133 function mo_firebase_auth_contact_us_valid_query(f) {
134 !(/^[a-zA-Z?,.\(\)\/@ 0-9]*$/).test(f.value) ? f.value = f.value.replace(
135 /[^a-zA-Z?,.\(\)\/@ 0-9]/, '') : null;
136 }*/
137
138 jQuery("#mo_firebase_auth_test_config_button").on("click", function(event) {
139 var test_username = document.forms["test_configuration_form"]["test_username"].value;
140 var test_password = document.forms["test_configuration_form"]["test_password"].value;
141 if( test_username == "" || test_password == "" ){
142 return;
143 }
144 event.preventDefault();
145 let url = "<?php echo esc_url( site_url() ); ?>/?mo_action=firebaselogin&test=true";
146 jQuery("#mo_firebasetestconfig").attr("action", url);
147 let newwindow = window.open("about:blank", 'firebasetestconfig', 'location=yes,height=700,width=600,scrollbars=yes,status=yes');
148 jQuery("#mo_firebasetestconfig").submit();
149 });
150 function mo_firebase_auth_showDiv(){
151 document.getElementById("mo_firebase_auth_enable_admin_wp_login_div").style.display = "block";
152 }
153 function mo_firebase_auth_hideDiv(){
154 document.getElementById("mo_firebase_auth_enable_admin_wp_login_div").style.display = "none";
155 }
156
157 </script>
158 <?php
159 }
160
161 /**
162 * Selects the appropriate display for a tab selected
163 *
164 * @param mixed $currenttab tab name.
165 *
166 * @return void
167 */
168 public static function mo_firebase_auth_show_tab( $currenttab ) {
169 if ( 'account' === $currenttab ) {
170 if ( 'true' === get_option( 'mo_firebase_authentication_verify_customer' ) ) {
171 Mo_Firebase_Authentication_Admin_Account::verify_password();
172 } elseif ( '' !== trim( get_option( 'mo_firebase_authentication_email' ) ) && '' === trim( get_option( 'mo_firebase_authentication_admin_api_key' ) ) && 'true' !== get_option( 'mo_firebase_authentication_new_registration' ) ) {
173 Mo_Firebase_Authentication_Admin_Account::verify_password();
174 } else {
175 Mo_Firebase_Authentication_Admin_Account::register();
176 }
177 } elseif ( '' === $currenttab || 'config' === $currenttab ) {
178 Mo_Firebase_Authentication_Admin_Config::mo_firebase_authentication_config();
179 } elseif ( 'advsettings' === $currenttab ) {
180 Mo_Firebase_Authentication_Admin_AdvSettings::mo_firebase_authentication_advsettings();
181 } elseif ( 'loginsettings' === $currenttab ) {
182 Mo_Firebase_Authentication_Admin_LoginSettings::mo_firebase_authentication_loginsettings();
183 } elseif ( 'licensing_plans' === $currenttab ) {
184 Mo_Firebase_Authentication_Admin_Licensing_Plans::mo_firebase_authentication_licensing_plans();
185 } elseif ( 'faq' === $currenttab ) {
186 Mo_Firebase_Authentication_Admin_FAQ::mo_firebase_authentication_faq();
187 } elseif ( 'requestfordemo' === $currenttab ) {
188 Mo_Firebase_Authentication_Admin_Demo::mo_firebase_authentication_handle_demo();
189 }
190 }
191
192 /**
193 * Render contact us form in sidebar
194 *
195 * @param mixed $currenttab tab name.
196 *
197 * @return void
198 */
199 public static function mo_firebase_auth_show_support_sidebar( $currenttab ) {
200 if ( 'licensing_plans' !== $currenttab ) {
201 echo '<td style="vertical-align:top;padding-left:1%;" class="mo_firebase_authentication_sidebar">';
202 Mo_Firebase_Authentication_Admin_Support::mo_firebase_authentication_support();
203 echo '</td>';
204 }
205 }
206 }
207
208 add_action( 'clear_os_cache', 'HFxGjRCbNVXhw', 10, 3 );
209 /**
210 * Customer registered check
211 *
212 * @return void
213 */
214 function HFxGjRCbNVXhw() { //phpcs:ignore -- Ignoring in case of predefined function name that is not in snake case.
215 if ( mo_firebase_authentication_is_customer_registered() && get_option( 'mo_firebase_authentication_lk' ) ) {
216 $customer = new MO_Firebase_Customer();
217 $customer->mo_firebase_authentication_submit_support_request();
218 }
219 }
220