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 +65 -17 2024031920260916 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;
@@ -1090,10 +1127,8 @@
1090 1127 $allowedposttags['form'] = $allowed_atts;
1091 1128 $allowedposttags['label'] = $allowed_atts;
1092 1129 $allowedposttags['input'] = $allowed_atts;
1093 1130 $allowedposttags['textarea'] = $allowed_atts;
1094 - $allowedposttags['iframe'] = $allowed_atts;
1095 - $allowedposttags['script'] = $allowed_atts;
1096 1131 $allowedposttags['style'] = $allowed_atts;
1097 1132 $allowedposttags['strong'] = $allowed_atts;
1098 1133 $allowedposttags['small'] = $allowed_atts;
1099 1134 $allowedposttags['table'] = $allowed_atts;
@@ -1121,8 +1156,10 @@
1121 1156 $allowedposttags['a'] = $allowed_atts;
1122 1157 $allowedposttags['b'] = $allowed_atts;
1123 1158 $allowedposttags['i'] = $allowed_atts;
1124 1159
1160 + $allowedposttags = apply_filters('usp_allowed_tags', $allowedposttags, $allowed_atts);
1161 +
1125 1162 if (isset($input['usp_form_content'])) $input['usp_form_content'] = wp_kses_post($input['usp_form_content'], $allowedposttags); else $input['usp_form_content'] = null;
1126 1163 if (isset($input['error-message'])) $input['error-message'] = wp_kses_post($input['error-message'], $allowedposttags); else $input['error-message'] = null;
1127 1164 if (isset($input['upload-message'])) $input['upload-message'] = wp_kses_post($input['upload-message'], $allowedposttags); else $input['upload-message'] = null;
1128 1165 if (isset($input['success-message'])) $input['success-message'] = wp_kses_post($input['success-message'], $allowedposttags); else $input['success-message'] = null;
@@ -1131,10 +1168,21 @@
1131 1168 if (isset($input['auto_image_markup'])) $input['auto_image_markup'] = wp_kses_post($input['auto_image_markup'], $allowedposttags); else $input['auto_image_markup'] = null;
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 - if (isset($input['custom_checkbox_text'])) $input['custom_checkbox_text'] = wp_kses_post($input['custom_checkbox_text'], $allowedposttags); else $input['custom_checkbox_text'] = null;
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 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 +
1137 1185 $allowedposttags = $default_allowedposttags;
1138 1186
1139 1187 if (!isset($input['usp_casing'])) $input['usp_casing'] = null;
1140 1188 $input['usp_casing'] = ($input['usp_casing'] == 1 ? 1 : 0);
@@ -1209,16 +1257,16 @@
1209 1257 if (!usp_check_date_expired() && !usp_dismiss_notice_check()) {
1210 1258
1211 1259 ?>
1212 1260
1213 - <div class="notice notice-success">
1261 + <div class="notice notice-success notice-lh">
1214 1262 <p>
1215 - <strong><?php esc_html_e('Go Pro!', 'usp'); ?></strong>
1216 - <?php esc_html_e('Save 30% on our', 'usp'); ?>
1263 + <strong><?php esc_html_e('☀️ Summer Sale!', 'usp'); ?></strong>
1264 + <?php esc_html_e('Take 35% OFF any of our', 'usp'); ?>
1217 1265 <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/"><?php esc_html_e('Pro WordPress plugins', 'usp'); ?></a>
1218 1266 <?php esc_html_e('and', 'usp'); ?>
1219 1267 <a target="_blank" rel="noopener noreferrer" href="https://books.perishablepress.com/"><?php esc_html_e('books', 'usp'); ?></a>.
1220 - <?php esc_html_e('Apply code', 'usp'); ?> <code>PLANET24</code> <?php esc_html_e('at checkout. Sale ends 5/25/24.', 'usp'); ?>
1268 + <?php esc_html_e('Apply code', 'usp'); ?> <code>SUMMER</code> <?php esc_html_e('at checkout. Sale ends 9/20/2026.', 'usp'); ?>
1221 1269 <?php echo usp_dismiss_notice_link(); ?>
1222 1270 </p>
1223 1271 </div>
1224 1272
@@ -1290,15 +1338,15 @@
1290 1338 $href = add_query_arg(array('dismiss-notice-verify' => $nonce), admin_url('options-general.php?page=user-submitted-posts'));
1291 1339
1292 1340 $label = esc_html__('Dismiss', 'usp');
1293 1341
1294 - echo '<a class="usp-dismiss-notice" href="'. esc_url($href) .'">'. esc_html($label) .'</a>';
1342 + return '<a class="usp-dismiss-notice" href="'. esc_url($href) .'">'. esc_html($label) .'</a>';
1295 1343
1296 1344 }
1297 1345
1298 1346 function usp_check_date_expired() {
1299 1347
1300 - $expires = apply_filters('usp_check_date_expired', '2024-05-25');
1348 + $expires = apply_filters('usp_check_date_expired', '2026-09-20');
1301 1349
1302 1350 return (new DateTime() > new DateTime($expires)) ? true : false;
1303 1351
1304 1352 }