PluginProbe
Button Generator – Easily Create Custom Buttons with Icons and Analytics / 2.3.2
Button Generator – Easily Create Custom Buttons with Icons and Analytics v2.3.2
trunk 1.1.1 2.0 2.1 2.2 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.2 3.2.1 3.2.2 3.2.3 All 28 releases
button-generation / admin / partials / support.php

support.php in Button Generator – Easily Create Custom Buttons with Icons and Analytics 2.3.2, at admin/partials/support.php

170 lines 6.0 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 Wow-Company <support@wow-company.com>
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['version'], '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 form below
28 or write to us on email <a href="mailto:support@wow-company.com">support@wow-company.com</a>.</p>
29
30 <p>Also, you can send us your ideas and suggestions for improving the plugin.</p>
31 <?php $error = array();
32 if ( ! empty( $_POST['action'] ) && ! empty( $_POST['wow_support_field'] ) ) {
33 if ( wp_verify_nonce( $_POST['wow_support_field'], 'wow_support_action' ) &&
34 current_user_can( 'manage_options' ) ) {
35
36 $fname = ! empty( $_POST['wow-fname'] ) ? sanitize_text_field( $_POST['wow-fname'] ) : '';
37 $lname = ! empty( $_POST['wow-lname'] ) ? sanitize_text_field( $_POST['wow-lname'] ) : '';
38 $message = ! empty( $_POST['wow-message'] ) ? sanitize_text_field( $_POST['wow-message'] ) : '';
39 $email = ! empty( $_POST['wow-email'] ) ? sanitize_email( $_POST['wow-email'] ) : '';
40 $type =
41 ! empty( $_POST['wow-message-type'] ) ? sanitize_text_field( $_POST['wow-message-type'] ) : '';
42
43 if ( empty( $fname ) ) {
44 $error[] = esc_attr__( 'Please, Enter your First Name.', $this->plugin['text'] );
45 }
46 if ( empty( $lname ) ) {
47 $error[] = esc_attr__( 'Please, Enter your Last Name.', $this->plugin['text'] );
48 }
49 if ( empty( $message ) ) {
50 $error[] = esc_attr__( 'Please, Enter your Message.', $this->plugin['text'] );
51 }
52 if ( empty( $email ) ) {
53 $error[] = esc_attr__( 'Please, Enter your Email.', $this->plugin['text'] );
54 }
55 if ( count( $error ) == 0 ) {
56
57
58 $headers = array(
59 'From: ' . $fname . ' ' . $lname . ' <' . $email . '>',
60 'content-type: text/html',
61 );
62 $message = '
63 <html>
64 <head></head>
65 <body>
66 <table>
67 <tr>
68 <td width="30%"><strong>License Key:</strong></td>
69 <td>' . $license . '</td>
70 </tr>
71 <tr>
72 <td><strong>Plugin:</strong></td>
73 <td>' . $plugin . '</td>
74 </tr>
75 <tr>
76 <td><strong>Website:</strong></td>
77 <td>' . $website . '</td>
78 </tr>
79 </table>
80 ' . $message . '
81 </body>
82 </html>';
83 wp_mail( 'support@wow-company.com', 'Support Ticket: ' . $type, $message, $headers );
84 echo '<div class="wow-alert wow-alert-update "><p class="wow_error">' .
85 esc_attr__( 'Your Message sent to the Support.', $this->plugin['text'] ) . '</p></div>';
86
87 }
88
89
90 } else {
91 echo '<div class="wow-alert wow-alert-error "><p class="wow_error">' .
92 esc_attr__( 'Sorry, but message did not send. Please, contact us support@wow-company.com',
93 $this->plugin['text'] ) . ' </p></div>';
94 }
95 }
96 ?>
97 <?php if ( count( $error ) > 0 ) {
98 echo '<div class="wow-alert wow-alert-error "><p class="wow_error">' . implode( "<br />", $error ) .
99 '</p></div>';
100 } ?>
101
102
103 <form method="post" action="" class="wow-plugin">
104 <div class="container">
105 <div class="element">
106 <label><?php esc_html_e( 'First Name', $this->plugin['text'] ); ?></label><br/>
107 <input type="text" name="wow-fname" value=""
108 placeholder="<?php esc_html_e( 'Enter Your First Name', $this->plugin['text'] ); ?>">
109 </div>
110 <div class="element">
111 <label><?php esc_html_e( 'Last Name', $this->plugin['text'] ); ?></label><br/>
112 <input type="text" name="wow-lname" value=""
113 placeholder="<?php esc_html_e( 'Enter Your Last Name', $this->plugin['text'] ); ?>">
114 </div>
115 </div>
116 <div class="container">
117 <div class="element">
118 <label><?php esc_html_e( 'WebSite', $this->plugin['text'] ); ?></label><br/>
119 <input type="text" disabled name="wow-website" value="<?php echo get_option( 'home' ); ?>">
120 </div>
121 <div class="element">
122 <label><?php esc_html_e( 'Contact email', $this->plugin['text'] ); ?></label><br/>
123 <input type="text" name="wow-email" value="<?php echo get_option( 'admin_email' ); ?>">
124 </div>
125
126 </div>
127
128 <div class="container">
129 <div class="element">
130 <label><?php esc_html_e( 'License Key', $this->plugin['text'] ); ?></label><br/>
131 <input type="text" disabled name="wow-license-key" value="<?php if ( ! empty( $license ) ) {
132 echo $license;
133 }; ?>">
134 </div>
135 <div class="element">
136 <label><?php esc_html_e( 'Plugin', $this->plugin['text'] ); ?></label><br/>
137 <input type="text" disabled name="wow-plugin" value="<?php if ( ! empty( $name ) ) {
138 echo $plugin;
139 }; ?>">
140 </div>
141 </div>
142 <div class="container">
143 <div class="element">
144 <label><?php esc_html_e( 'Message type', $this->plugin['text'] ); ?></label><br/>
145 <select name="wow-message-type">
146 <option value="Issue"><?php esc_html_e( 'Issue', $this->plugin['text'] ); ?></option>
147 <option value="Idea"><?php esc_html_e( 'Idea', $this->plugin['text'] ); ?></option>
148 </select>
149 </div>
150 </div>
151 <div class="container">
152 <div class="element">
153 <textarea name="wow-message" rows="10"
154 placeholder="<?php esc_html_e( 'Enter Your Message', $this->plugin['text'] ); ?>"></textarea>
155 </div>
156 </div>
157 <div class="container">
158 <div class="element">
159 <input type="submit" class="add-item" name="action"
160 value="<?php esc_html_e( 'Send to Support', $this->plugin['text'] ); ?>">
161 </div>
162 </div>
163 <?php wp_nonce_field( 'wow_support_action', 'wow_support_field' ); ?>
164 </form>
165 </div>
166
167 </div>
168 </div>
169 <?php
170