PluginProbe
Float menu – awesome floating side menu / 3.5.2
Float menu – awesome floating side menu v3.5.2
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
float-menu / admin / partials / support.php

support.php in Float menu – awesome floating side menu 3.5.2, at admin/partials/support.php

174 lines 7.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Support Page
4 *
5 * @package Wow_Plugin
6 * @subpackage Admin/Support
7 * @author Dmytro Lobov <d@dayes.dev>
8 * @copyright 2019 Wow-Company
9 * @license GNU Public License
10 * @version 1.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 $plugin = $this->plugin['name'] . ' v.' . $this->plugin['version'];
18 $website = get_option( 'home' );
19 $license = get_option( 'wow_license_key_' . $this->plugin['prefix'], 'no' );
20
21 ?>
22
23 <div class="about-wrap wow-support">
24 <div class="feature-section one-col">
25 <div class="col">
26
27 <p>To get your support related question answered in the fastest timing, please send a message via the
28 form below
29 or write to us on email <a href="mailto:support@wow-company.com">support@wow-company.com</a>.</p>
30
31 <p>Also, you can send us your ideas and suggestions for improving the plugin.</p>
32 <?php $error = array();
33 if ( ! empty( $_POST['action'] ) && ! empty( $_POST['wow_support_field'] ) ) {
34 if ( wp_verify_nonce( $_POST['wow_support_field'], 'wow_support_action' )
35 && current_user_can( 'manage_options' )
36 ) {
37
38 $fname = ! empty( $_POST['wow-fname'] ) ? sanitize_text_field( $_POST['wow-fname'] ) : '';
39 $lname = ! empty( $_POST['wow-lname'] ) ? sanitize_text_field( $_POST['wow-lname'] ) : '';
40 $message = ! empty( $_POST['wow-message'] ) ? sanitize_textarea_field( $_POST['wow-message'] ) : '';
41 $email = ! empty( $_POST['wow-email'] ) ? sanitize_email( $_POST['wow-email'] ) : '';
42 $type
43 = ! empty( $_POST['wow-message-type'] ) ? sanitize_text_field( $_POST['wow-message-type'] )
44 : '';
45
46 if ( empty( $fname ) ) {
47 $error[] = esc_attr__( 'Please, Enter your First Name.', $this->plugin['text'] );
48 }
49 if ( empty( $lname ) ) {
50 $error[] = esc_attr__( 'Please, Enter your Last Name.', $this->plugin['text'] );
51 }
52 if ( empty( $message ) ) {
53 $error[] = esc_attr__( 'Please, Enter your Message.', $this->plugin['text'] );
54 }
55 if ( empty( $email ) ) {
56 $error[] = esc_attr__( 'Please, Enter your Email.', $this->plugin['text'] );
57 }
58 if ( count( $error ) == 0 ) {
59
60
61 $headers = array(
62 'From: ' . $fname . ' ' . $lname . ' <' . $email . '>',
63 'content-type: text/html',
64 );
65 $message = '
66 <html>
67 <head></head>
68 <body>
69 <table>
70 <tr>
71 <td width="30%"><strong>License Key:</strong></td>
72 <td>' . esc_html( $license ) . '</td>
73 </tr>
74 <tr>
75 <td><strong>Plugin:</strong></td>
76 <td>' . esc_html( $plugin ) . '</td>
77 </tr>
78 <tr>
79 <td><strong>Website:</strong></td>
80 <td>' . esc_url( $website ) . '</td>
81 </tr>
82 </table>
83 ' . sanitize_textarea_field( $message ) . '
84 </body>
85 </html>';
86 wp_mail( 'support@wow-company.com', 'Support Ticket: ' . $type, $message, $headers );
87 echo '<div class="wow-alert wow-alert-update "><p class="wow_error">'
88 . esc_attr__( 'Your Message sent to the Support.', $this->plugin['text'] ) . '</p></div>';
89
90 }
91
92
93 } else {
94 echo '<div class="wow-alert wow-alert-error "><p class="wow_error">'
95 . esc_attr__( 'Sorry, but message did not send. Please, contact us support@wow-company.com',
96 $this->plugin['text'] ) . ' </p></div>';
97 }
98 }
99 ?>
100 <?php if ( count( $error ) > 0 ) {
101 echo '<div class="wow-alert wow-alert-error "><p class="wow_error">' . wp_kses( implode( "<br />", $error ) ) . '</p></div>';
102 } ?>
103
104
105 <form method="post" action="" class="wow-plugin">
106 <div class="container">
107 <div class="element">
108 <label><?php esc_html_e( 'First Name', $this->plugin['text'] ); ?></label><br/>
109 <input type="text" name="wow-fname" value=""
110 placeholder="<?php esc_attr_e( 'Enter Your First Name', $this->plugin['text'] ); ?>">
111 </div>
112 <div class="element">
113 <label><?php esc_html_e( 'Last Name', $this->plugin['text'] ); ?></label><br/>
114 <input type="text" name="wow-lname" value=""
115 placeholder="<?php esc_attr_e( 'Enter Your Last Name', $this->plugin['text'] ); ?>">
116 </div>
117 </div>
118 <div class="container">
119 <div class="element">
120 <label><?php esc_html_e( 'WebSite', $this->plugin['text'] ); ?></label><br/>
121 <input type="text" disabled name="wow-website"
122 value="<?php echo esc_url( get_option( 'home' ) ); ?>">
123 </div>
124 <div class="element">
125 <label><?php esc_html_e( 'Contact email', $this->plugin['text'] ); ?></label><br/>
126 <input type="text" name="wow-email"
127 value="<?php echo sanitize_email( get_option( 'admin_email' ) ); ?>">
128 </div>
129
130 </div>
131
132 <div class="container">
133 <div class="element">
134 <label><?php esc_html_e( 'License Key', $this->plugin['text'] ); ?></label><br/>
135 <input type="text" disabled name="wow-license-key" value="<?php if ( ! empty( $license ) ) {
136 echo esc_attr( $license );
137 }; ?>">
138 </div>
139 <div class="element">
140 <label><?php esc_html_e( 'Plugin', $this->plugin['text'] ); ?></label><br/>
141 <input type="text" disabled name="wow-plugin" value="<?php if ( ! empty( $name ) ) {
142 echo esc_attr( $plugin );
143 }; ?>">
144 </div>
145 </div>
146 <div class="container">
147 <div class="element">
148 <label><?php esc_html_e( 'Message type', $this->plugin['text'] ); ?></label><br/>
149 <select name="wow-message-type">
150 <option value="Issue"><?php esc_attr_e( 'Issue', $this->plugin['text'] ); ?></option>
151 <option value="Idea"><?php esc_attr_e( 'Idea', $this->plugin['text'] ); ?></option>
152 </select>
153 </div>
154 </div>
155 <div class="container">
156 <div class="element">
157 <textarea name="wow-message" rows="10"
158 placeholder="<?php esc_attr_e( 'Enter Your Message', $this->plugin['text'] ); ?>"></textarea>
159 </div>
160 </div>
161 <div class="container">
162 <div class="element">
163 <input type="submit" class="add-item" name="action"
164 value="<?php esc_attr_e( 'Send to Support', $this->plugin['text'] ); ?>">
165 </div>
166 </div>
167 <?php wp_nonce_field( 'wow_support_action', 'wow_support_field' ); ?>
168 </form>
169 </div>
170
171 </div>
172 </div>
173 <?php
174