User Submitted Posts - Version 20201120

Version Description

To upgrade User Submitted Posts, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.

Important! The /custom/ directory is deprecated. If you are using a custom form template, please move it to /wp-content/your-theme/usp/. For more information, check out the "Custom Submission Form" section under Installation.

Note: uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, all submitted posts (and any attached meta data) must be removed manually.

Download this release

Release Info

Developer specialk
Plugin Icon 128x128 User Submitted Posts
Version 20201120
Comparing to
See all releases

Code changes from version 20200911 to 20201120

library/plugin-settings.php CHANGED
@@ -801,7 +801,7 @@ function usp_add_defaults() {
801
 
802
  $tmp = get_option('usp_options');
803
 
804
- if (($tmp['default_options'] == '1') || (!is_array($tmp))) {
805
 
806
  $arr = array(
807
  'usp_version' => USP_VERSION,
@@ -896,7 +896,7 @@ function usp_delete_plugin_options() {
896
  delete_option('usp_options');
897
 
898
  }
899
- if ($usp_options['default_options'] == 1) {
900
 
901
  register_deactivation_hook(dirname(dirname(__FILE__)).'/user-submitted-posts.php', 'usp_delete_plugin_options');
902
 
@@ -1573,36 +1573,32 @@ function usp_render_form() {
1573
  </tr>
1574
  <tr>
1575
  <th scope="row"><label class="description" for="usp_options[min-images]"><?php esc_html_e('Minimum number of images', 'usp'); ?></label></th>
1576
- <td>
1577
- <input name="usp_options[min-images]" type="number" step="1" min="0" max="999" maxlength="3" value="<?php if (isset($usp_options['min-images'])) echo esc_attr($usp_options['min-images']); ?>" />
1578
- <span class="mm-item-caption"><?php esc_html_e('Specify the minimum number of images', 'usp'); ?></span>
1579
- </td>
1580
  </tr>
1581
  <tr>
1582
  <th scope="row"><label class="description" for="usp_options[max-images]"><?php esc_html_e('Maximum number of images', 'usp'); ?></label></th>
1583
- <td>
1584
- <input name="usp_options[max-images]" type="number" step="1" min="0" max="999" maxlength="3" value="<?php if (isset($usp_options['max-images'])) echo esc_attr($usp_options['max-images']); ?>" />
1585
- <span class="mm-item-caption"><?php esc_html_e('Specify the maximum number of images', 'usp'); ?></span>
1586
- </td>
1587
  </tr>
1588
  <tr>
1589
  <th scope="row"><label class="description" for="usp_options[min-image-width]"><?php esc_html_e('Minimum image width', 'usp'); ?></label></th>
1590
- <td><input class="input-short" type="text" size="5" maxlength="100" name="usp_options[min-image-width]" value="<?php if (isset($usp_options['min-image-width'])) echo esc_attr($usp_options['min-image-width']); ?>" />
1591
  <span class="mm-item-caption"><?php esc_html_e('Specify a minimum width (in pixels) for uploaded images', 'usp'); ?></span></td>
1592
  </tr>
1593
  <tr>
1594
  <th scope="row"><label class="description" for="usp_options[min-image-height]"><?php esc_html_e('Minimum image height', 'usp'); ?></label></th>
1595
- <td><input class="input-short" type="text" size="5" maxlength="100" name="usp_options[min-image-height]" value="<?php if (isset($usp_options['min-image-height'])) echo esc_attr($usp_options['min-image-height']); ?>" />
1596
  <span class="mm-item-caption"><?php esc_html_e('Specify a minimum height (in pixels) for uploaded images', 'usp'); ?></span></td>
1597
  </tr>
1598
  <tr>
1599
  <th scope="row"><label class="description" for="usp_options[max-image-width]"><?php esc_html_e('Maximum image width', 'usp'); ?></label></th>
1600
- <td><input class="input-short" type="text" size="5" maxlength="100" name="usp_options[max-image-width]" value="<?php if (isset($usp_options['max-image-width'])) echo esc_attr($usp_options['max-image-width']); ?>" />
1601
  <span class="mm-item-caption"><?php esc_html_e('Specify a maximum width (in pixels) for uploaded images', 'usp'); ?></span></td>
1602
  </tr>
1603
  <tr>
1604
  <th scope="row"><label class="description" for="usp_options[max-image-height]"><?php esc_html_e('Maximum image height', 'usp'); ?></label></th>
1605
- <td><input class="input-short" type="text" size="5" maxlength="100" name="usp_options[max-image-height]" value="<?php if (isset($usp_options['max-image-height'])) echo esc_attr($usp_options['max-image-height']); ?>" />
1606
  <span class="mm-item-caption"><?php esc_html_e('Specify a maximum height (in pixels) for uploaded images', 'usp'); ?></span></td>
1607
  </tr>
1608
  <tr>
@@ -1721,7 +1717,7 @@ function usp_render_form() {
1721
  <p><span class="code mm-code">[usp_display_posts]</span></p>
1722
 
1723
  <p><?php esc_html_e('Or, use the template tag to display a list of submitted posts anywhere in your theme template:', 'usp'); ?></p>
1724
- <p><span class="code mm-code">&lt;?php if (function_exists('usp_display_posts')) usp_display_posts(); ?&gt;</span></p>
1725
 
1726
  <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p>
1727
  <pre>[usp_display_posts] : default displays all submitted posts by all authors
801
 
802
  $tmp = get_option('usp_options');
803
 
804
+ if ((isset($tmp['default_options']) && $tmp['default_options'] == '1') || (!is_array($tmp))) {
805
 
806
  $arr = array(
807
  'usp_version' => USP_VERSION,
896
  delete_option('usp_options');
897
 
898
  }
899
+ if (isset($usp_options['default_options']) && $usp_options['default_options'] == 1) {
900
 
901
  register_deactivation_hook(dirname(dirname(__FILE__)).'/user-submitted-posts.php', 'usp_delete_plugin_options');
902
 
1573
  </tr>
1574
  <tr>
1575
  <th scope="row"><label class="description" for="usp_options[min-images]"><?php esc_html_e('Minimum number of images', 'usp'); ?></label></th>
1576
+ <td><input name="usp_options[min-images]" type="number" class="small-text" step="1" min="0" max="999" maxlength="3" value="<?php if (isset($usp_options['min-images'])) echo esc_attr($usp_options['min-images']); ?>" />
1577
+ <span class="mm-item-caption"><?php esc_html_e('Specify the minimum number of images', 'usp'); ?></span></td>
 
 
1578
  </tr>
1579
  <tr>
1580
  <th scope="row"><label class="description" for="usp_options[max-images]"><?php esc_html_e('Maximum number of images', 'usp'); ?></label></th>
1581
+ <td><input name="usp_options[max-images]" type="number" class="small-text" step="1" min="0" max="999" maxlength="3" value="<?php if (isset($usp_options['max-images'])) echo esc_attr($usp_options['max-images']); ?>" />
1582
+ <span class="mm-item-caption"><?php esc_html_e('Specify the maximum number of images', 'usp'); ?></span></td>
 
 
1583
  </tr>
1584
  <tr>
1585
  <th scope="row"><label class="description" for="usp_options[min-image-width]"><?php esc_html_e('Minimum image width', 'usp'); ?></label></th>
1586
+ <td><input name="usp_options[min-image-width]" type="number" class="small-text" step="1" min="0" max="999999999" maxlength="9" value="<?php if (isset($usp_options['min-image-width'])) echo esc_attr($usp_options['min-image-width']); ?>" />
1587
  <span class="mm-item-caption"><?php esc_html_e('Specify a minimum width (in pixels) for uploaded images', 'usp'); ?></span></td>
1588
  </tr>
1589
  <tr>
1590
  <th scope="row"><label class="description" for="usp_options[min-image-height]"><?php esc_html_e('Minimum image height', 'usp'); ?></label></th>
1591
+ <td><input name="usp_options[min-image-height]" type="number" class="small-text" step="1" min="0" max="999999999" maxlength="9" value="<?php if (isset($usp_options['min-image-height'])) echo esc_attr($usp_options['min-image-height']); ?>" />
1592
  <span class="mm-item-caption"><?php esc_html_e('Specify a minimum height (in pixels) for uploaded images', 'usp'); ?></span></td>
1593
  </tr>
1594
  <tr>
1595
  <th scope="row"><label class="description" for="usp_options[max-image-width]"><?php esc_html_e('Maximum image width', 'usp'); ?></label></th>
1596
+ <td><input name="usp_options[max-image-width]" type="number" class="small-text" step="1" min="0" max="999999999" maxlength="9" value="<?php if (isset($usp_options['max-image-width'])) echo esc_attr($usp_options['max-image-width']); ?>" />
1597
  <span class="mm-item-caption"><?php esc_html_e('Specify a maximum width (in pixels) for uploaded images', 'usp'); ?></span></td>
1598
  </tr>
1599
  <tr>
1600
  <th scope="row"><label class="description" for="usp_options[max-image-height]"><?php esc_html_e('Maximum image height', 'usp'); ?></label></th>
1601
+ <td><input name="usp_options[max-image-height]" type="number" class="small-text" step="1" min="0" max="999999999" maxlength="9" value="<?php if (isset($usp_options['max-image-height'])) echo esc_attr($usp_options['max-image-height']); ?>" />
1602
  <span class="mm-item-caption"><?php esc_html_e('Specify a maximum height (in pixels) for uploaded images', 'usp'); ?></span></td>
1603
  </tr>
1604
  <tr>
1717
  <p><span class="code mm-code">[usp_display_posts]</span></p>
1718
 
1719
  <p><?php esc_html_e('Or, use the template tag to display a list of submitted posts anywhere in your theme template:', 'usp'); ?></p>
1720
+ <p><span class="code mm-code">&lt;?php if (function_exists('usp_display_posts')) echo usp_display_posts(); ?&gt;</span></p>
1721
 
1722
  <p><?php esc_html_e('Here are some examples showing how to configure this shortcode:', 'usp'); ?></p>
1723
  <pre>[usp_display_posts] : default displays all submitted posts by all authors
library/shortcode-misc.php CHANGED
@@ -58,7 +58,7 @@ add_shortcode('usp-reset-button', 'usp_reset_button_shortcode');
58
  https://plugin-planet.com/usp-pro-display-list-submitted-posts/
59
 
60
  */
61
- function usp_display_posts($attr, $content = null) {
62
 
63
  global $post;
64
 
58
  https://plugin-planet.com/usp-pro-display-list-submitted-posts/
59
 
60
  */
61
+ function usp_display_posts($attr = array(), $content = null) {
62
 
63
  global $post;
64
 
library/support-panel.php CHANGED
@@ -48,7 +48,7 @@ $item1 = isset($array[$items[0]]) ? $array[$items[0]] : 0;
48
  $item2 = isset($array[$items[1]]) ? $array[$items[1]] : 1;
49
  $item3 = isset($array[$items[2]]) ? $array[$items[2]] : 2;
50
 
51
- $url1 = esc_url('https://wp-tao.com/store/');
52
  $url2 = esc_url('https://plugin-planet.com/store/');
53
  $url3 = esc_url('https://monzillamedia.com/donate.html');
54
 
48
  $item2 = isset($array[$items[1]]) ? $array[$items[1]] : 1;
49
  $item3 = isset($array[$items[2]]) ? $array[$items[2]] : 2;
50
 
51
+ $url1 = esc_url('https://books.perishablepress.com/');
52
  $url2 = esc_url('https://plugin-planet.com/store/');
53
  $url3 = esc_url('https://monzillamedia.com/donate.html');
54
 
readme.txt CHANGED
@@ -9,9 +9,9 @@ Author URI: https://plugin-planet.com/
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 5.5
13
- Stable tag: 20200911
14
- Version: 20200911
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
@@ -57,7 +57,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
57
  *User Submitted Posts is the first and best plugin for front-end content!*
58
 
59
 
60
- **Core Features**
61
 
62
  * Includes a fast & secure post-submission form
63
  * Includes a simple login/register/password form
@@ -75,7 +75,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
75
  *Boost your site value with user-generated content!*
76
 
77
 
78
- **Form Features**
79
 
80
  * Google reCAPTCHA: v2 ("I am not a bot") or v3 (hidden recaptcha)
81
  * Built-in client-side form validation with [Parsley](https://parsleyjs.org/)
@@ -93,7 +93,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
93
  *USP is simple to use and built with clean, secure code via the WP API!*
94
 
95
 
96
- **More Features**
97
 
98
  * Translated into 20+ languages
99
  * Automatically detects logged-in users
@@ -114,7 +114,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
114
  *USP provides many options to help you create the perfect form!*
115
 
116
 
117
- **Image Uploads**
118
 
119
  * Optionally enable visitors to upload any number of images
120
  * Specify minimum & maximum allowed images for each post
@@ -125,7 +125,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
125
  * Includes shortcodes to display submitted images
126
 
127
 
128
- **Post Management**
129
 
130
  * Custom Fields saved w/ each post: name, IP, URL, and image URLs
131
  * Set posts to any status: Draft, Pending, Publish, or Moderate
@@ -134,7 +134,7 @@ USP also includes a Login/Register Form, and three shortcodes to control access
134
  *Plus much more! Too many features to list them all!*
135
 
136
 
137
- **Translations**
138
 
139
  User Submitted Posts supports translation into any language. Current translations include (no particular order):
140
 
@@ -168,10 +168,10 @@ User Submitted Posts supports translation into any language. Current translation
168
  Chinese (Simplified) - usp-zh_CN
169
  Chinese (Traditional) - usp-zh_TW
170
 
171
- Note: most of the default translations are made via Google Translate. So they are automated and may be a little rough. Feel free to make your own translation as desired. Need a translation into your language? [Let me know!](https://perishablepress.com/contact/)
172
 
173
 
174
- **Privacy**
175
 
176
  __User Data:__ User Submitted Posts (USP) enables users to submit post content. It collects data _only_ from users who voluntarily submit content via the USP form. The only involuntary data that is collected is the IP address of the person submitting the form. The plugin provides an option to disable IP collection completely.
177
 
@@ -181,7 +181,7 @@ __Services:__ This plugin provides an option to enable Google reCaptcha, which i
181
 
182
 
183
 
184
- **Pro Version**
185
 
186
  __USP Pro__ now available at [Plugin Planet](https://plugin-planet.com/usp-pro/)!
187
 
@@ -191,7 +191,7 @@ Pro version includes many, many more features and settings, with unlimited custo
191
 
192
  == Installation ==
193
 
194
- **Installation**
195
 
196
  1. Upload the plugin to your blog and activate
197
  2. Configure your options via the plugin settings
@@ -200,7 +200,7 @@ Pro version includes many, many more features and settings, with unlimited custo
200
  [More info on installing WP plugins](https://wordpress.org/support/article/managing-plugins/#installing-plugins)
201
 
202
 
203
- **Usage**
204
 
205
  To display the form on any WP Post, Page, or widget, add the shortcode:
206
 
@@ -211,7 +211,7 @@ Or, to display the form anywhere in your theme, add the template tag:
211
  <?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?>
212
 
213
 
214
- **Customizing the form**
215
 
216
  There are three main ways of customizing the form:
217
 
@@ -245,7 +245,7 @@ Check out the [complete list of action hooks for User Submitted Posts](https://p
245
  More info about [WordPress Actions and Filters](https://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters)
246
 
247
 
248
- **Custom Submission Form**
249
 
250
  Out of the box, User Submitted Posts provides a highly configurable submission form. Simply visit the plugin settings to control which fields are displayed, set the Challenge Question, configure submitted images, and much more.
251
 
@@ -268,7 +268,7 @@ Alternately, you can set the option "Form style" to "HTML5 Form + Disable CSS" t
268
  Or, to go further with unlimited custom forms, [check out USP Pro](https://plugin-planet.com/usp-pro/) :)
269
 
270
 
271
- **Displaying submitted posts**
272
 
273
  User-submitted posts are handled by WordPress as regular WP Posts. So they are displayed along with your other posts according to your theme design. Additionally, each submitted post includes a set of Custom Fields that include the following information:
274
 
@@ -294,17 +294,17 @@ And here are some tutorials that may help with custom display of submitted image
294
  Also, here is a [Helper Plugin to display Custom Fields](https://plugin-planet.com/usp-pro-custom-field-helper-plugin/). It originally is designed for use with USP Pro, but also works great with the free version of USP.
295
 
296
 
297
- **Auto Display Images**
298
 
299
  To automatically display submitted images on the frontend, visit the plugin settings, "Images Auto-Display" and select whether to display the images before or after post content. Save changes.
300
 
301
 
302
- **Featured Images**
303
 
304
  To set submitted images as Featured Images (aka Post Thumbnails) for submitted posts, visit the plugin settings, "Image Uploads" and check the box to enable "Featured Image". Save changes.
305
 
306
 
307
- **Shortcodes**
308
 
309
  User Submitted Posts provides a set of useful shortcodes. Check out the "Display the Form" panel in the plugin settings for examples and more information.
310
 
@@ -326,7 +326,15 @@ Displays the post-submit form. This shortcode does not accept any attributes.
326
 
327
  __`[usp-login-form]`__
328
 
329
- Displays the user-login form. This shortcode does not accept any attributes.
 
 
 
 
 
 
 
 
330
 
331
 
332
  __`[usp_display_posts]`__
@@ -407,8 +415,7 @@ Limits access to logged-in users. Example:
407
  This shortcode accepts an optional `deny` attribute. The `deny` attribute displays a message to users who are denied access. Tip: to include markup in the deny message, you can use `{tag}` to display `<tag>`. Check out the "Display the Form" panel in the plugin settings for examples and more info.
408
 
409
 
410
-
411
- **Template tags**
412
 
413
  User Submitted Posts provides a set of useful template tags:
414
 
@@ -430,7 +437,7 @@ User Submitted Posts provides a set of useful template tags:
430
 
431
  /*
432
  Display a configurable list of submitted posts
433
- Usage: <?php if (function_exists('usp_display_posts')) usp_display_posts(); ?>
434
  */
435
 
436
  usp_display_posts()
@@ -511,7 +518,7 @@ These template tags should work out of the box when included in your theme templ
511
  The source code for these tags is located in `/library/template-tags.php` and `shortcode-login.php`.
512
 
513
 
514
- **Upgrades**
515
 
516
  To upgrade User Submitted Posts, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
517
 
@@ -520,17 +527,17 @@ __Important!__ The `/custom/` directory is deprecated. If you are using a custom
520
  __Note:__ uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, all submitted posts must be removed manually.
521
 
522
 
523
- **Restore Default Options**
524
 
525
  To restore default plugin options, either uninstall/reinstall the plugin, or visit the plugin settings &gt; Restore Default Options.
526
 
527
 
528
- **Uninstalling**
529
 
530
  User Submitted Posts cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, _all submitted posts must be removed manually_.
531
 
532
 
533
- **Pro Version**
534
 
535
  Pro version of USP now available! USP Pro includes many more awesome features and settings, with unlimited custom forms, infinite custom fields, multimedia file uploads, and much, much more.
536
 
@@ -538,7 +545,7 @@ Pro version of USP now available! USP Pro includes many more awesome features an
538
  * [Read what users are saying about USP Pro &raquo;](https://plugin-planet.com/testimonials/)
539
 
540
 
541
- **Like the plugin?**
542
 
543
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
544
 
@@ -637,7 +644,7 @@ User Submitted Posts uses the WordPress API to keep everything secure, fast, and
637
  The free version of USP supports uploads of images only, but some hosted videos may be included in the submitted content (textarea) by simply including the video URL on its own line. See [this page](https://codex.wordpress.org/Embeds) for more info. Note that [USP Pro](https://plugin-planet.com/usp-pro/) enables users to [upload video and much more](https://plugin-planet.com/usp-pro-allowed-file-types/#file-formats).
638
 
639
 
640
- **How do I reset the plugin settings? Will it erase all of my submitted posts?**
641
 
642
  To reset plugin settings to factory defaults:
643
 
@@ -646,15 +653,17 @@ To reset plugin settings to factory defaults:
646
  3. Deactivate the plugin and then reactivate it
647
  4. Plugin settings now are restored to defaults
648
 
649
- And no, restoring default settings does not delete any submitted posts. Even if you completely remove the plugin, the submitted posts will not be deleted. You have to remove them manually, if desired.
650
 
651
 
652
- **How do I enable the "Add Media" button for all users (even if not registered)?**
653
 
654
- Users must have sufficient capabilities to access the Media Library and the "Add Media" button. This is a security measure aimed at preventing foul play. The Pro version of USP provides an option to [enable Add Media uploads for all user levels](https://plugin-planet.com/usp-pro-enable-non-admin-users-upload-media/).
655
 
 
656
 
657
- **Can you explain how the setting "Registered Username" works?**
 
658
 
659
  When "Registered Username" is enabled:
660
 
@@ -724,7 +733,7 @@ And/or purchase one of my premium WordPress plugins:
724
  * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Super fast WordPress firewall
725
  * [Blackhole Pro](https://plugin-planet.com/blackhole-pro/) - Automatically block bad bots
726
  * [Banhammer Pro](https://plugin-planet.com/banhammer-pro/) - Monitor traffic and ban the bad guys
727
- * [GA Google Analytics Pro](https://plugin-planet.com/ga-google-analytics-pro/) - Connect your WordPress to Google Analytics
728
  * [USP Pro](https://plugin-planet.com/usp-pro/) - Unlimited front-end forms
729
 
730
  Links, tweets and likes also appreciated. Thanks! :)
@@ -738,6 +747,16 @@ Links, tweets and likes also appreciated. Thanks! :)
738
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
739
 
740
 
 
 
 
 
 
 
 
 
 
 
741
  **20200911**
742
 
743
  * Fixes bug where line breaks and new lines were not saved
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.6
13
+ Stable tag: 20201120
14
+ Version: 20201120
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
57
  *User Submitted Posts is the first and best plugin for front-end content!*
58
 
59
 
60
+ ### Core Features ###
61
 
62
  * Includes a fast & secure post-submission form
63
  * Includes a simple login/register/password form
75
  *Boost your site value with user-generated content!*
76
 
77
 
78
+ ### Form Features ###
79
 
80
  * Google reCAPTCHA: v2 ("I am not a bot") or v3 (hidden recaptcha)
81
  * Built-in client-side form validation with [Parsley](https://parsleyjs.org/)
93
  *USP is simple to use and built with clean, secure code via the WP API!*
94
 
95
 
96
+ ### More Features ###
97
 
98
  * Translated into 20+ languages
99
  * Automatically detects logged-in users
114
  *USP provides many options to help you create the perfect form!*
115
 
116
 
117
+ ### Image Uploads ###
118
 
119
  * Optionally enable visitors to upload any number of images
120
  * Specify minimum & maximum allowed images for each post
125
  * Includes shortcodes to display submitted images
126
 
127
 
128
+ ### Post Management ###
129
 
130
  * Custom Fields saved w/ each post: name, IP, URL, and image URLs
131
  * Set posts to any status: Draft, Pending, Publish, or Moderate
134
  *Plus much more! Too many features to list them all!*
135
 
136
 
137
+ ### Translations ###
138
 
139
  User Submitted Posts supports translation into any language. Current translations include (no particular order):
140
 
168
  Chinese (Simplified) - usp-zh_CN
169
  Chinese (Traditional) - usp-zh_TW
170
 
171
+ __Note:__ most of the default translations are made via Google Translate. So they are automated and may be a little rough. Feel free to make your own translation as desired. Need a translation into your language? [Let me know!](https://perishablepress.com/contact/)
172
 
173
 
174
+ ### Privacy ###
175
 
176
  __User Data:__ User Submitted Posts (USP) enables users to submit post content. It collects data _only_ from users who voluntarily submit content via the USP form. The only involuntary data that is collected is the IP address of the person submitting the form. The plugin provides an option to disable IP collection completely.
177
 
181
 
182
 
183
 
184
+ ### Pro Version ###
185
 
186
  __USP Pro__ now available at [Plugin Planet](https://plugin-planet.com/usp-pro/)!
187
 
191
 
192
  == Installation ==
193
 
194
+ ### How to install the plugin ###
195
 
196
  1. Upload the plugin to your blog and activate
197
  2. Configure your options via the plugin settings
200
  [More info on installing WP plugins](https://wordpress.org/support/article/managing-plugins/#installing-plugins)
201
 
202
 
203
+ ### How to use the plugin ###
204
 
205
  To display the form on any WP Post, Page, or widget, add the shortcode:
206
 
211
  <?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?>
212
 
213
 
214
+ ### Customizing the form ###
215
 
216
  There are three main ways of customizing the form:
217
 
245
  More info about [WordPress Actions and Filters](https://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters)
246
 
247
 
248
+ ### Custom Submission Form ###
249
 
250
  Out of the box, User Submitted Posts provides a highly configurable submission form. Simply visit the plugin settings to control which fields are displayed, set the Challenge Question, configure submitted images, and much more.
251
 
268
  Or, to go further with unlimited custom forms, [check out USP Pro](https://plugin-planet.com/usp-pro/) :)
269
 
270
 
271
+ ### Displaying submitted posts ###
272
 
273
  User-submitted posts are handled by WordPress as regular WP Posts. So they are displayed along with your other posts according to your theme design. Additionally, each submitted post includes a set of Custom Fields that include the following information:
274
 
294
  Also, here is a [Helper Plugin to display Custom Fields](https://plugin-planet.com/usp-pro-custom-field-helper-plugin/). It originally is designed for use with USP Pro, but also works great with the free version of USP.
295
 
296
 
297
+ ### Auto Display Images ###
298
 
299
  To automatically display submitted images on the frontend, visit the plugin settings, "Images Auto-Display" and select whether to display the images before or after post content. Save changes.
300
 
301
 
302
+ ### Featured Images ###
303
 
304
  To set submitted images as Featured Images (aka Post Thumbnails) for submitted posts, visit the plugin settings, "Image Uploads" and check the box to enable "Featured Image". Save changes.
305
 
306
 
307
+ ### Shortcodes ###
308
 
309
  User Submitted Posts provides a set of useful shortcodes. Check out the "Display the Form" panel in the plugin settings for examples and more information.
310
 
326
 
327
  __`[usp-login-form]`__
328
 
329
+ Displays the login/register/password form. This shortcode does not accept any attributes.
330
+
331
+ To add Google reCaptcha to the form, you can use any good reCaptcha plugin. Here are a few examples:
332
+
333
+ * [reCAPTCHA Lite](https://wordpress.org/plugins/recaptcha-lite/)
334
+ * [Smart Captcha (reCAPTCHA)](https://wordpress.org/plugins/smart-recaptcha/)
335
+ * [reCaptcha by BestWebSoft](https://wordpress.org/plugins/google-captcha/)
336
+
337
+ These are not endorsements for these plugins. They have been tested and work with the USP login/register/password form.
338
 
339
 
340
  __`[usp_display_posts]`__
415
  This shortcode accepts an optional `deny` attribute. The `deny` attribute displays a message to users who are denied access. Tip: to include markup in the deny message, you can use `{tag}` to display `<tag>`. Check out the "Display the Form" panel in the plugin settings for examples and more info.
416
 
417
 
418
+ ### Template tags ###
 
419
 
420
  User Submitted Posts provides a set of useful template tags:
421
 
437
 
438
  /*
439
  Display a configurable list of submitted posts
440
+ Usage: <?php if (function_exists('usp_display_posts')) echo usp_display_posts(); ?>
441
  */
442
 
443
  usp_display_posts()
518
  The source code for these tags is located in `/library/template-tags.php` and `shortcode-login.php`.
519
 
520
 
521
+ ### Upgrades ###
522
 
523
  To upgrade User Submitted Posts, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
524
 
527
  __Note:__ uninstalling the plugin from the WP Plugins screen results in the removal of all settings from the WP database. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, all submitted posts must be removed manually.
528
 
529
 
530
+ ### Restore Default Options ###
531
 
532
  To restore default plugin options, either uninstall/reinstall the plugin, or visit the plugin settings &gt; Restore Default Options.
533
 
534
 
535
+ ### Uninstalling ###
536
 
537
  User Submitted Posts cleans up after itself. All plugin settings will be removed from your database when the plugin is uninstalled via the Plugins screen. Submitted posts are NOT removed if you deactivate the plugin, reset default options, or uninstall the plugins; that is, _all submitted posts must be removed manually_.
538
 
539
 
540
+ ### Pro Version ###
541
 
542
  Pro version of USP now available! USP Pro includes many more awesome features and settings, with unlimited custom forms, infinite custom fields, multimedia file uploads, and much, much more.
543
 
545
  * [Read what users are saying about USP Pro &raquo;](https://plugin-planet.com/testimonials/)
546
 
547
 
548
+ ### Like the plugin? ###
549
 
550
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
551
 
644
  The free version of USP supports uploads of images only, but some hosted videos may be included in the submitted content (textarea) by simply including the video URL on its own line. See [this page](https://codex.wordpress.org/Embeds) for more info. Note that [USP Pro](https://plugin-planet.com/usp-pro/) enables users to [upload video and much more](https://plugin-planet.com/usp-pro-allowed-file-types/#file-formats).
645
 
646
 
647
+ **How do I reset the plugin settings?**
648
 
649
  To reset plugin settings to factory defaults:
650
 
653
  3. Deactivate the plugin and then reactivate it
654
  4. Plugin settings now are restored to defaults
655
 
656
+ Restoring default settings does not delete any submitted posts. Even if you completely remove the plugin, the submitted posts will not be deleted. You have to remove them manually, if desired.
657
 
658
 
659
+ **How do I enable the "Add Media" button for all users?**
660
 
661
+ Question: How do I enable the "Add Media" button for all users (even if not registered)?
662
 
663
+ Answer: Users must have sufficient capabilities to access the Media Library and the "Add Media" button. This is a security measure aimed at preventing foul play. The Pro version of USP provides an option to [enable Add Media uploads for all user levels](https://plugin-planet.com/usp-pro-enable-non-admin-users-upload-media/).
664
 
665
+
666
+ **Can you explain the setting "Registered Username"?**
667
 
668
  When "Registered Username" is enabled:
669
 
733
  * [BBQ Pro](https://plugin-planet.com/bbq-pro/) - Super fast WordPress firewall
734
  * [Blackhole Pro](https://plugin-planet.com/blackhole-pro/) - Automatically block bad bots
735
  * [Banhammer Pro](https://plugin-planet.com/banhammer-pro/) - Monitor traffic and ban the bad guys
736
+ * [GA Google Analytics Pro](https://plugin-planet.com/ga-google-analytics-pro/) - Connect WordPress to Google Analytics
737
  * [USP Pro](https://plugin-planet.com/usp-pro/) - Unlimited front-end forms
738
 
739
  Links, tweets and likes also appreciated. Thanks! :)
747
  If you like USP, please take a moment to [give a 5-star rating](https://wordpress.org/support/plugin/user-submitted-posts/reviews/?rate=5#new-post). It helps to keep development and support going strong. Thank you!
748
 
749
 
750
+ **20201120**
751
+
752
+ * Adds support for disabling comments
753
+ * Fixes bug with `usp_display_posts()`
754
+ * Fixes some PHP Notices "array offset"
755
+ * Improves appearance of the settings page
756
+ * Improves/updates readme.txt/documentation
757
+ * Tests on PHP 7.4 and 8.0
758
+ * Tests on WordPress 5.6
759
+
760
  **20200911**
761
 
762
  * Fixes bug where line breaks and new lines were not saved
resources/usp-admin.css CHANGED
@@ -58,7 +58,8 @@
58
  .mm-table-wrap input[type=text] { width: 80%; font-size: 13px; }
59
  .mm-table-wrap input[type=checkbox], .wp-admin p input[type=checkbox] { margin-top: -3px; }
60
  .mm-table-wrap textarea { width: 90%; font-size: 13px; }
61
- .mm-table-wrap .input-short[type=text] { width: 77px; }
 
62
  .mm-radio-inputs, .mm-checkbox-inputs { margin: 7px 0; }
63
 
64
  /* Code & Captions */
58
  .mm-table-wrap input[type=text] { width: 80%; font-size: 13px; }
59
  .mm-table-wrap input[type=checkbox], .wp-admin p input[type=checkbox] { margin-top: -3px; }
60
  .mm-table-wrap textarea { width: 90%; font-size: 13px; }
61
+ .mm-table-wrap .input-short[type=text],
62
+ .mm-table-wrap .small-text[type=number] { width: 100px; }
63
  .mm-radio-inputs, .mm-checkbox-inputs { margin: 7px 0; }
64
 
65
  /* Code & Captions */
user-submitted-posts.php CHANGED
@@ -9,9 +9,9 @@
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
- Tested up to: 5.5
13
- Stable tag: 20200911
14
- Version: 20200911
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
@@ -40,7 +40,7 @@ if (!defined('ABSPATH')) die();
40
 
41
 
42
  define('USP_WP_VERSION', '4.1');
43
- define('USP_VERSION', '20200911');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46
 
@@ -191,6 +191,22 @@ function usp_get_custom_checkbox() {
191
 
192
 
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  function usp_get_submitted_category() {
195
 
196
  $category = isset($_POST['user-submitted-category']) ? $_POST['user-submitted-category'] : '';
@@ -305,6 +321,8 @@ function usp_checkForPublicSubmission() {
305
 
306
  $checkbox = usp_get_custom_checkbox();
307
 
 
 
308
  $category = usp_get_submitted_category();
309
 
310
  $tags = usp_get_submitted_tags();
@@ -318,7 +336,7 @@ function usp_checkForPublicSubmission() {
318
  $verify = isset($_POST['user-submitted-verify']) ? sanitize_text_field($_POST['user-submitted-verify']) : '';
319
  $content = isset($_POST['user-submitted-content']) ? usp_sanitize_content($_POST['user-submitted-content']) : '';
320
 
321
- $result = usp_createPublicSubmission($title, $files, $ip, $author, $url, $email, $tags, $captcha, $verify, $content, $category, $custom, $checkbox);
322
 
323
  $post_id = false;
324
 
@@ -816,11 +834,11 @@ function usp_prepare_post($title, $content, $author_id, $author, $ip) {
816
  global $usp_options;
817
 
818
  $postData = array();
819
- $postData['post_title'] = $title;
820
- $postData['post_content'] = $content;
821
- $postData['post_author'] = $author_id;
822
- $postData['post_status'] = apply_filters('usp_post_status', 'pending');
823
- $postData['post_name'] = sanitize_title($title);
824
 
825
  $postType = isset($usp_options['usp_post_type']) ? $usp_options['usp_post_type'] : 'post';
826
 
@@ -1095,7 +1113,7 @@ function usp_attach_images($post_id, $newPost, $files, $file_count) {
1095
 
1096
 
1097
 
1098
- function usp_createPublicSubmission($title, $files, $ip, $author, $url, $email, $tags, $captcha, $verify, $content, $category, $custom, $checkbox) {
1099
 
1100
  global $usp_options;
1101
 
@@ -1174,6 +1192,8 @@ function usp_createPublicSubmission($title, $files, $ip, $author, $url, $email,
1174
 
1175
  $post->post_status = $new_status;
1176
 
 
 
1177
  wp_update_post($post);
1178
 
1179
  wp_set_post_tags($post_id, $tags);
9
  Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.1
12
+ Tested up to: 5.6
13
+ Stable tag: 20201120
14
+ Version: 20201120
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
40
 
41
 
42
  define('USP_WP_VERSION', '4.1');
43
+ define('USP_VERSION', '20201120');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46
 
191
 
192
 
193
 
194
+ function usp_get_comment_status() {
195
+
196
+ global $usp_options;
197
+
198
+ $post_type = isset($usp_options['usp_post_type']) ? $usp_options['usp_post_type'] : 'post';
199
+
200
+ $post_type = apply_filters('usp_post_type', $post_type);
201
+
202
+ $default = get_default_comment_status($post_type);
203
+
204
+ return isset($_POST['user-submitted-comments']) ? 'closed' : $default;
205
+
206
+ }
207
+
208
+
209
+
210
  function usp_get_submitted_category() {
211
 
212
  $category = isset($_POST['user-submitted-category']) ? $_POST['user-submitted-category'] : '';
321
 
322
  $checkbox = usp_get_custom_checkbox();
323
 
324
+ $comments = usp_get_comment_status();
325
+
326
  $category = usp_get_submitted_category();
327
 
328
  $tags = usp_get_submitted_tags();
336
  $verify = isset($_POST['user-submitted-verify']) ? sanitize_text_field($_POST['user-submitted-verify']) : '';
337
  $content = isset($_POST['user-submitted-content']) ? usp_sanitize_content($_POST['user-submitted-content']) : '';
338
 
339
+ $result = usp_createPublicSubmission($title, $files, $ip, $author, $url, $email, $tags, $captcha, $verify, $content, $category, $custom, $checkbox, $comments);
340
 
341
  $post_id = false;
342
 
834
  global $usp_options;
835
 
836
  $postData = array();
837
+ $postData['post_title'] = $title;
838
+ $postData['post_content'] = $content;
839
+ $postData['post_author'] = $author_id;
840
+ $postData['post_status'] = apply_filters('usp_post_status', 'pending');
841
+ $postData['post_name'] = sanitize_title($title);
842
 
843
  $postType = isset($usp_options['usp_post_type']) ? $usp_options['usp_post_type'] : 'post';
844
 
1113
 
1114
 
1115
 
1116
+ function usp_createPublicSubmission($title, $files, $ip, $author, $url, $email, $tags, $captcha, $verify, $content, $category, $custom, $checkbox, $comments) {
1117
 
1118
  global $usp_options;
1119
 
1192
 
1193
  $post->post_status = $new_status;
1194
 
1195
+ $post->comment_status = $comments;
1196
+
1197
  wp_update_post($post);
1198
 
1199
  wp_set_post_tags($post_id, $tags);