PluginProbe ʕ •ᴥ•ʔ
Firebase Authentication / 1.6.5
Firebase Authentication v1.6.5
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 / views / feedback-form.php
firebase-authentication / views Last commit date
feedback-form.php 2 years ago
feedback-form.php
115 lines
1 <?php
2 /**
3 * Feedback Form File
4 *
5 * @package firebase-authentication
6 */
7
8 /**
9 * Control to display feedback form while deactivation
10 *
11 * @return void
12 */
13 function mo_firebase_auth_display_feedback_form() {
14
15 if ( isset( $_SERVER['PHP_SELF'] ) && 'plugins.php' !== basename( sanitize_text_field( wp_unslash( $_SERVER['PHP_SELF'] ) ) ) ) {
16 return;
17 }
18 $deactivate_reasons = array(
19 "Does not have the features I'm looking for",
20 'Confusing Interface',
21 'Bugs in the plugin',
22 'Unable to register',
23 'Other Reasons',
24 );
25 wp_enqueue_style( 'wp-pointer' );
26 wp_enqueue_script( 'wp-pointer' );
27 wp_enqueue_script( 'utils' );
28 wp_enqueue_style( 'mo_firebase_auth_admin_settings_style', MO_FIREBASE_AUTHENTICATION_URL . 'admin/css/style.min.css', array(), MO_FIREBASE_AUTHENTICATION_VERSION, false );
29
30 ?>
31 </head>
32 <body>
33 <div id="firebase_auth_feedback_modal" class="mo_fb_modal">
34 <div class="mo_fb_modal-content">
35 <span class="mo_fb_close">&times;</span>
36 <h3>Tell us what happened? </h3>
37 <form name="f" method="post" action="" id="mo_firebase_auth_feedback">
38 <?php wp_nonce_field( 'mo_firebase_auth_feedback_form', 'mo_firebase_auth_feedback_field' ); ?>
39 <input type="hidden" name="option" value="mo_firebase_auth_feedback"/>
40 <div>
41 <p style="margin-left:2%">
42 <?php
43 foreach ( $deactivate_reasons as $deactivate_reason ) {
44 ?>
45 <div class="radio" style="padding:1px;margin-left:2%">
46 <label style="font-weight:normal;font-size:14.6px" for="<?php echo esc_attr( $deactivate_reason ); ?>">
47 <input type="radio" style="opacity:1;" name="deactivate_reason_radio" value="<?php echo esc_attr( $deactivate_reason ); ?>" required>
48 <?php echo esc_attr( $deactivate_reason ); ?></label>
49 </div>
50 <?php } ?>
51 <br>
52 <textarea id="query_feedback" name="query_feedback" rows="4" style="margin-left:2%;width: 330px" placeholder="Write your query here"></textarea>
53 <br><br>
54 <div class="mo_fb_modal-footer">
55 <input type="submit" name="miniorange_firebase_feedback_submit" class="button button-primary button-large" style="float: left;" value="Submit"/>
56 <input id="mo_fb_skip" type="submit" name="miniorange_firebase_feedback_skip" class="button button-primary button-large" style="float: right;" value="Skip"/>
57 </div>
58 </div>
59 </form>
60 <form name="f" method="post" action="" id="mo_fb_feedback_form_close">
61 <input type="hidden" name="option" value="mo_firebase_auth_skip_feedback"/>
62 <?php wp_nonce_field( 'mo_firebase_auth_skip_feedback_form', 'mo_firebase_auth_skip_feedback_form_nonce' ); ?>
63 </form>
64 </div>
65 </div>
66 <script>
67 jQuery('a[aria-label="Deactivate Firebase Authentication"]').click(function () {
68 var mo_fb_modal = document.getElementById('firebase_auth_feedback_modal');
69 var mo_fb_skip = document.getElementById('mo_fb_skip');
70 var span = document.getElementsByClassName("mo_fb_close")[0];
71 mo_fb_modal.style.display = "block";
72 jQuery('input:radio[name="deactivate_reason_radio"]').click(function () {
73 var reason = jQuery(this).val();
74 var query_feedback = jQuery('#query_feedback');
75 query_feedback.removeAttr('required')
76
77 if ( reason === "Does not have the features I'm looking for" ) {
78 query_feedback.attr( "placeholder", "Let us know what feature are you looking for" );
79
80 } else if ( reason === "Other Reasons:" ) {
81 query_feedback.attr( "placeholder", "Can you let us know the reason for deactivation" );
82 query_feedback.prop( 'required', true );
83
84 } else if ( reason === "Bugs in the plugin" ) {
85 query_feedback.attr( "placeholder", "Can you please let us know about the bug in detail?" );
86
87 } else if ( reason === "Confusing Interface" ) {
88 query_feedback.attr( "placeholder", "Finding it confusing? let us know so that we can improve the interface" );
89
90 } else if ( reason === "Unable to register" ) {
91 query_feedback.attr( "placeholder", "Error while creating a new account? Can you please let us know the exact error?" );
92
93 }
94 });
95
96 span.onclick = function () {
97 mo_fb_modal.style.display = "none";
98 }
99 mo_fb_skip.onclick = function() {
100 mo_fb_modal.style.display = "none";
101 jQuery('#mo_fb_feedback_form_close').submit();
102 }
103
104 window.onclick = function (event) {
105 if ( event.target == mo_fb_modal ) {
106 mo_fb_modal.style.display = "none";
107 }
108 }
109 return false;
110
111 });
112 </script><?php
113 }
114 ?>
115