wpDataTables Lite - Version 2.1.21

Version Description

  • Feature: Added new options for link columns in datatables (noreferrer and sponsored attributes)
  • Feature: Added new options for link editor in simple table (noreferrer and sponsored attributes)
  • Other small bug fixes and stability improvements
Download this release

Release Info

Developer wpDataTables
Plugin Icon 128x128 wpDataTables Lite
Version 2.1.21
Comparing to
See all releases

Code changes from version 2.1.20 to 2.1.21

assets/js/wpdatatables/admin/constructor/wdt.simpleTable.js CHANGED
@@ -1363,6 +1363,8 @@
1363
  $('#wpdt-link-text').val(linkData.data('link-text'));
1364
  $("#wpdt-link-target-attribute").prop("checked", linkData.data('link-target') === true);
1365
  $("#wpdt-link-nofollow-attribute").prop("checked", linkData.data('link-nofollow') === true);
 
 
1366
  $("#wpdt-link-button-attribute").prop("checked", linkData.data('link-btn-status') === true);
1367
  if (linkData.data('link-btn-status') === true) {
1368
  $('div.wpdt-link-button-class-block').show();
@@ -1376,6 +1378,8 @@
1376
  $('#wpdt-link-text').val('');
1377
  $("#wpdt-link-target-attribute").prop("checked", false);
1378
  $("#wpdt-link-nofollow-attribute").prop("checked", false);
 
 
1379
  $("#wpdt-link-button-attribute").prop("checked", false);
1380
  $('div.wpdt-link-button-text-block').hide();
1381
  $('div.wpdt-link-button-class-block').hide();
@@ -1385,7 +1389,8 @@
1385
  $('#wdt-backend-insert-link-button').on('click', function (e) {
1386
  e.preventDefault();
1387
  e.stopImmediatePropagation();
1388
- let targetAttr, nofollowAttr, formdata, dataAttr, selectedRange = wpdtEditor.getSelectedRange()[0],
 
1389
  highlightRow = selectedRange.highlight.row,
1390
  highlightCol = selectedRange.highlight.col,
1391
  linkUrl = $('#wpdt-link-url'),
@@ -1394,12 +1399,17 @@
1394
  linkTextValue = linkText.val(),
1395
  linkTarget = $("#wpdt-link-target-attribute").is(":checked") || 0,
1396
  linkNofollow = $("#wpdt-link-nofollow-attribute").is(":checked") || 0,
 
 
1397
  linkButtonStatus = $("#wpdt-link-button-attribute").is(":checked") || 0,
1398
  buttonClass = $("#wpdt-button-class").val(),
1399
  pattern = new RegExp('^(https?)://');
1400
 
1401
  targetAttr = linkTarget ? "_blank" : "_self";
1402
- nofollowAttr = linkNofollow ? 'rel="nofollow"' : '';
 
 
 
1403
 
1404
  if (linkUrlValue == '') {
1405
  linkUrl.closest('.col-sm-12').siblings('.error-msg').show();
@@ -1421,14 +1431,16 @@
1421
  dataAttr += ' data-link-text="' + linkTextValue + '"';
1422
  dataAttr += ' data-link-target="' + linkTarget + '"';
1423
  dataAttr += ' data-link-nofollow="' + linkNofollow + '"';
 
 
1424
  dataAttr += ' data-link-btn-status="' + linkButtonStatus + '"';
1425
  dataAttr += ' data-link-btn-class="' + buttonClass + '"';
1426
  dataAttr += ' data-link-content="wpdt-link-content"';
1427
 
1428
  if (!linkButtonStatus) {
1429
- formdata = '<a class="wpdt-link-content" href="' + linkUrl + '" ' + nofollowAttr + ' target="' + targetAttr + '"' + dataAttr + '>' + linkTextValue + '</a>';
1430
  } else {
1431
- formdata = '<a class="wpdt-link-content" href="' + linkUrl + '" ' + nofollowAttr + ' target="' + targetAttr + '" ' + dataAttr + '><button class="' + buttonClass + '">' + linkTextValue + '</button></a>';
1432
  }
1433
 
1434
  wpdtEditor.setDataAtCell(highlightRow, highlightCol, formdata);
1363
  $('#wpdt-link-text').val(linkData.data('link-text'));
1364
  $("#wpdt-link-target-attribute").prop("checked", linkData.data('link-target') === true);
1365
  $("#wpdt-link-nofollow-attribute").prop("checked", linkData.data('link-nofollow') === true);
1366
+ $("#wpdt-link-noreferrer-attribute").prop("checked", linkData.data('link-noreferrer') === true);
1367
+ $("#wpdt-link-sponsored-attribute").prop("checked", linkData.data('link-sponsored') === true);
1368
  $("#wpdt-link-button-attribute").prop("checked", linkData.data('link-btn-status') === true);
1369
  if (linkData.data('link-btn-status') === true) {
1370
  $('div.wpdt-link-button-class-block').show();
1378
  $('#wpdt-link-text').val('');
1379
  $("#wpdt-link-target-attribute").prop("checked", false);
1380
  $("#wpdt-link-nofollow-attribute").prop("checked", false);
1381
+ $("#wpdt-link-noreferrer-attribute").prop("checked", false);
1382
+ $("#wpdt-link-sponsored-attribute").prop("checked", false);
1383
  $("#wpdt-link-button-attribute").prop("checked", false);
1384
  $('div.wpdt-link-button-text-block').hide();
1385
  $('div.wpdt-link-button-class-block').hide();
1389
  $('#wdt-backend-insert-link-button').on('click', function (e) {
1390
  e.preventDefault();
1391
  e.stopImmediatePropagation();
1392
+ let targetAttr, rel, nofollowAttr, noreferrerAttr, sponsoredAttr, formdata, dataAttr,
1393
+ selectedRange = wpdtEditor.getSelectedRange()[0],
1394
  highlightRow = selectedRange.highlight.row,
1395
  highlightCol = selectedRange.highlight.col,
1396
  linkUrl = $('#wpdt-link-url'),
1399
  linkTextValue = linkText.val(),
1400
  linkTarget = $("#wpdt-link-target-attribute").is(":checked") || 0,
1401
  linkNofollow = $("#wpdt-link-nofollow-attribute").is(":checked") || 0,
1402
+ linkNoreferrer = $("#wpdt-link-noreferrer-attribute").is(":checked") || 0,
1403
+ linkSponsored = $("#wpdt-link-sponsored-attribute").is(":checked") || 0,
1404
  linkButtonStatus = $("#wpdt-link-button-attribute").is(":checked") || 0,
1405
  buttonClass = $("#wpdt-button-class").val(),
1406
  pattern = new RegExp('^(https?)://');
1407
 
1408
  targetAttr = linkTarget ? "_blank" : "_self";
1409
+ nofollowAttr = linkNofollow ? ' nofollow ' : '';
1410
+ noreferrerAttr = linkNoreferrer ? ' noreferrer ' : '';
1411
+ sponsoredAttr = linkSponsored ? ' sponsored ' : '';
1412
+ rel = nofollowAttr + noreferrerAttr + sponsoredAttr;
1413
 
1414
  if (linkUrlValue == '') {
1415
  linkUrl.closest('.col-sm-12').siblings('.error-msg').show();
1431
  dataAttr += ' data-link-text="' + linkTextValue + '"';
1432
  dataAttr += ' data-link-target="' + linkTarget + '"';
1433
  dataAttr += ' data-link-nofollow="' + linkNofollow + '"';
1434
+ dataAttr += ' data-link-noreferrer="' + linkNoreferrer + '"';
1435
+ dataAttr += ' data-link-sponsored="' + linkSponsored + '"';
1436
  dataAttr += ' data-link-btn-status="' + linkButtonStatus + '"';
1437
  dataAttr += ' data-link-btn-class="' + buttonClass + '"';
1438
  dataAttr += ' data-link-content="wpdt-link-content"';
1439
 
1440
  if (!linkButtonStatus) {
1441
+ formdata = '<a class="wpdt-link-content" href="' + linkUrl + '" ' + ' rel="' + rel + '"' + ' target="' + targetAttr + '"' + dataAttr + '>' + linkTextValue + '</a>';
1442
  } else {
1443
+ formdata = '<a class="wpdt-link-content" href="' + linkUrl + '" ' + ' rel="' + rel + '"' + ' target="' + targetAttr + '" ' + dataAttr + '><button class="' + buttonClass + '">' + linkTextValue + '</button></a>';
1444
  }
1445
 
1446
  wpdtEditor.setDataAtCell(highlightRow, highlightCol, formdata);
assets/js/wpdatatables/admin/table-settings/column_config_object.js CHANGED
@@ -264,6 +264,16 @@ var WDTColumn = function (column, parent_table) {
264
  */
265
  this.linkNofollowAttribute = 0;
266
 
 
 
 
 
 
 
 
 
 
 
267
  /**
268
  * Open link column as a button
269
  */
@@ -312,6 +322,8 @@ var WDTColumn = function (column, parent_table) {
312
  this.id_column = column.id_column || 0;
313
  this.linkTargetAttribute = column.linkTargetAttribute || '_self';
314
  this.linkNofollowAttribute = column.linkNofollowAttribute || 0;
 
 
315
  this.linkButtonAttribute = column.linkButtonAttribute || 0;
316
  this.linkButtonLabel = column.linkButtonLabel || null;
317
  this.linkButtonClass = column.linkButtonClass || null;
@@ -1003,6 +1015,8 @@ WDTColumn.prototype.fillInputs = function () {
1003
  jQuery('#wdt-column-width').val(this.width);
1004
  jQuery('#wdt-link-target-attribute').prop('checked', this.linkTargetAttribute === '_self' ? 0 : 1);
1005
  jQuery('#wdt-link-nofollow-attribute').prop('checked', this.linkNofollowAttribute).change();
 
 
1006
  jQuery('#wdt-link-button-attribute').prop('checked', this.linkButtonAttribute).change();
1007
  jQuery('#wdt-link-button-label').val(this.linkButtonLabel);
1008
  jQuery('#wdt-link-button-class').val(this.linkButtonClass);
@@ -1221,6 +1235,8 @@ WDTColumn.prototype.applyChanges = function () {
1221
  this.css_class = jQuery('#wdt-column-css-class').val();
1222
  this.linkTargetAttribute = jQuery('#wdt-link-target-attribute').is(':checked') ? '_blank' : '_self';
1223
  this.linkNofollowAttribute = jQuery('#wdt-link-nofollow-attribute').is(':checked') ? 1 : 0;
 
 
1224
  this.linkButtonAttribute = jQuery('#wdt-link-button-attribute').is(':checked') ? 1 : 0;
1225
  this.linkButtonLabel = jQuery('#wdt-link-button-label').val();
1226
  this.linkButtonClass = jQuery('#wdt-link-button-class').val();
@@ -1336,6 +1352,8 @@ WDTColumn.prototype.getJSON = function () {
1336
  id_column: this.id_column,
1337
  linkTargetAttribute: this.linkTargetAttribute,
1338
  linkNofollowAttribute: this.linkNofollowAttribute,
 
 
1339
  linkButtonAttribute: this.linkButtonAttribute,
1340
  linkButtonLabel: this.linkButtonLabel,
1341
  linkButtonClass: this.linkButtonClass,
264
  */
265
  this.linkNofollowAttribute = 0;
266
 
267
+ /**
268
+ * Set NOREFERRER link
269
+ */
270
+ this.linkNoreferrerAttribute = 0;
271
+
272
+ /**
273
+ * Set SPONSORED link
274
+ */
275
+ this.linkSponsoredAttribute = 0;
276
+
277
  /**
278
  * Open link column as a button
279
  */
322
  this.id_column = column.id_column || 0;
323
  this.linkTargetAttribute = column.linkTargetAttribute || '_self';
324
  this.linkNofollowAttribute = column.linkNofollowAttribute || 0;
325
+ this.linkNoreferrerAttribute = column.linkNoreferrerAttribute || 0;
326
+ this.linkSponsoredAttribute = column.linkSponsoredAttribute || 0;
327
  this.linkButtonAttribute = column.linkButtonAttribute || 0;
328
  this.linkButtonLabel = column.linkButtonLabel || null;
329
  this.linkButtonClass = column.linkButtonClass || null;
1015
  jQuery('#wdt-column-width').val(this.width);
1016
  jQuery('#wdt-link-target-attribute').prop('checked', this.linkTargetAttribute === '_self' ? 0 : 1);
1017
  jQuery('#wdt-link-nofollow-attribute').prop('checked', this.linkNofollowAttribute).change();
1018
+ jQuery('#wdt-link-noreferrer-attribute').prop('checked', this.linkNoreferrerAttribute).change();
1019
+ jQuery('#wdt-link-sponsored-attribute').prop('checked', this.linkSponsoredAttribute).change();
1020
  jQuery('#wdt-link-button-attribute').prop('checked', this.linkButtonAttribute).change();
1021
  jQuery('#wdt-link-button-label').val(this.linkButtonLabel);
1022
  jQuery('#wdt-link-button-class').val(this.linkButtonClass);
1235
  this.css_class = jQuery('#wdt-column-css-class').val();
1236
  this.linkTargetAttribute = jQuery('#wdt-link-target-attribute').is(':checked') ? '_blank' : '_self';
1237
  this.linkNofollowAttribute = jQuery('#wdt-link-nofollow-attribute').is(':checked') ? 1 : 0;
1238
+ this.linkNoreferrerAttribute = jQuery('#wdt-link-noreferrer-attribute').is(':checked') ? 1 : 0;
1239
+ this.linkSponsoredAttribute = jQuery('#wdt-link-sponsored-attribute').is(':checked') ? 1 : 0;
1240
  this.linkButtonAttribute = jQuery('#wdt-link-button-attribute').is(':checked') ? 1 : 0;
1241
  this.linkButtonLabel = jQuery('#wdt-link-button-label').val();
1242
  this.linkButtonClass = jQuery('#wdt-link-button-class').val();
1352
  id_column: this.id_column,
1353
  linkTargetAttribute: this.linkTargetAttribute,
1354
  linkNofollowAttribute: this.linkNofollowAttribute,
1355
+ linkNoreferrerAttribute: this.linkNoreferrerAttribute,
1356
+ linkSponsoredAttribute: this.linkSponsoredAttribute,
1357
  linkButtonAttribute: this.linkButtonAttribute,
1358
  linkButtonLabel: this.linkButtonLabel,
1359
  linkButtonClass: this.linkButtonClass,
assets/js/wpdatatables/admin/table-settings/main.js CHANGED
@@ -556,6 +556,8 @@
556
  $('div.wdt-date-input-format-block').hide();
557
  $('div.wdt-link-target-attribute-block').hide();
558
  $('div.wdt-link-nofollow-attribute-block').hide();
 
 
559
  $('div.wdt-link-button-attribute-block').hide();
560
  $('div.wdt-link-button-label-block').hide();
561
  $('div.wdt-link-button-class-block').hide();
@@ -573,6 +575,8 @@
573
  $('div.wdt-skip-thousands-separator-block').show();
574
  }
575
  $('div.wdt-link-nofollow-attribute-block').hide();
 
 
576
  $('div.wdt-link-target-attribute-block').hide();
577
  $('div.wdt-link-button-attribute-block').hide();
578
  $('div.wdt-link-button-label-block').hide();
@@ -585,6 +589,8 @@
585
  $('div.wdt-date-input-format-block').hide();
586
  $('div.wdt-link-target-attribute-block').hide();
587
  $('div.wdt-link-nofollow-attribute-block').hide();
 
 
588
  $('div.wdt-link-button-attribute-block').hide();
589
  $('div.wdt-link-button-label-block').hide();
590
  $('div.wdt-link-button-class-block').hide();
@@ -597,6 +603,8 @@
597
  $('div.wdt-formula-column-block').hide();
598
  $('div.wdt-link-target-attribute-block').hide();
599
  $('div.wdt-link-nofollow-attribute-block').hide();
 
 
600
  $('div.wdt-link-button-attribute-block').hide();
601
  $('div.wdt-link-button-label-block').hide();
602
  $('div.wdt-link-button-class-block').hide();
@@ -608,6 +616,8 @@
608
  $('div.wdt-date-input-format-block').hide();
609
  $('div.wdt-link-target-attribute-block').show();
610
  $('div.wdt-link-nofollow-attribute-block').show();
 
 
611
  if ($('#wdt-link-button-attribute').is(':checked')) {
612
  $('div.wdt-link-button-label-block').show();
613
  $('div.wdt-link-button-class-block').show();
@@ -621,6 +631,8 @@
621
  $('div.wdt-date-input-format-block').hide();
622
  $('div.wdt-link-target-attribute-block').hide();
623
  $('div.wdt-link-nofollow-attribute-block').hide();
 
 
624
  $('div.wdt-link-button-attribute-block').hide();
625
  $('div.wdt-link-button-label-block').hide();
626
  $('div.wdt-link-button-class-block').hide();
556
  $('div.wdt-date-input-format-block').hide();
557
  $('div.wdt-link-target-attribute-block').hide();
558
  $('div.wdt-link-nofollow-attribute-block').hide();
559
+ $('div.wdt-link-noreferrer-attribute-block').hide();
560
+ $('div.wdt-link-sponsored-attribute-block').hide();
561
  $('div.wdt-link-button-attribute-block').hide();
562
  $('div.wdt-link-button-label-block').hide();
563
  $('div.wdt-link-button-class-block').hide();
575
  $('div.wdt-skip-thousands-separator-block').show();
576
  }
577
  $('div.wdt-link-nofollow-attribute-block').hide();
578
+ $('div.wdt-link-noreferrer-attribute-block').hide();
579
+ $('div.wdt-link-sponsored-attribute-block').hide();
580
  $('div.wdt-link-target-attribute-block').hide();
581
  $('div.wdt-link-button-attribute-block').hide();
582
  $('div.wdt-link-button-label-block').hide();
589
  $('div.wdt-date-input-format-block').hide();
590
  $('div.wdt-link-target-attribute-block').hide();
591
  $('div.wdt-link-nofollow-attribute-block').hide();
592
+ $('div.wdt-link-noreferrer-attribute-block').hide();
593
+ $('div.wdt-link-sponsored-attribute-block').hide();
594
  $('div.wdt-link-button-attribute-block').hide();
595
  $('div.wdt-link-button-label-block').hide();
596
  $('div.wdt-link-button-class-block').hide();
603
  $('div.wdt-formula-column-block').hide();
604
  $('div.wdt-link-target-attribute-block').hide();
605
  $('div.wdt-link-nofollow-attribute-block').hide();
606
+ $('div.wdt-link-noreferrer-attribute-block').hide();
607
+ $('div.wdt-link-sponsored-attribute-block').hide();
608
  $('div.wdt-link-button-attribute-block').hide();
609
  $('div.wdt-link-button-label-block').hide();
610
  $('div.wdt-link-button-class-block').hide();
616
  $('div.wdt-date-input-format-block').hide();
617
  $('div.wdt-link-target-attribute-block').show();
618
  $('div.wdt-link-nofollow-attribute-block').show();
619
+ $('div.wdt-link-noreferrer-attribute-block').show();
620
+ $('div.wdt-link-sponsored-attribute-block').show();
621
  if ($('#wdt-link-button-attribute').is(':checked')) {
622
  $('div.wdt-link-button-label-block').show();
623
  $('div.wdt-link-button-class-block').show();
631
  $('div.wdt-date-input-format-block').hide();
632
  $('div.wdt-link-target-attribute-block').hide();
633
  $('div.wdt-link-nofollow-attribute-block').hide();
634
+ $('div.wdt-link-noreferrer-attribute-block').hide();
635
+ $('div.wdt-link-sponsored-attribute-block').hide();
636
  $('div.wdt-link-button-attribute-block').hide();
637
  $('div.wdt-link-button-label-block').hide();
638
  $('div.wdt-link-button-class-block').hide();
config/config.inc.php CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') or die("Cannot access pages directly.");
9
 
10
  // Current version
11
 
12
- define('WDT_CURRENT_VERSION', '2.1.20');
13
 
14
  /**
15
  * Regular Expressions
9
 
10
  // Current version
11
 
12
+ define('WDT_CURRENT_VERSION', '2.1.21');
13
 
14
  /**
15
  * Regular Expressions
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: table, table builder, data tables, tables, charts, simple table, tables fr
6
  Requires at least: 4.0
7
  Tested up to: 5.8.1
8
  Requires PHP: 5.6
9
- Stable tag: 2.1.20
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -238,6 +238,11 @@ This can be changed from the “Number format” drop-down menu in the wpDataTab
238
 
239
  == Changelog ==
240
 
 
 
 
 
 
241
  = 2.1.20 =
242
  * Feature: Added clear button in color-picker in simple table.
243
  * Bugfix: Fixed resetting CSS rule for background and text color in simple table editor.
6
  Requires at least: 4.0
7
  Tested up to: 5.8.1
8
  Requires PHP: 5.6
9
+ Stable tag: 2.1.21
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
238
 
239
  == Changelog ==
240
 
241
+ = 2.1.21 =
242
+ * Feature: Added new options for link columns in datatables (noreferrer and sponsored attributes)
243
+ * Feature: Added new options for link editor in simple table (noreferrer and sponsored attributes)
244
+ * Other small bug fixes and stability improvements
245
+
246
  = 2.1.20 =
247
  * Feature: Added clear button in color-picker in simple table.
248
  * Bugfix: Fixed resetting CSS rule for background and text color in simple table editor.
source/class.link.wpdatacolumn.php CHANGED
@@ -9,6 +9,8 @@ class LinkWDTColumn extends WDTColumn
9
  protected $_dataType = 'string';
10
  protected $_linkTargetAttribute = '_self';
11
  protected $_linkNofollowAttribute = 0;
 
 
12
  protected $_linkButtonAttribute = 0;
13
  protected $_linkButtonLabel = '';
14
  protected $_linkButtonClass = '';
@@ -23,6 +25,8 @@ class LinkWDTColumn extends WDTColumn
23
  $this->_dataType = 'link';
24
  $this->setLinkTargetAttribute(WDTTools::defineDefaultValue($properties, 'linkTargetAttribute', '_self'));
25
  $this->setLinkNofollowAttribute(WDTTools::defineDefaultValue($properties, 'linkNofollowAttribute', 0));
 
 
26
  $this->setLinkButtonAttribute(WDTTools::defineDefaultValue($properties, 'linkButtonAttribute', 0));
27
  $this->setLinkButtonLabel(WDTTools::defineDefaultValue($properties, 'linkButtonLabel', ''));
28
  $this->setLinkButtonClass(WDTTools::defineDefaultValue($properties, 'linkButtonClass', ''));
@@ -36,7 +40,10 @@ class LinkWDTColumn extends WDTColumn
36
  public function prepareCellOutput($content)
37
  {
38
  $targetAttribute = $this->getLinkTargetAttribute();
39
- $nofollowAttribute = $this->getLinkNofollowAttribute() == 1 ? 'rel="nofollow"' : '';
 
 
 
40
  $buttonClass = $this->getLinkButtonClass();
41
 
42
  if (strpos($content, '||') !== false) {
@@ -44,9 +51,9 @@ class LinkWDTColumn extends WDTColumn
44
  $buttonLabel = $this->getLinkButtonLabel() !== '' ? $this->getLinkButtonLabel() : $content;
45
 
46
  if ($this->getLinkButtonAttribute() == 1 && $content !== '') {
47
- $formattedValue = "<a data-content='{$content}' href='{$link}' {$nofollowAttribute} target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
48
  } else {
49
- $formattedValue = "<a data-content='{$content}' href='{$link}' {$nofollowAttribute} target='{$targetAttribute}'>{$content}</a>";
50
  }
51
  } else {
52
  if ($this->_inputType == 'attachment') {
@@ -55,12 +62,12 @@ class LinkWDTColumn extends WDTColumn
55
  if (!empty($content)) {
56
  if($this->getLinkButtonAttribute() == 1 ){
57
  if( $this->getLinkButtonLabel() !==''){
58
- $formattedValue = "<a href='{$content}' {$nofollowAttribute} target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
59
  }else{
60
- $formattedValue = "<a href='{$content}' {$nofollowAttribute} target='{$targetAttribute}'><button class='{$buttonClass}'>{$this->_title}</button></a>";
61
  }
62
  }else{
63
- $formattedValue = "<a href='{$content}' {$nofollowAttribute} target='{$targetAttribute}'>{$this->_title}</a>";
64
  }
65
  } else {
66
  $formattedValue = '';
@@ -68,12 +75,12 @@ class LinkWDTColumn extends WDTColumn
68
  } else {
69
  if ($this->getLinkButtonAttribute() == 1 && $content !== '') {
70
  $buttonLabel = $this->getLinkButtonLabel() !== '' ? $this->getLinkButtonLabel() : $content;
71
- $formattedValue = "<a href='{$content}' {$nofollowAttribute} target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
72
  } else {
73
  if($content == ''){
74
  return null;
75
  }else {
76
- $formattedValue = "<a href='{$content}' {$nofollowAttribute} target='{$targetAttribute}'>{$content}</a>";
77
  }
78
  }
79
  }
@@ -163,4 +170,36 @@ class LinkWDTColumn extends WDTColumn
163
  $this->_linkButtonClass = $linkButtonClass;
164
  }
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
9
  protected $_dataType = 'string';
10
  protected $_linkTargetAttribute = '_self';
11
  protected $_linkNofollowAttribute = 0;
12
+ protected $_linkNoreferrerAttribute = 0;
13
+ protected $_linkSponsoredAttribute = 0;
14
  protected $_linkButtonAttribute = 0;
15
  protected $_linkButtonLabel = '';
16
  protected $_linkButtonClass = '';
25
  $this->_dataType = 'link';
26
  $this->setLinkTargetAttribute(WDTTools::defineDefaultValue($properties, 'linkTargetAttribute', '_self'));
27
  $this->setLinkNofollowAttribute(WDTTools::defineDefaultValue($properties, 'linkNofollowAttribute', 0));
28
+ $this->setLinkNoreferrerAttribute(WDTTools::defineDefaultValue($properties, 'linkNoreferrerAttribute', 0));
29
+ $this->setLinkSponsoredAttribute(WDTTools::defineDefaultValue($properties, 'linkSponsoredAttribute', 0));
30
  $this->setLinkButtonAttribute(WDTTools::defineDefaultValue($properties, 'linkButtonAttribute', 0));
31
  $this->setLinkButtonLabel(WDTTools::defineDefaultValue($properties, 'linkButtonLabel', ''));
32
  $this->setLinkButtonClass(WDTTools::defineDefaultValue($properties, 'linkButtonClass', ''));
40
  public function prepareCellOutput($content)
41
  {
42
  $targetAttribute = $this->getLinkTargetAttribute();
43
+ $nofollowAttribute = $this->getLinkNofollowAttribute() == 1 ? ' nofollow ' : '';
44
+ $noreferrerAttribute = $this->getLinkNoreferrerAttribute() == 1 ? ' noreferrer ' : '';
45
+ $sponsoredAttribute = $this->getLinkSponsoredAttribute() == 1 ? ' sponsored ' : '';
46
+ $rel = $nofollowAttribute . $noreferrerAttribute . $sponsoredAttribute;
47
  $buttonClass = $this->getLinkButtonClass();
48
 
49
  if (strpos($content, '||') !== false) {
51
  $buttonLabel = $this->getLinkButtonLabel() !== '' ? $this->getLinkButtonLabel() : $content;
52
 
53
  if ($this->getLinkButtonAttribute() == 1 && $content !== '') {
54
+ $formattedValue = "<a data-content='{$content}' href='{$link}' rel='{$rel}' target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
55
  } else {
56
+ $formattedValue = "<a data-content='{$content}' href='{$link}' rel='{$rel}' target='{$targetAttribute}'>{$content}</a>";
57
  }
58
  } else {
59
  if ($this->_inputType == 'attachment') {
62
  if (!empty($content)) {
63
  if($this->getLinkButtonAttribute() == 1 ){
64
  if( $this->getLinkButtonLabel() !==''){
65
+ $formattedValue = "<a href='{$content}' rel='{$rel}' target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
66
  }else{
67
+ $formattedValue = "<a href='{$content}' rel='{$rel}' target='{$targetAttribute}'><button class='{$buttonClass}'>{$this->_title}</button></a>";
68
  }
69
  }else{
70
+ $formattedValue = "<a href='{$content}' rel='{$rel}' target='{$targetAttribute}'>{$this->_title}</a>";
71
  }
72
  } else {
73
  $formattedValue = '';
75
  } else {
76
  if ($this->getLinkButtonAttribute() == 1 && $content !== '') {
77
  $buttonLabel = $this->getLinkButtonLabel() !== '' ? $this->getLinkButtonLabel() : $content;
78
+ $formattedValue = "<a href='{$content}' rel='{$rel}' target='{$targetAttribute}'><button class='{$buttonClass}'>{$buttonLabel}</button></a>";
79
  } else {
80
  if($content == ''){
81
  return null;
82
  }else {
83
+ $formattedValue = "<a href='{$content}' rel='{$rel}' target='{$targetAttribute}'>{$content}</a>";
84
  }
85
  }
86
  }
170
  $this->_linkButtonClass = $linkButtonClass;
171
  }
172
 
173
+ /**
174
+ * @return int
175
+ */
176
+ public function getLinkNoreferrerAttribute()
177
+ {
178
+ return $this->_linkNoreferrerAttribute;
179
+ }
180
+
181
+ /**
182
+ * @param int $linkNoreferrerAttribute
183
+ */
184
+ public function setLinkNoreferrerAttribute($linkNoreferrerAttribute)
185
+ {
186
+ $this->_linkNoreferrerAttribute = $linkNoreferrerAttribute;
187
+ }
188
+
189
+ /**
190
+ * @return int
191
+ */
192
+ public function getLinkSponsoredAttribute()
193
+ {
194
+ return $this->_linkSponsoredAttribute;
195
+ }
196
+
197
+ /**
198
+ * @param int $linkSponsoredAttribute
199
+ */
200
+ public function setLinkSponsoredAttribute($linkSponsoredAttribute)
201
+ {
202
+ $this->_linkSponsoredAttribute = $linkSponsoredAttribute;
203
+ }
204
+
205
  }
source/class.wdtconfigcontroller.php CHANGED
@@ -435,6 +435,8 @@ class WDTConfigController {
435
  $column->orig_header = sanitize_text_field($column->orig_header);
436
  $column->linkTargetAttribute = sanitize_text_field($column->linkTargetAttribute);
437
  $column->linkNofollowAttribute = (int)($column->linkNofollowAttribute);
 
 
438
  $column->linkButtonAttribute = (int)$column->linkButtonAttribute;
439
  $column->linkButtonLabel = sanitize_text_field($column->linkButtonLabel);
440
  $column->linkButtonClass = sanitize_text_field($column->linkButtonClass);
@@ -723,6 +725,10 @@ class WDTConfigController {
723
  $feColumn ? $feColumn->linkTargetAttribute : '';
724
  $columnConfig['advanced_settings']['linkNofollowAttribute'] =
725
  $feColumn ? $feColumn->linkNofollowAttribute : 0;
 
 
 
 
726
  $columnConfig['advanced_settings']['linkButtonAttribute'] =
727
  $feColumn ? $feColumn->linkButtonAttribute : 0;
728
  $columnConfig['advanced_settings']['linkButtonLabel'] =
@@ -873,6 +879,10 @@ class WDTConfigController {
873
  $advancedSettings->linkTargetAttribute : '';
874
  $feColumn->linkNofollowAttribute = isset($advancedSettings->linkNofollowAttribute) ?
875
  $advancedSettings->linkNofollowAttribute : 0;
 
 
 
 
876
  $feColumn->linkButtonAttribute = isset($advancedSettings->linkButtonAttribute) ?
877
  $advancedSettings->linkButtonAttribute : 0;
878
  $feColumn->linkButtonLabel = isset($advancedSettings->linkButtonLabel) ?
435
  $column->orig_header = sanitize_text_field($column->orig_header);
436
  $column->linkTargetAttribute = sanitize_text_field($column->linkTargetAttribute);
437
  $column->linkNofollowAttribute = (int)($column->linkNofollowAttribute);
438
+ $column->linkNoreferrerAttribute = (int)($column->linkNoreferrerAttribute);
439
+ $column->linkSponsoredAttribute = (int)($column->linkSponsoredAttribute);
440
  $column->linkButtonAttribute = (int)$column->linkButtonAttribute;
441
  $column->linkButtonLabel = sanitize_text_field($column->linkButtonLabel);
442
  $column->linkButtonClass = sanitize_text_field($column->linkButtonClass);
725
  $feColumn ? $feColumn->linkTargetAttribute : '';
726
  $columnConfig['advanced_settings']['linkNofollowAttribute'] =
727
  $feColumn ? $feColumn->linkNofollowAttribute : 0;
728
+ $columnConfig['advanced_settings']['linkNoreferrerAttribute'] =
729
+ $feColumn ? $feColumn->linkNoreferrerAttribute : 0;
730
+ $columnConfig['advanced_settings']['linkSponsoredAttribute'] =
731
+ $feColumn ? $feColumn->linkSponsoredAttribute : 0;
732
  $columnConfig['advanced_settings']['linkButtonAttribute'] =
733
  $feColumn ? $feColumn->linkButtonAttribute : 0;
734
  $columnConfig['advanced_settings']['linkButtonLabel'] =
879
  $advancedSettings->linkTargetAttribute : '';
880
  $feColumn->linkNofollowAttribute = isset($advancedSettings->linkNofollowAttribute) ?
881
  $advancedSettings->linkNofollowAttribute : 0;
882
+ $feColumn->linkNoreferrerAttribute = isset($advancedSettings->linkNoreferrerAttribute) ?
883
+ $advancedSettings->linkNoreferrerAttribute : 0;
884
+ $feColumn->linkSponsoredAttribute = isset($advancedSettings->linkSponsoredAttribute) ?
885
+ $advancedSettings->linkSponsoredAttribute : 0;
886
  $feColumn->linkButtonAttribute = isset($advancedSettings->linkButtonAttribute) ?
887
  $advancedSettings->linkButtonAttribute : 0;
888
  $feColumn->linkButtonLabel = isset($advancedSettings->linkButtonLabel) ?
source/class.wpdatatable.php CHANGED
@@ -1048,6 +1048,8 @@ class WPDataTable
1048
  $dataColumnProperties['editingDefaultValue'] = isset($wdtParameters['editingDefaultValue'][$key]) ? $wdtParameters['editingDefaultValue'][$key] : '';
1049
  $dataColumnProperties['linkTargetAttribute'] = isset($wdtParameters['linkTargetAttribute'][$key]) ? $wdtParameters['linkTargetAttribute'][$key] : '';
1050
  $dataColumnProperties['linkNofollowAttribute'] = isset($wdtParameters['linkNofollowAttribute'][$key]) ? $wdtParameters['linkNofollowAttribute'][$key] : false;
 
 
1051
  $dataColumnProperties['linkButtonAttribute'] = isset($wdtParameters['linkButtonAttribute'][$key]) ? $wdtParameters['linkButtonAttribute'][$key] : false;
1052
  $dataColumnProperties['linkButtonLabel'] = isset($wdtParameters['linkButtonLabel'][$key]) ? $wdtParameters['linkButtonLabel'][$key] : '';
1053
  $dataColumnProperties['linkButtonClass'] = isset($wdtParameters['linkButtonClass'][$key]) ? $wdtParameters['linkButtonClass'][$key] : '';
@@ -1793,6 +1795,8 @@ class WPDataTable
1793
  'userIdColumnHeader' => NULL,
1794
  'linkTargetAttribute' => array(),
1795
  'linkNofollowAttribute' => array(),
 
 
1796
  'linkButtonAttribute' => array(),
1797
  'linkButtonLabel' => array(),
1798
  'linkButtonClass' => array(),
@@ -1833,6 +1837,8 @@ class WPDataTable
1833
  $returnArray['sorting'][$column->orig_header] = isset($column->sorting) ? $column->sorting : null;
1834
  $returnArray['linkTargetAttribute'][$column->orig_header] = isset($column->linkTargetAttribute) ? $column->linkTargetAttribute : null;
1835
  $returnArray['linkNofollowAttribute'][$column->orig_header] = isset($column->linkNofollowAttribute) ? $column->linkNofollowAttribute : null;
 
 
1836
  $returnArray['linkButtonAttribute'][$column->orig_header] = isset($column->linkButtonAttribute) ? $column->linkButtonAttribute : null;
1837
  $returnArray['linkButtonLabel'][$column->orig_header] = isset($column->linkButtonLabel) ? $column->linkButtonLabel : null;
1838
  $returnArray['linkButtonClass'][$column->orig_header] = isset($column->linkButtonClass) ? $column->linkButtonClass : null;
@@ -1918,6 +1924,12 @@ class WPDataTable
1918
  if (isset($columnData['linkNofollowAttribute'])) {
1919
  $params['linkNofollowAttribute'] = $columnData['linkNofollowAttribute'];
1920
  }
 
 
 
 
 
 
1921
  if (isset($columnData['linkButtonAttribute'])) {
1922
  $params['linkButtonAttribute'] = $columnData['linkButtonAttribute'];
1923
  }
1048
  $dataColumnProperties['editingDefaultValue'] = isset($wdtParameters['editingDefaultValue'][$key]) ? $wdtParameters['editingDefaultValue'][$key] : '';
1049
  $dataColumnProperties['linkTargetAttribute'] = isset($wdtParameters['linkTargetAttribute'][$key]) ? $wdtParameters['linkTargetAttribute'][$key] : '';
1050
  $dataColumnProperties['linkNofollowAttribute'] = isset($wdtParameters['linkNofollowAttribute'][$key]) ? $wdtParameters['linkNofollowAttribute'][$key] : false;
1051
+ $dataColumnProperties['linkNoreferrerAttribute'] = isset($wdtParameters['linkNoreferrerAttribute'][$key]) ? $wdtParameters['linkNoreferrerAttribute'][$key] : false;
1052
+ $dataColumnProperties['linkSponsoredAttribute'] = isset($wdtParameters['linkSponsoredAttribute'][$key]) ? $wdtParameters['linkSponsoredAttribute'][$key] : false;
1053
  $dataColumnProperties['linkButtonAttribute'] = isset($wdtParameters['linkButtonAttribute'][$key]) ? $wdtParameters['linkButtonAttribute'][$key] : false;
1054
  $dataColumnProperties['linkButtonLabel'] = isset($wdtParameters['linkButtonLabel'][$key]) ? $wdtParameters['linkButtonLabel'][$key] : '';
1055
  $dataColumnProperties['linkButtonClass'] = isset($wdtParameters['linkButtonClass'][$key]) ? $wdtParameters['linkButtonClass'][$key] : '';
1795
  'userIdColumnHeader' => NULL,
1796
  'linkTargetAttribute' => array(),
1797
  'linkNofollowAttribute' => array(),
1798
+ 'linkNoreferrerAttribute' => array(),
1799
+ 'linkSponsoredAttribute' => array(),
1800
  'linkButtonAttribute' => array(),
1801
  'linkButtonLabel' => array(),
1802
  'linkButtonClass' => array(),
1837
  $returnArray['sorting'][$column->orig_header] = isset($column->sorting) ? $column->sorting : null;
1838
  $returnArray['linkTargetAttribute'][$column->orig_header] = isset($column->linkTargetAttribute) ? $column->linkTargetAttribute : null;
1839
  $returnArray['linkNofollowAttribute'][$column->orig_header] = isset($column->linkNofollowAttribute) ? $column->linkNofollowAttribute : null;
1840
+ $returnArray['linkNoreferrerAttribute'][$column->orig_header] = isset($column->linkNoreferrerAttribute) ? $column->linkNoreferrerAttribute : null;
1841
+ $returnArray['linkSponsoredAttribute'][$column->orig_header] = isset($column->linkSponsoredAttribute) ? $column->linkSponsoredAttribute : null;
1842
  $returnArray['linkButtonAttribute'][$column->orig_header] = isset($column->linkButtonAttribute) ? $column->linkButtonAttribute : null;
1843
  $returnArray['linkButtonLabel'][$column->orig_header] = isset($column->linkButtonLabel) ? $column->linkButtonLabel : null;
1844
  $returnArray['linkButtonClass'][$column->orig_header] = isset($column->linkButtonClass) ? $column->linkButtonClass : null;
1924
  if (isset($columnData['linkNofollowAttribute'])) {
1925
  $params['linkNofollowAttribute'] = $columnData['linkNofollowAttribute'];
1926
  }
1927
+ if (isset($columnData['linkNoreferrerAttribute'])) {
1928
+ $params['linkNoreferrerAttribute'] = $columnData['linkNoreferrerAttribute'];
1929
+ }
1930
+ if (isset($columnData['linkSponsoredAttribute'])) {
1931
+ $params['linkSponsoredAttribute'] = $columnData['linkSponsoredAttribute'];
1932
+ }
1933
  if (isset($columnData['linkButtonAttribute'])) {
1934
  $params['linkButtonAttribute'] = $columnData['linkButtonAttribute'];
1935
  }
templates/admin/common/linkModal.inc.php CHANGED
@@ -78,6 +78,28 @@
78
  </div>
79
  </div>
80
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  <div class="row">
82
  <div class="col-sm-12">
83
  <div class="form-group">
78
  </div>
79
  </div>
80
  </div>
81
+ <div class="row">
82
+ <div class="col-sm-12">
83
+ <div class="form-group">
84
+ <div class="toggle-switch" data-ts-color="blue">
85
+ <input id="wpdt-link-noreferrer-attribute" type="checkbox">
86
+ <label for="wpdt-link-noreferrer-attribute"
87
+ class="ts-label"><?php _e('Make NOREFERRER link', 'wpdatatables'); ?></label>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ <div class="row">
93
+ <div class="col-sm-12">
94
+ <div class="form-group">
95
+ <div class="toggle-switch" data-ts-color="blue">
96
+ <input id="wpdt-link-sponsored-attribute" type="checkbox">
97
+ <label for="wpdt-link-sponsored-attribute"
98
+ class="ts-label"><?php _e('Make SPONSORED link', 'wpdatatables'); ?></label>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </div>
103
  <div class="row">
104
  <div class="col-sm-12">
105
  <div class="form-group">
templates/admin/dashboard/dashboard.inc.php CHANGED
@@ -342,8 +342,8 @@ $tableChartsCount = WDTTools::getTablesCount('chart');
342
  <div class="alert alert-info m-b-0" role="alert">
343
  <i class="wpdt-icon-info-circle-full"></i>
344
  <ul>
345
- <li><strong>Feature:</strong> Added clear button in color-picker in simple table</li>
346
- <li><strong>Bugfix:</strong> Fixed resetting CSS rule for background and text color in simple table editor.</li>
347
  <li>Other small bug fixes and stability improvements.</li>
348
  </ul>
349
  </div>
342
  <div class="alert alert-info m-b-0" role="alert">
343
  <i class="wpdt-icon-info-circle-full"></i>
344
  <ul>
345
+ <li><strong>Feature:</strong> Added new options for link columns in datatable (noreferrer and sponsored attributes)</li>
346
+ <li><strong>Feature:</strong> Added new options for link editor in simple table (noreferrer and sponsored attributes)</li>
347
  <li>Other small bug fixes and stability improvements.</li>
348
  </ul>
349
  </div>
templates/admin/table-settings/column_settings_panel.inc.php CHANGED
@@ -709,7 +709,7 @@
709
 
710
  <div class="col-sm-6 wdt-link-nofollow-attribute-block">
711
  <h4 class="c-title-color m-b-2">
712
- <?php _e('URL relation attribute', 'wpdatatables'); ?>
713
  <i class="wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
714
  title="<?php _e('Set the link relation', 'wpdatatables'); ?>"></i>
715
  </h4>
@@ -720,6 +720,37 @@
720
  class="ts-label"><?php _e('Make NOFOLLOW link', 'wpdatatables'); ?></label>
721
  </div>
722
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
 
724
  </div>
725
 
709
 
710
  <div class="col-sm-6 wdt-link-nofollow-attribute-block">
711
  <h4 class="c-title-color m-b-2">
712
+ <?php _e('URL nofollow relation attribute', 'wpdatatables'); ?>
713
  <i class="wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
714
  title="<?php _e('Set the link relation', 'wpdatatables'); ?>"></i>
715
  </h4>
720
  class="ts-label"><?php _e('Make NOFOLLOW link', 'wpdatatables'); ?></label>
721
  </div>
722
  </div>
723
+ </div>
724
+
725
+ <div class="col-sm-6 wdt-link-noreferrer-attribute-block">
726
+ <h4 class="c-title-color m-b-2">
727
+ <?php _e('URL noreferrer relation attribute', 'wpdatatables'); ?>
728
+ <i class="wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
729
+ title="<?php _e('Set the link relation', 'wpdatatables'); ?>"></i>
730
+ </h4>
731
+ <div class="form-group">
732
+ <div class="toggle-switch" data-ts-color="blue">
733
+ <input id="wdt-link-noreferrer-attribute" type="checkbox">
734
+ <label for="wdt-link-noreferrer-attribute"
735
+ class="ts-label"><?php _e('Make NOREFERRER link', 'wpdatatables'); ?></label>
736
+ </div>
737
+ </div>
738
+
739
+ </div>
740
+
741
+ <div class="col-sm-6 wdt-link-sponsored-attribute-block">
742
+ <h4 class="c-title-color m-b-2">
743
+ <?php _e('URL sponsored relation attribute', 'wpdatatables'); ?>
744
+ <i class="wpdt-icon-info-circle-thin" data-toggle="tooltip" data-placement="right"
745
+ title="<?php _e('Set the link relation', 'wpdatatables'); ?>"></i>
746
+ </h4>
747
+ <div class="form-group">
748
+ <div class="toggle-switch" data-ts-color="blue">
749
+ <input id="wdt-link-sponsored-attribute" type="checkbox">
750
+ <label for="wdt-link-sponsored-attribute"
751
+ class="ts-label"><?php _e('Make SPONSORED link', 'wpdatatables'); ?></label>
752
+ </div>
753
+ </div>
754
 
755
  </div>
756
 
wpdatatables.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wpDataTables - Tables & Table Charts
4
  Plugin URI: https://wpdatatables.com
5
  Description: Create responsive, sortable tables & charts from Excel, CSV or PHP. Add tables & charts to any post in minutes with DataTables.
6
- Version: 2.1.20
7
  Author: TMS-Plugins
8
  Author URI: https://tms-outsource.com
9
  Text Domain: wpdatatables
3
  Plugin Name: wpDataTables - Tables & Table Charts
4
  Plugin URI: https://wpdatatables.com
5
  Description: Create responsive, sortable tables & charts from Excel, CSV or PHP. Add tables & charts to any post in minutes with DataTables.
6
+ Version: 2.1.21
7
  Author: TMS-Plugins
8
  Author URI: https://tms-outsource.com
9
  Text Domain: wpdatatables