PluginProbe
User Submitted Posts – Enable Users to Submit Posts from the Front End / 20260916
User Submitted Posts – Enable Users to Submit Posts from the Front End v20260916
20260916 20260810 20260608 20230806 20230809 20230811 20230901 20230902 20230914 20231102 20240319 20240516 20240703 20241026 20250327 20250329 20251121 20251210 20260110 20260113 20260207 20260217 20260407 20260422 trunk All 59 releases
← All changes | library/plugin-settings.php +64 -15 2024070320260916 View file →
@@ -34,11 +34,11 @@
34 34
35 35 if ($file === USP_FILE) {
36 36
37 37 $pro_href = 'https://plugin-planet.com/usp-pro/';
38 - $pro_title = esc_attr__('Get USP Pro for unlimited forms!', 'usp');
39 - $pro_text = esc_html__('Go Pro', 'usp');
40 - $pro_style = 'font-weight:bold;';
38 + $pro_title = esc_attr__('Get USP Pro for unlimited forms', 'usp');
39 + $pro_text = esc_html__('Go Pro', 'usp');
40 + $pro_style = 'padding:2px 4px;font-weight:bold;border:1px solid #00CCCC;border-radius:2px;background-color:#fff;';
41 41
42 42 $pro = '<a target="_blank" rel="noopener noreferrer" href="'. $pro_href .'" title="'. $pro_title .'" style="'. $pro_style .'">'. $pro_text .'</a>';
43 43
44 44 array_unshift($links, $pro);
@@ -55,13 +55,13 @@
55 55 function add_usp_links($links, $file) {
56 56
57 57 if ($file === USP_FILE) {
58 58
59 - $home_href = 'https://perishablepress.com/user-submitted-posts/';
60 - $home_title = esc_attr__('Plugin Homepage', 'usp');
61 - $home_text = esc_html__('Homepage', 'usp');
59 + $home_href = 'https://plugin-planet.com/usp-pro/';
60 + $home_title = esc_attr__('Get USP Pro for unlimited forms', 'usp');
61 + $home_text = esc_html__('Go&nbsp;Pro', 'usp');
62 62
63 - $links[] = '<a target="_blank" rel="noopener noreferrer" href="'. $home_href .'" title="'. $home_title .'">'. $home_text .'</a>';
63 + $links[] = '<strong><a target="_blank" rel="noopener noreferrer" href="'. $home_href .'" title="'. $home_title .'">'. $home_text .'</a></strong>';
64 64
65 65 $rate_href = 'https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post';
66 66 $rate_title = esc_attr__('Give USP a 5-star rating at WordPress.org', 'usp');
67 67 $rate_text = esc_html__('Rate this plugin&nbsp;&raquo;', 'usp');
@@ -482,8 +482,38 @@
482 482 }
483 483
484 484
485 485
486 +function usp_form_field_options_turnstile() {
487 +
488 + global $usp_options;
489 +
490 + $name = 'usp_turnstile';
491 + $label = esc_html__('Cloudflare Turnstile', 'usp');
492 +
493 + $option = isset($usp_options[$name]) ? $usp_options[$name] : '';
494 +
495 + $selected_show = ($option === 'show') ? 'selected="selected"' : '';
496 + $selected_hide = ($option === 'hide') ? 'selected="selected"' : '';
497 +
498 + $output = '<tr>';
499 + $output .= '<th scope="row"><label class="description" for="usp_options['. esc_attr($name) .']">'. esc_html($label) .'</label></th>';
500 + $output .= '<td>';
501 + $output .= '<select name="usp_options['. esc_attr($name) .']" id="usp_options['. esc_attr($name) .']">';
502 +
503 + $output .= '<option '. $selected_show .' value="show">'. esc_html__('Enable and require', 'usp') .'</option>';
504 + $output .= '<option '. $selected_hide .' value="hide">'. esc_html__('Disable this field', 'usp') .'</option>';
505 +
506 + $output .= '</select>';
507 + $output .= '</td>';
508 + $output .= '</tr>';
509 +
510 + return $output;
511 +
512 +}
513 +
514 +
515 +
486 516 function usp_form_field_options_images() {
487 517
488 518 global $usp_options;
489 519
@@ -938,9 +968,12 @@
938 968 'custom_checkbox' => false,
939 969 'custom_checkbox_name' => 'usp_custom_checkbox',
940 970 'custom_checkbox_text' => 'I agree the to the terms.',
941 971 'custom_checkbox_err' => 'Custom checkbox required',
942 - 'custom_checkbox_req' => true
972 + 'custom_checkbox_req' => true,
973 + 'turnstile_site_key' => '',
974 + 'turnstile_secret_key' => '',
975 + 'usp_turnstile' => 'hide'
943 976 );
944 977
945 978 update_option('usp_options', $arr);
946 979
@@ -952,8 +985,9 @@
952 985
953 986 function usp_delete_plugin_options() {
954 987
955 988 delete_option('usp_options');
989 + delete_option('user-submitted-posts-dismiss-notice');
956 990
957 991 }
958 992
959 993
@@ -1040,8 +1074,11 @@
1040 1074 if (isset($input['email_alert_subject'])) $input['email_alert_subject'] = wp_filter_nohtml_kses($input['email_alert_subject']); else $input['email_alert_subject'] = null;
1041 1075 if (isset($input['recaptcha_public'])) $input['recaptcha_public'] = wp_filter_nohtml_kses($input['recaptcha_public']); else $input['recaptcha_public'] = null;
1042 1076 if (isset($input['recaptcha_private'])) $input['recaptcha_private'] = wp_filter_nohtml_kses($input['recaptcha_private']); else $input['recaptcha_private'] = null;
1043 1077 if (isset($input['usp_recaptcha'])) $input['usp_recaptcha'] = wp_filter_nohtml_kses($input['usp_recaptcha']); else $input['usp_recaptcha'] = null;
1078 + if (isset($input['usp_turnstile'])) $input['usp_turnstile'] = wp_filter_nohtml_kses($input['usp_turnstile']); else $input['usp_turnstile'] = null;
1079 + if (isset($input['turnstile_site_key'])) $input['turnstile_site_key'] = wp_filter_nohtml_kses($input['turnstile_site_key']); else $input['turnstile_site_key'] = null;
1080 + if (isset($input['turnstile_secret_key'])) $input['turnstile_secret_key'] = wp_filter_nohtml_kses($input['turnstile_secret_key']); else $input['turnstile_secret_key'] = null;
1044 1081 if (isset($input['custom_field'])) $input['custom_field'] = wp_filter_nohtml_kses($input['custom_field']); else $input['custom_field'] = null;
1045 1082 if (isset($input['custom_name'])) $input['custom_name'] = wp_filter_nohtml_kses($input['custom_name']); else $input['custom_name'] = null;
1046 1083 if (isset($input['custom_label'])) $input['custom_label'] = wp_filter_nohtml_kses($input['custom_label']); else $input['custom_label'] = null;
1047 1084 if (isset($input['custom_field_2'])) $input['custom_field_2'] = wp_filter_nohtml_kses($input['custom_field_2']); else $input['custom_field_2'] = null;
@@ -1132,10 +1169,20 @@
1132 1169 if (isset($input['auto_email_markup'])) $input['auto_email_markup'] = wp_kses_post($input['auto_email_markup'], $allowedposttags); else $input['auto_email_markup'] = null;
1133 1170 if (isset($input['auto_url_markup'])) $input['auto_url_markup'] = wp_kses_post($input['auto_url_markup'], $allowedposttags); else $input['auto_url_markup'] = null;
1134 1171 if (isset($input['auto_custom_markup'])) $input['auto_custom_markup'] = wp_kses_post($input['auto_custom_markup'], $allowedposttags); else $input['auto_custom_markup'] = null;
1135 1172 if (isset($input['auto_custom_markup_2'])) $input['auto_custom_markup_2'] = wp_kses_post($input['auto_custom_markup_2'], $allowedposttags); else $input['auto_custom_markup_2'] = null;
1136 - if (isset($input['custom_checkbox_text'])) $input['custom_checkbox_text'] = wp_kses_post($input['custom_checkbox_text'], $allowedposttags); else $input['custom_checkbox_text'] = null;
1137 1173
1174 + if (isset($input['custom_checkbox_text'])) {
1175 +
1176 + $input['custom_checkbox_text'] = wp_kses_post($input['custom_checkbox_text'], $allowedposttags);
1177 + $input['custom_checkbox_text'] = str_replace('script', '', $input['custom_checkbox_text']);
1178 +
1179 + } else {
1180 +
1181 + $input['custom_checkbox_text'] = null;
1182 +
1183 + }
1184 +
1138 1185 $allowedposttags = $default_allowedposttags;
1139 1186
1140 1187 if (!isset($input['usp_casing'])) $input['usp_casing'] = null;
1141 1188 $input['usp_casing'] = ($input['usp_casing'] == 1 ? 1 : 0);
@@ -1210,14 +1257,16 @@
1210 1257 if (!usp_check_date_expired() && !usp_dismiss_notice_check()) {
1211 1258
1212 1259 ?>
1213 1260
1214 - <div class="notice notice-success notice-custom">
1261 + <div class="notice notice-success notice-lh">
1215 1262 <p>
1216 - <strong><?php esc_html_e('Pro Plugin Sale!', 'usp'); ?></strong>
1217 - <?php esc_html_e('Buy one get one FREE with code', 'usp'); ?> <code>BOGO24</code>,
1218 - <?php esc_html_e('or take 30% off with code', 'usp'); ?> <code>SUPER24</code>
1219 - ⭐ <a class="notice-link" target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/super-summer-sale/"><?php esc_html_e('Get&nbsp;plugins&nbsp;&raquo;', 'usp'); ?></a>
1263 + <strong><?php esc_html_e('☀️ Summer Sale!', 'usp'); ?></strong>
1264 + <?php esc_html_e('Take 35% OFF any of our', 'usp'); ?>
1265 + <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/"><?php esc_html_e('Pro WordPress plugins', 'usp'); ?></a>
1266 + <?php esc_html_e('and', 'usp'); ?>
1267 + <a target="_blank" rel="noopener noreferrer" href="https://books.perishablepress.com/"><?php esc_html_e('books', 'usp'); ?></a>.
1268 + <?php esc_html_e('Apply code', 'usp'); ?> <code>SUMMER</code> <?php esc_html_e('at checkout. Sale ends 9/20/2026.', 'usp'); ?>
1220 1269 <?php echo usp_dismiss_notice_link(); ?>
1221 1270 </p>
1222 1271 </div>
1223 1272
@@ -1295,9 +1344,9 @@
1295 1344 }
1296 1345
1297 1346 function usp_check_date_expired() {
1298 1347
1299 - $expires = apply_filters('usp_check_date_expired', '2024-09-22');
1348 + $expires = apply_filters('usp_check_date_expired', '2026-09-20');
1300 1349
1301 1350 return (new DateTime() > new DateTime($expires)) ? true : false;
1302 1351
1303 1352 }