WPIntell

Source evidence

Missing JS concatenation operator causes error

WP Datepicker · support · 2021-09-13T07:32:00+00:00

mixedsentiment
mediumseverity
0.85relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 29 rows with source links

24.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

22 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
thaikolja resolved
Hi Fahad, A client of mine uses your plugin. While running a backup with BackupBuddy , it reported a JS error: View post on imgur.com And in Chrome’s Developer Console: View post on imgur.com Looking at wpdp_auto_script.js , lines 52 and 53 are missing the + concatenation operator: if ($('input[data-original_id='datum']').val()!= "") { $('input[data-original_id='datum']').attr('data-default-val', $('input[data-original_id='datum']').val()); } Apart from these three instances, there have been three more on lines 154 and 155. Changing it to the following got rid of the error: if ($('input[data-original_id=' + datum + ']').val()!= "") { $('input[data-original_id='+ datum + ']').attr('data-default-val', $('input[data-original_id='+ datum + ']').val()); } You can find the full fixed content of wpdp_auto_script.js here . Also, consider minifying your JavaScript and only execute it on pages where it’s actually needed to prevent conflicts. This topic was modified 4 years, 8 months ago by thaikolja . @thaikolja thanks for pointing it out, we will resolve it in upcoming version. You can use Speed Optimization tab to define Allow Only pages. Thank you @danialcooper @thaikolja please have a look on functions.php line no. 562 You will notice that actually you tried to use a JS selector with single quotes. As I am already using single quotes there so conflict appeared. The file you found is not actually part of our plugin when you install it, on save changes you get this file according to your settings. As there were different scattered snippet of codes being rendered among files, we combined them as wpdp_auto_script.js and now you are expecting minification of this file. We will consider minification request in future. I am releasing another version with the fix regarding concatenation. This reply was modified 4 years, 8 months ago by Fahad Mahmood . This reply was modified 4 years, 8 months ago by Fahad Mahmood . This reply was modified 4 years, 8 months ago by Fahad Mahmood .

Comments

2 shown
danialcooper 2021-09-13T08:15:00+00:00

@thaikolja thanks for pointing it out, we will resolve it in upcoming version. You can use Speed Optimization tab to define Allow Only pages.

Fahad Mahmood 2021-09-13T10:30:00+00:00

Thank you @danialcooper @thaikolja please have a look on functions.php line no. 562 You will notice that actually you tried to use a JS selector with single quotes. As I am already using single quotes there so conflict appeared. The file you found is not actually part of our plugin when you install it, on save changes you get this file according to your settings. As there were different scattered snippet of codes being rendered among files, we combined them as wpdp_auto_script.js and now you are expecting minification of this file. We will consider minification request in future. I am releasing another version with the fix regarding concatenation. This reply was modified 4 years, 8 months ago by Fahad Mahmood . This reply was modified 4 years, 8 months ago by Fahad Mahmood . This reply was modified 4 years, 8 months ago by Fahad Mahmood .