User Submitted Posts - Version 20200906

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 20200906
Comparing to
See all releases

Code changes from version 20200817 to 20200906

readme.txt CHANGED
@@ -10,8 +10,8 @@ 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: 20200817
14
- Version: 20200817
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
@@ -738,6 +738,12 @@ 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
  **20200817**
742
 
743
  * Adds option to auto-display submitted name
10
  Contributors: specialk
11
  Requires at least: 4.1
12
  Tested up to: 5.5
13
+ Stable tag: 20200906
14
+ Version: 20200906
15
  Requires PHP: 5.6.20
16
  Text Domain: usp
17
  Domain Path: /languages
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
+ **20200906**
742
+
743
+ * Fixes JavaScript error with select/dropdown fields
744
+ * Updates JavaScript Cookie script to latest version
745
+ * Tests on WordPress 5.5 + 5.6 (alpha)
746
+
747
  **20200817**
748
 
749
  * Adds option to auto-display submitted name
resources/jquery.cookie.js CHANGED
@@ -1,163 +1,2 @@
1
- /*!
2
- * JavaScript Cookie v2.2.1
3
- * https://github.com/js-cookie/js-cookie
4
- *
5
- * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
- * Released under the MIT license
7
- */
8
- ;(function (factory) {
9
- var registeredInModuleLoader;
10
- if (typeof define === 'function' && define.amd) {
11
- define(factory);
12
- registeredInModuleLoader = true;
13
- }
14
- if (typeof exports === 'object') {
15
- module.exports = factory();
16
- registeredInModuleLoader = true;
17
- }
18
- if (!registeredInModuleLoader) {
19
- var OldCookies = window.Cookies;
20
- var api = window.Cookies = factory();
21
- api.noConflict = function () {
22
- window.Cookies = OldCookies;
23
- return api;
24
- };
25
- }
26
- }(function () {
27
- function extend () {
28
- var i = 0;
29
- var result = {};
30
- for (; i < arguments.length; i++) {
31
- var attributes = arguments[ i ];
32
- for (var key in attributes) {
33
- result[key] = attributes[key];
34
- }
35
- }
36
- return result;
37
- }
38
-
39
- function decode (s) {
40
- return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
41
- }
42
-
43
- function init (converter) {
44
- function api() {}
45
-
46
- function set (key, value, attributes) {
47
- if (typeof document === 'undefined') {
48
- return;
49
- }
50
-
51
- attributes = extend({
52
- path: '/'
53
- }, api.defaults, attributes);
54
-
55
- if (typeof attributes.expires === 'number') {
56
- attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
57
- }
58
-
59
- // We're using "expires" because "max-age" is not supported by IE
60
- attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
61
-
62
- try {
63
- var result = JSON.stringify(value);
64
- if (/^[\{\[]/.test(result)) {
65
- value = result;
66
- }
67
- } catch (e) {}
68
-
69
- value = converter.write ?
70
- converter.write(value, key) :
71
- encodeURIComponent(String(value))
72
- .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
73
-
74
- key = encodeURIComponent(String(key))
75
- .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
76
- .replace(/[\(\)]/g, escape);
77
-
78
- var stringifiedAttributes = '';
79
- for (var attributeName in attributes) {
80
- if (!attributes[attributeName]) {
81
- continue;
82
- }
83
- stringifiedAttributes += '; ' + attributeName;
84
- if (attributes[attributeName] === true) {
85
- continue;
86
- }
87
-
88
- // Considers RFC 6265 section 5.2:
89
- // ...
90
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
91
- // character:
92
- // Consume the characters of the unparsed-attributes up to,
93
- // not including, the first %x3B (";") character.
94
- // ...
95
- stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
96
- }
97
-
98
- return (document.cookie = key + '=' + value + stringifiedAttributes);
99
- }
100
-
101
- function get (key, json) {
102
- if (typeof document === 'undefined') {
103
- return;
104
- }
105
-
106
- var jar = {};
107
- // To prevent the for loop in the first place assign an empty array
108
- // in case there are no cookies at all.
109
- var cookies = document.cookie ? document.cookie.split('; ') : [];
110
- var i = 0;
111
-
112
- for (; i < cookies.length; i++) {
113
- var parts = cookies[i].split('=');
114
- var cookie = parts.slice(1).join('=');
115
-
116
- if (!json && cookie.charAt(0) === '"') {
117
- cookie = cookie.slice(1, -1);
118
- }
119
-
120
- try {
121
- var name = decode(parts[0]);
122
- cookie = (converter.read || converter)(cookie, name) ||
123
- decode(cookie);
124
-
125
- if (json) {
126
- try {
127
- cookie = JSON.parse(cookie);
128
- } catch (e) {}
129
- }
130
-
131
- jar[name] = cookie;
132
-
133
- if (key === name) {
134
- break;
135
- }
136
- } catch (e) {}
137
- }
138
-
139
- return key ? jar[key] : jar;
140
- }
141
-
142
- api.set = set;
143
- api.get = function (key) {
144
- return get(key, false /* read as raw */);
145
- };
146
- api.getJSON = function (key) {
147
- return get(key, true /* read as json */);
148
- };
149
- api.remove = function (key, attributes) {
150
- set(key, '', extend(attributes, {
151
- expires: -1
152
- }));
153
- };
154
-
155
- api.defaults = {};
156
-
157
- api.withConverter = init;
158
-
159
- return api;
160
- }
161
-
162
- return init(function () {});
163
- }));
1
+ /*! js-cookie v3.0.0-rc.0 | MIT */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var r=e.Cookies,n=e.Cookies=t();n.noConflict=function(){return e.Cookies=r,n}}())}(this,function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var t={read:function(e){return e.replace(/%3B/g,";")},write:function(e){return e.replace(/;/g,"%3B")}};return function r(n,i){function o(r,o,u){if("undefined"!=typeof document){"number"==typeof(u=e({},i,u)).expires&&(u.expires=new Date(Date.now()+864e5*u.expires)),u.expires&&(u.expires=u.expires.toUTCString()),r=t.write(r).replace(/=/g,"%3D"),o=n.write(String(o),r);var c="";for(var f in u)u[f]&&(c+="; "+f,!0!==u[f]&&(c+="="+u[f].split(";")[0]));return document.cookie=r+"="+o+c}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],i={},o=0;o<r.length;o++){var u=r[o].split("="),c=u.slice(1).join("="),f=t.read(u[0]).replace(/%3D/g,"=");if(i[f]=n.read(c,f),e===f)break}return e?i[e]:i}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(t){return r(this.converter,e({},this.attributes,t))},withConverter:function(t){return r(e({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}(t,{path:"/"})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
resources/jquery.usp.core.js CHANGED
@@ -45,6 +45,7 @@ jQuery(document).ready(function($) {
45
  $('.usp-submit').css('cursor', 'wait');
46
  $('.usp-submit').attr('disabled', true);
47
  }
 
48
  });
49
  $('.usp-captcha .usp-input').change(function(e) {
50
  usp_captcha_check(e);
@@ -85,8 +86,12 @@ jQuery(document).ready(function($) {
85
  $(this).val(0).prop('checked', 0);
86
  }
87
  } else if (type == 'select') {
88
- if (window.usp_multiple_cats == 1) {
89
- $.each(Cookies.getJSON(name), function(i,e) {
 
 
 
 
90
  $('#user-submitted-category option[value="'+ e +'"]').attr('selected', 'selected');
91
  });
92
  } else {
@@ -108,7 +113,7 @@ jQuery(document).ready(function($) {
108
  } else {
109
  var value = $(this).val();
110
  }
111
- Cookies.set(name, value, { path: '/', expires: 365, sameSite: 'strict' });
112
  });
113
  });
114
  }
45
  $('.usp-submit').css('cursor', 'wait');
46
  $('.usp-submit').attr('disabled', true);
47
  }
48
+ usp_remember();
49
  });
50
  $('.usp-captcha .usp-input').change(function(e) {
51
  usp_captcha_check(e);
86
  $(this).val(0).prop('checked', 0);
87
  }
88
  } else if (type == 'select') {
89
+ if (name == 'user-submitted-tags' && window.usp_existing_tags == 1) {
90
+ $.each(cookie.split(','), function(i,e) {
91
+ $('#user-submitted-tags option[value="'+ e +'"]').attr('selected', 'selected');
92
+ });
93
+ } else if (name == 'user-submitted-category' && window.usp_multiple_cats == 1) {
94
+ $.each(cookie.split(','), function(i,e) {
95
  $('#user-submitted-category option[value="'+ e +'"]').attr('selected', 'selected');
96
  });
97
  } else {
113
  } else {
114
  var value = $(this).val();
115
  }
116
+ Cookies.set(name, value, { path: '/', expires: 365000, sameSite: 'strict' });
117
  });
118
  });
119
  }
user-submitted-posts.php CHANGED
@@ -10,8 +10,8 @@
10
  Contributors: specialk
11
  Requires at least: 4.1
12
  Tested up to: 5.5
13
- Stable tag: 20200817
14
- Version: 20200817
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', '20200817');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46
 
10
  Contributors: specialk
11
  Requires at least: 4.1
12
  Tested up to: 5.5
13
+ Stable tag: 20200906
14
+ Version: 20200906
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', '20200906');
44
  define('USP_PLUGIN', esc_html__('User Submitted Posts', 'usp'));
45
  define('USP_PATH', plugin_basename(__FILE__));
46