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 +73 -19 2023081120260916 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
@@ -870,10 +900,10 @@
870 900 'min-images' => 0,
871 901 'max-images' => 1,
872 902 'min-image-height' => 0,
873 903 'min-image-width' => 0,
874 - 'max-image-height' => 1500,
875 - 'max-image-width' => 1500,
904 + 'max-image-height' => 2500,
905 + 'max-image-width' => 2500,
876 906 'usp_name' => 'show',
877 907 'usp_url' => 'show',
878 908 'usp_email' => 'hide',
879 909 'usp_title' => 'show',
@@ -938,8 +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',
972 + 'custom_checkbox_req' => true,
973 + 'turnstile_site_key' => '',
974 + 'turnstile_secret_key' => '',
975 + 'usp_turnstile' => 'hide'
942 976 );
943 977
944 978 update_option('usp_options', $arr);
945 979
@@ -951,8 +985,9 @@
951 985
952 986 function usp_delete_plugin_options() {
953 987
954 988 delete_option('usp_options');
989 + delete_option('user-submitted-posts-dismiss-notice');
955 990
956 991 }
957 992
958 993
@@ -1039,8 +1074,11 @@
1039 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;
1040 1075 if (isset($input['recaptcha_public'])) $input['recaptcha_public'] = wp_filter_nohtml_kses($input['recaptcha_public']); else $input['recaptcha_public'] = null;
1041 1076 if (isset($input['recaptcha_private'])) $input['recaptcha_private'] = wp_filter_nohtml_kses($input['recaptcha_private']); else $input['recaptcha_private'] = null;
1042 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;
1043 1081 if (isset($input['custom_field'])) $input['custom_field'] = wp_filter_nohtml_kses($input['custom_field']); else $input['custom_field'] = null;
1044 1082 if (isset($input['custom_name'])) $input['custom_name'] = wp_filter_nohtml_kses($input['custom_name']); else $input['custom_name'] = null;
1045 1083 if (isset($input['custom_label'])) $input['custom_label'] = wp_filter_nohtml_kses($input['custom_label']); else $input['custom_label'] = null;
1046 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;
@@ -1089,10 +1127,8 @@
1089 1127 $allowedposttags['form'] = $allowed_atts;
1090 1128 $allowedposttags['label'] = $allowed_atts;
1091 1129 $allowedposttags['input'] = $allowed_atts;
1092 1130 $allowedposttags['textarea'] = $allowed_atts;
1093 - $allowedposttags['iframe'] = $allowed_atts;
1094 - $allowedposttags['script'] = $allowed_atts;
1095 1131 $allowedposttags['style'] = $allowed_atts;
1096 1132 $allowedposttags['strong'] = $allowed_atts;
1097 1133 $allowedposttags['small'] = $allowed_atts;
1098 1134 $allowedposttags['table'] = $allowed_atts;
@@ -1120,8 +1156,10 @@
1120 1156 $allowedposttags['a'] = $allowed_atts;
1121 1157 $allowedposttags['b'] = $allowed_atts;
1122 1158 $allowedposttags['i'] = $allowed_atts;
1123 1159
1160 + $allowedposttags = apply_filters('usp_allowed_tags', $allowedposttags, $allowed_atts);
1161 +
1124 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;
1125 1163 if (isset($input['error-message'])) $input['error-message'] = wp_kses_post($input['error-message'], $allowedposttags); else $input['error-message'] = null;
1126 1164 if (isset($input['upload-message'])) $input['upload-message'] = wp_kses_post($input['upload-message'], $allowedposttags); else $input['upload-message'] = null;
1127 1165 if (isset($input['success-message'])) $input['success-message'] = wp_kses_post($input['success-message'], $allowedposttags); else $input['success-message'] = null;
@@ -1130,10 +1168,21 @@
1130 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;
1131 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;
1132 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;
1133 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;
1134 - 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;
1135 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 +
1136 1185 $allowedposttags = $default_allowedposttags;
1137 1186
1138 1187 if (!isset($input['usp_casing'])) $input['usp_casing'] = null;
1139 1188 $input['usp_casing'] = ($input['usp_casing'] == 1 ? 1 : 0);
@@ -1188,8 +1237,11 @@
1188 1237
1189 1238 if (!isset($input['custom_checkbox'])) $input['custom_checkbox'] = null;
1190 1239 $input['custom_checkbox'] = ($input['custom_checkbox'] == 1 ? 1 : 0);
1191 1240
1241 + if (!isset($input['custom_checkbox_req'])) $input['custom_checkbox_req'] = null;
1242 + $input['custom_checkbox_req'] = ($input['custom_checkbox_req'] == 1 ? 1 : 0);
1243 +
1192 1244 if (!isset($input['multiple-cats'])) $input['multiple-cats'] = null;
1193 1245 $input['multiple-cats'] = ($input['multiple-cats'] == 1 ? 1 : 0);
1194 1246
1195 1247 return apply_filters('usp_input_validate', $input);
@@ -1205,14 +1257,16 @@
1205 1257 if (!usp_check_date_expired() && !usp_dismiss_notice_check()) {
1206 1258
1207 1259 ?>
1208 1260
1209 - <div class="notice notice-success">
1261 + <div class="notice notice-success notice-lh">
1210 1262 <p>
1211 - <strong><?php esc_html_e('Plugin Sale:', 'usp'); ?></strong>
1212 - <?php esc_html_e('Save 20% on any of our', 'usp'); ?>
1213 - <a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/"><?php esc_html_e('Pro WordPress plugins', 'usp'); ?></a>.
1214 - <?php esc_html_e('Apply code', 'usp'); ?> <code>PLANET2023</code> <?php esc_html_e('at checkout. Sale ends 9/9/23.', 'usp'); ?>
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'); ?>
1215 1269 <?php echo usp_dismiss_notice_link(); ?>
1216 1270 </p>
1217 1271 </div>
1218 1272
@@ -1284,15 +1338,15 @@
1284 1338 $href = add_query_arg(array('dismiss-notice-verify' => $nonce), admin_url('options-general.php?page=user-submitted-posts'));
1285 1339
1286 1340 $label = esc_html__('Dismiss', 'usp');
1287 1341
1288 - 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>';
1289 1343
1290 1344 }
1291 1345
1292 1346 function usp_check_date_expired() {
1293 1347
1294 - $expires = apply_filters('usp_check_date_expired', '2023-09-09');
1348 + $expires = apply_filters('usp_check_date_expired', '2026-09-20');
1295 1349
1296 1350 return (new DateTime() > new DateTime($expires)) ? true : false;
1297 1351
1298 1352 }