PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 2.33
Strong Testimonials v2.33
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / admin / settings / partials / form.php
strong-testimonials / admin / settings / partials Last commit date
email-from.php 8 years ago email-to.php 8 years ago email.php 8 years ago form.php 7 years ago general.php 7 years ago licenses.php 8 years ago recipient.php 8 years ago
form.php
392 lines
1 <?php
2 /**
3 * Form Settings
4 *
5 * @since 1.13
6 */
7 $pages_list = wpmtst_get_pages();
8 $form_options = get_option( 'wpmtst_form_options' );
9 $plugins = apply_filters( 'wpmtst_captcha_plugins', get_option( 'wpmtst_captcha_plugins', array() ) );
10
11 /**
12 * If integration with selected Captcha plugin has been removed, disable Captcha.
13 */
14 if ( ! is_array( $plugins ) || ! in_array( $form_options['captcha'], array_keys( $plugins ) ) ) {
15 $form_options['captcha'] = '';
16 update_option( 'wpmtst_form_options', $form_options );
17 }
18
19 foreach ( $plugins as $key => $plugin ) {
20
21 if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin['file'] ) ) {
22 $plugins[ $key ]['installed'] = true;
23 }
24
25 $plugins[ $key ]['active'] = is_plugin_active( $plugin['file'] );
26
27 /**
28 * If current Captcha plugin has been deactivated, disable Captcha
29 * so corresponding div does not appear on front-end form.
30 */
31 if ( $key == $form_options['captcha'] && ! $plugins[ $key ]['active'] ) {
32 $form_options['captcha'] = '';
33 update_option( 'wpmtst_form_options', $form_options );
34 }
35
36 }
37 ?>
38 <input type="hidden"
39 name="wpmtst_form_options[default_recipient]"
40 value="<?php echo htmlentities( serialize( $form_options['default_recipient'] ) ); ?>">
41
42 <?php
43 /**
44 * ========================================
45 * Labels & Messages
46 * ========================================
47 */
48 ?>
49 <h2><?php _e( 'Form Labels & Messages', 'strong-testimonials' ); ?></h2>
50
51 <?php do_action( 'wpmtst_before_form_settings', 'form-messages' ); ?>
52
53 <table class="form-table compact" cellpadding="0" cellspacing="0">
54 <?php
55 $messages = $form_options['messages'];
56 foreach ( $messages as $key => $message ):
57 $required = isset( $message['required'] ) ? $message['required'] : true;
58
59 $elid = str_replace( '-', '_', $key );
60 // $string, $context, $name
61 $content = apply_filters( 'wpmtst_l10n', $message['text'], 'strong-testimonials-form-messages', $message['description'] );
62 ?>
63
64 <tr>
65 <th scope="row">
66 <label for="<?php echo $elid; ?>">
67 <?php _ex( $message['description'], 'description', 'strong-testimonials' ); ?>
68 </label>
69 <input type="hidden" name="wpmtst_form_options[messages][<?php echo $key; ?>][description]"
70 value="<?php esc_attr_e( $message['description'] ); ?>"/>
71 </th>
72 <td>
73 <?php if ( 'submission_success' == $elid ): ?>
74 <?php
75 $settings = array(
76 'textarea_name' => "wpmtst_form_options[messages][$key][text]",
77 'textarea_rows' => 10,
78 );
79 wp_editor( $content, $elid, $settings );
80 ?>
81 <?php else: ?>
82 <?php if ( 'required_field' == $elid ): ?>
83 <fieldset>
84 <label>
85 <input type="checkbox"
86 name="wpmtst_form_options[messages][<?php echo $key; ?>][enabled]"
87 <?php checked( $message['enabled'] ); ?>">
88 <?php _e( 'Display required notice at top of form', 'strong-testimonials' ); ?>
89 </label
90 </fieldset>
91 <?php endif; ?>
92 <input type="text" id="<?php echo $elid; ?>"
93 name="wpmtst_form_options[messages][<?php echo $key; ?>][text]"
94 value="<?php esc_attr_e( $content ); ?>"
95 <?php echo $required ? 'required' : '' ?>/>
96 <?php endif; ?>
97 </td>
98 <td class="actions">
99 <input type="button" class="button secondary restore-default-message"
100 value="<?php _ex( 'restore default', 'singular', 'strong-testimonials' ); ?>"
101 data-target-id="<?php esc_attr_e( $elid ); ?>"/>
102 </td>
103 </tr>
104
105 <?php endforeach; ?>
106
107 <tr>
108 <td colspan="3">
109 <input type="button" id="restore-default-messages" class="button"
110 name="restore-default-messages"
111 value="<?php _e( 'Restore Default Messages', 'strong-testimonials' ); ?>"/>
112 </td>
113 </tr>
114 </table>
115
116 <table class="form-table" cellpadding="0" cellspacing="0">
117 <tr>
118 <th scope="row" class="tall">
119 <?php _e( 'Scroll', 'strong-testimonials' ); ?>
120 </th>
121 <td>
122 <fieldset>
123 <div>
124 <label>
125 <input type="checkbox"
126 name="wpmtst_form_options[scrolltop_error]" <?php checked( $form_options['scrolltop_error'] ); ?>/>
127 <?php printf( __( 'If errors, scroll to the first error minus %s pixels. On by default.', 'strong-testimonials' ), '<input type="text" name="wpmtst_form_options[scrolltop_error_offset]" value="' . $form_options['scrolltop_error_offset'] . '" size="3">' ); ?>
128 </label>
129 </div>
130 <div>
131 <label class="block">
132 <input type="checkbox"
133 name="wpmtst_form_options[scrolltop_success]" <?php checked( $form_options['scrolltop_success'] ); ?>/>
134 <?php printf( __( 'If success, scroll to the success message minus %s pixels. On by default.', 'strong-testimonials' ), '<input type="text" name="wpmtst_form_options[scrolltop_success_offset]" value="' . $form_options['scrolltop_success_offset'] . '" size="3">' ); ?>
135 </label>
136 </div>
137 </fieldset>
138 </td>
139 </tr>
140 </table>
141
142 <?php
143 /**
144 * ========================================
145 * Actions
146 * ========================================
147 */
148 ?>
149 <hr>
150 <h3><?php _e( 'Form Actions', 'strong-testimonials' ); ?></h3>
151
152 <table class="form-table" cellpadding="0" cellspacing="0">
153 <tr>
154 <th scope="row">
155 <label for="redirect-page">
156 <?php _e( 'Upon Successful Submission', 'strong-testimonials' ); ?>
157 </label>
158 </th>
159 <td>
160 <div>
161 <label class="success-action">
162 <input type="radio"
163 name="wpmtst_form_options[success_action]"
164 value="message" <?php checked( 'message', $form_options['success_action'] ); ?>/> <?php _e( 'display message', 'strong-testimonials' ); ?>
165 </label>
166 </div>
167
168 <div>
169 <label class="success-action">
170 <input type="radio"
171 name="wpmtst_form_options[success_action]"
172 value="id" <?php checked( 'id', $form_options['success_action'] ); ?>/> <?php _e( 'redirect to a page', 'strong-testimonials' ); ?>
173 </label>
174
175 <select id="redirect-page" name="wpmtst_form_options[success_redirect_id]">
176
177 <option value=""><?php _e( '&mdash; select a page &mdash;' ); ?></option>
178
179 <?php foreach ( $pages_list as $pages ) : ?>
180
181 <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $form_options['success_redirect_id'] ) ? $form_options['success_redirect_id'] : 0, $pages->ID ); ?>>
182 <?php echo $pages->post_title; ?>
183 </option>
184
185 <?php endforeach; ?>
186
187 </select>
188
189 <div style="display: inline-block; text-indent: 20px;">
190 <label>
191 <?php _ex( 'or enter its ID or slug', 'to select a redirect page', 'strong-testimonials' ); ?>
192 &nbsp;
193 <input type="text"
194 id="redirect-page-2"
195 name="wpmtst_form_options[success_redirect_2]"
196 size="30">
197 </label>
198 </div>
199 </div>
200
201 <div>
202 <label class="success-action">
203 <input type="radio"
204 name="wpmtst_form_options[success_action]"
205 value="url" <?php checked( 'url', $form_options['success_action'] ); ?>/> <?php _e( 'redirect to a URL', 'strong-testimonials' ); ?>
206 </label>
207 <label>
208 <input type="text" id="redirect-page-3"
209 name="wpmtst_form_options[success_redirect_url]"
210 value="<?php echo $form_options['success_redirect_url']; ?>" size="75"/>
211 </label>
212 </div>
213
214 </td>
215 </tr>
216
217 <tr>
218 <th scope="row">
219 <label>
220 <?php _e( 'Post Status', 'strong-testimonials' ); ?>
221 </label>
222 </th>
223 <td>
224 <ul class="compact">
225 <li>
226 <label>
227 <input type="radio" name="wpmtst_form_options[post_status]" value="pending"
228 <?php checked( 'pending', $form_options['post_status'] ); ?>/>
229 <?php _e( 'Pending', 'strong-testimonials' ); ?>
230 </label>
231 </li>
232 <li>
233 <label>
234 <input type="radio" name="wpmtst_form_options[post_status]" value="publish"
235 <?php checked( 'publish', $form_options['post_status'] ); ?>/>
236 <?php _e( 'Published' ); ?>
237 </label>
238 </li>
239 </ul>
240 </td>
241 </tr>
242
243 <tr>
244 <th scope="row">
245 <label for="wpmtst-options-admin-notify">
246 <?php _e( 'Notification Email', 'strong-testimonials' ); ?>
247 </label>
248 </th>
249
250 <td>
251 <div class="match-height">
252 <fieldset>
253 <label for="wpmtst-options-admin-notify">
254 <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]"
255 <?php checked( $form_options['admin_notify'] ); ?>/>
256 <?php _e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
257 </label>
258 </fieldset>
259 </div>
260 <div class="email-container"
261 id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
262 <?php
263 include 'email-from.php';
264 include 'email-to.php';
265 include 'email.php';
266 do_action( 'wpmtst_after_notification_fields', 'notification' );
267 ?>
268 </div>
269 </td>
270 </tr>
271 </table>
272
273 <?php
274 /**
275 * ========================================
276 * Spam Control
277 * ========================================
278 */
279 ?>
280 <hr>
281 <h3><?php _e( 'Form Spam Control', 'strong-testimonials' ); ?></h3>
282
283 <table class="form-table" cellpadding="0" cellspacing="0">
284 <tr>
285 <th scope="row">
286 <label>
287 <?php _ex( 'Honeypot', 'spam control techniques', 'strong-testimonials' ); ?>
288 </label>
289 </th>
290 <td>
291 <p>
292 <?php _e( 'These methods for trapping spambots are both time-tested and widely used. May be used simultaneously for more protection.', 'strong-testimonials' ); ?>
293 </p>
294 <p>
295 <?php _e( 'However, honeypots may not be compatible with WP-SpamShield, Ajax page loading, caching or minification.', 'strong-testimonials' ); ?>
296 </p>
297 <p>
298 <?php _e( 'If your form is not working properly, try disabling these.', 'strong-testimonials' ); ?>
299 </p>
300 <?php // TODO Add link to article that explains Ajax page loading. ?>
301 <ul>
302 <li class="checkbox">
303 <label>
304 <input type="checkbox"
305 name="wpmtst_form_options[honeypot_before]" <?php checked( $form_options['honeypot_before'] ); ?>/>
306 <?php _e( 'Before', 'strong-testimonials' ); ?>
307 </label>
308 <p class="description"><?php _e( 'Adds a new empty field that is invisible to humans. Spambots tend to fill in every field they find in the form. Empty field = human. Not empty = spambot.', 'strong-testimonials' ); ?></p>
309 </li>
310 <li class="checkbox">
311 <label>
312 <input type="checkbox"
313 name="wpmtst_form_options[honeypot_after]" <?php checked( $form_options['honeypot_after'] ); ?>/>
314 <?php _e( 'After', 'strong-testimonials' ); ?>
315 </label>
316 <p class="description"><?php _e( 'Adds a new field as soon as the form is submitted. Spambots cannot run JavaScript so the new field never gets added. New field = human. Missing = spambot.', 'strong-testimonials' ); ?></p>
317 </li>
318 </ul>
319 </td>
320 </tr>
321 <tr valign="top">
322 <th scope="row">
323 <label>
324 <a name="captcha-section"></a><?php _e( 'Captcha', 'strong-testimonials' ); ?>
325 </label>
326 </th>
327 <td class="stackem">
328 <p>
329 <?php _e( 'Enable Captcha using one of these plugins. Be sure to configure any plugins first, if necessary.', 'strong-testimonials' ); ?>
330 <?php _e( 'May be used alongside honeypot methods.', 'strong-testimonials' ); ?>
331 </p>
332 <p>
333 <?php _e( 'May not be compatible with Ajax page loading.', 'strong-testimonials' ); ?>
334 </p>
335 <ul>
336 <li>
337 <label>
338 <input type="radio"
339 name="wpmtst_form_options[captcha]" <?php checked( '', $form_options['captcha'] ); ?>
340 value=""/> none
341 </label>
342 </li>
343
344 <?php foreach ( $plugins as $key => $plugin ) : ?>
345 <li>
346 <label class="inline <?php if ( ! $plugin['active'] ) echo 'disabled'; ?>">
347 <input type="radio"
348 name="wpmtst_form_options[captcha]" <?php disabled( ! $plugin['active'] ); ?><?php checked( $key, $form_options['captcha'] ); ?>
349 value="<?php echo $key; ?>"/>
350 <?php echo $plugin['name']; ?>
351 </label>
352
353 <?php if ( isset( $plugin['installed'] ) && $plugin['installed'] ) : // installed ?>
354
355 <?php if ( $plugin['active'] ) : // active ?>
356
357 <?php if ( isset( $plugin['settings'] ) && $plugin['settings'] ) : ?>
358 <span class="link"><a href="<?php echo $plugin['settings']; ?>"><?php _ex( 'settings', 'link', 'strong-testimonials' ); ?></a></span>
359 <?php else : ?>
360 <span class="notice"><?php _e( 'no settings', 'strong-testimonials' ); ?></span>
361 <?php endif; ?>
362
363 <?php else : // inactive ?>
364
365 <span class="notice disabled"><?php _ex( 'inactive', 'adjective', 'strong-testimonials' ); ?></span>
366
367 <?php endif; ?>
368 |
369
370 <?php else : // not installed ?>
371
372 <span class="notice disabled">(<?php _e( 'not installed', 'strong-testimonials' ); ?>)</span>
373
374 <?php if ( isset( $plugin['search'] ) && $plugin['search'] ) : ?>
375 <span class="link"><a href="<?php echo $plugin['search']; ?>"><?php _ex( 'install plugin', 'link', 'strong-testimonials' ); ?></a></span>
376 |
377 <?php endif; ?>
378
379 <?php endif; // whether installed ?>
380
381 <span class="link"><a href="<?php echo $plugin['url']; ?>" target="_blank"><?php _ex( 'plugin page', 'link', 'strong-testimonials' ); ?></a></span>
382
383 <?php if ( isset( $plugin['desc'] ) && $plugin['desc'] ) : ?>
384 <p class="description <?php if ( isset( $plugin['style'] ) ) echo $plugin['style']; ?>"><?php echo $plugin['desc']; ?></p>
385 <?php endif; ?>
386 </li>
387 <?php endforeach; ?>
388 </ul>
389 </td>
390 </tr>
391 </table>
392