Comments – wpDiscuz - Version 7.0.5

Version Description

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.0.5
Comparing to
See all releases

Code changes from version 7.0.4 to 7.0.5

class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.0.4
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -1654,7 +1654,12 @@ class WpdiscuzCore implements WpDiscuzConstants {
1654
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1655
  if ($postId) {
1656
  $this->isWpdiscuzLoaded = true;
1657
- $parentCommentIds = $this->dbManager->getParentCommentsHavingReplies($postId);
 
 
 
 
 
1658
  $childCount = 0;
1659
  $hottestCommentId = 0;
1660
  $hottestChildren = [];
@@ -1670,11 +1675,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
1670
  }
1671
 
1672
  if ($hottestCommentId && $hottestChildren) {
1673
- $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1674
- $commentStatusIn = ["1"];
1675
- if ($this->commentsArgs["status"] === "all") {
1676
- $commentStatusIn[] = "0";
1677
- }
1678
  $args = [
1679
  "format" => "flat",
1680
  "status" => $this->commentsArgs["status"],
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.0.5
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
1654
  $postId = isset($_POST["postId"]) ? intval($_POST["postId"]) : 0;
1655
  if ($postId) {
1656
  $this->isWpdiscuzLoaded = true;
1657
+ $this->commentsArgs = $this->getDefaultCommentsArgs($postId);
1658
+ $commentStatusIn = ["1"];
1659
+ if ($this->commentsArgs["status"] === "all") {
1660
+ $commentStatusIn[] = "0";
1661
+ }
1662
+ $parentCommentIds = $this->dbManager->getParentCommentsHavingReplies($postId, $commentStatusIn);
1663
  $childCount = 0;
1664
  $hottestCommentId = 0;
1665
  $hottestChildren = [];
1675
  }
1676
 
1677
  if ($hottestCommentId && $hottestChildren) {
 
 
 
 
 
1678
  $args = [
1679
  "format" => "flat",
1680
  "status" => $this->commentsArgs["status"],
includes/class.WpdiscuzDBManager.php CHANGED
@@ -188,8 +188,13 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
188
  return $this->db->get_col($sql);
189
  }
190
 
191
- public function getParentCommentsHavingReplies($postId) {
192
- $sql = $this->db->prepare("SELECT `c1`.`comment_ID` FROM `{$this->db->comments}` AS `c1` INNER JOIN `{$this->db->comments}` AS `c2` ON `c1`.`comment_post_ID` = `c2`.`comment_post_ID` AND `c2`.`comment_parent` = `c1`.`comment_ID` WHERE `c1`.`comment_post_ID` = %d AND `c1`.`comment_parent` = 0 GROUP BY `c1`.`comment_ID` ORDER BY `c1`.`comment_ID` DESC;", $postId);
 
 
 
 
 
193
  $data = $this->db->get_col($sql);
194
  return $data;
195
  }
188
  return $this->db->get_col($sql);
189
  }
190
 
191
+ public function getParentCommentsHavingReplies($postId, $commentStatusIn) {
192
+ if (count($commentStatusIn) === 1) {
193
+ $approved = " AND `c1`.`comment_approved` = '1' AND `c2`.`comment_approved` = '1'";
194
+ } else {
195
+ $approved = " AND `c1`.`comment_approved` IN('1','0') AND `c2`.`comment_approved` IN('1','0')";
196
+ }
197
+ $sql = $this->db->prepare("SELECT `c1`.`comment_ID` FROM `{$this->db->comments}` AS `c1` INNER JOIN `{$this->db->comments}` AS `c2` ON `c1`.`comment_post_ID` = `c2`.`comment_post_ID` AND `c2`.`comment_parent` = `c1`.`comment_ID` WHERE `c1`.`comment_post_ID` = %d AND `c1`.`comment_parent` = 0$approved GROUP BY `c1`.`comment_ID` ORDER BY `c1`.`comment_ID` DESC;", $postId);
198
  $data = $this->db->get_col($sql);
199
  return $data;
200
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.4
6
- Stable tag: 7.0.4
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -179,13 +179,19 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
179
 
180
  == Changelog ==
181
 
182
- = Comments - wpDiscuz v7.0.4 =
183
 
184
  **IMPORTANT!**
185
  1. Please don't forget delete all caches and purge CDN after the update.
186
  2. If you have custom CSS code for fixing mobile view, tooltips and addon related issues, please consider removing those after the update and check again. Some issues are already fixed in this version, and they may conflict with your custom CSS code.
187
  3. If yo're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
188
 
 
 
 
 
 
 
189
  * Added: Quick tags for simple comment editor (if rich editor is disabled)
190
  * Added: The wpDiscuz > Tools admin page is fully redesigned
191
  * New Tool: Import subscribers from "Lightweight Subscribe To Comments" plugin
@@ -203,11 +209,6 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
203
 
204
  = Comments - wpDiscuz v7.0.3 =
205
 
206
- **IMPORTANT!**
207
- 1. Please don't forget delete all caches and purge CDN after the update.
208
- 2. If you have customized comment background color or other colors please navigate to wpDiscuz > Settings > Styles & Colors Tab and use new background and colors options to reset them.
209
- 3. If yo're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
210
-
211
  * Added: New options to manage colors and backgrounds
212
  * Added: Change "Minimal" style label to "Off" to avoid using it as a ready style
213
  * Added: Clean cache on comment actions
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.4
6
+ Stable tag: 7.0.5
7
  Requires PHP: 5.4 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
179
 
180
  == Changelog ==
181
 
182
+ = Comments - wpDiscuz v7.0.4 / 7.0.5 =
183
 
184
  **IMPORTANT!**
185
  1. Please don't forget delete all caches and purge CDN after the update.
186
  2. If you have custom CSS code for fixing mobile view, tooltips and addon related issues, please consider removing those after the update and check again. Some issues are already fixed in this version, and they may conflict with your custom CSS code.
187
  3. If yo're updating from 5.x.x versions please read this topic: [https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/](https://wordpress.org/support/topic/before-updating-to-wpdiscuz-7-version/)
188
 
189
+ * version 7.0.5
190
+ * Changed: New and better way to check allowed comment attachments
191
+ * Fixed bug: CSS conflicts with some themes
192
+ * Fixed bug: Other minor bugs are fixed
193
+ * ------
194
+ * version 7.0.4
195
  * Added: Quick tags for simple comment editor (if rich editor is disabled)
196
  * Added: The wpDiscuz > Tools admin page is fully redesigned
197
  * New Tool: Import subscribers from "Lightweight Subscribe To Comments" plugin
209
 
210
  = Comments - wpDiscuz v7.0.3 =
211
 
 
 
 
 
 
212
  * Added: New options to manage colors and backgrounds
213
  * Added: Change "Minimal" style label to "Off" to avoid using it as a ready style
214
  * Added: Clean cache on comment actions
themes/default/style-minimal-rtl.css CHANGED
@@ -63,6 +63,7 @@ _:-ms-lang(x), .wpd-social-login [wpd-tooltip]::before{top: -24px;}
63
  #wpdcom span.wpd-field-desc span {position: absolute; width:200px; color: #FFFFFF; background: #555555; height:auto; line-height: 17px; padding:8px 10px; font-size:12px; text-align: center; visibility: hidden; border-radius: 6px; right: -150px; }
64
  #wpdcom span.wpd-field-desc span:after { content: ''; position: absolute; top: 100%; right: 50%; width: 0; height: 0; border-top: 8px solid #555555; border-left: 8px solid transparent; border-right: 8px solid transparent; }
65
  #wpdcom span:hover.wpd-field-desc span {visibility: visible; opacity: 1; bottom: 38px; right: 50%; margin-right: -105px; z-index: 999999; }
 
66
 
67
 
68
 
63
  #wpdcom span.wpd-field-desc span {position: absolute; width:200px; color: #FFFFFF; background: #555555; height:auto; line-height: 17px; padding:8px 10px; font-size:12px; text-align: center; visibility: hidden; border-radius: 6px; right: -150px; }
64
  #wpdcom span.wpd-field-desc span:after { content: ''; position: absolute; top: 100%; right: 50%; width: 0; height: 0; border-top: 8px solid #555555; border-left: 8px solid transparent; border-right: 8px solid transparent; }
65
  #wpdcom span:hover.wpd-field-desc span {visibility: visible; opacity: 1; bottom: 38px; right: 50%; margin-right: -105px; z-index: 999999; }
66
+ #comments #wpdcom .wpdiscuz-embed-wrapper .fb_iframe_widget > span{display: inline-block;}
67
 
68
 
69
 
themes/default/style-minimal.css CHANGED
@@ -63,6 +63,7 @@ _:-ms-lang(x), .wpd-social-login [wpd-tooltip]::before{top: -24px;}
63
  #wpdcom span.wpd-field-desc span {position: absolute; width:200px; color: #FFFFFF; background: #555555; height:auto; line-height: 17px; padding:8px 10px; font-size:12px; text-align: center; visibility: hidden; border-radius: 6px; left: -150px; }
64
  #wpdcom span.wpd-field-desc span:after { content: ''; position: absolute; top: 100%; left: 50%; width: 0; height: 0; border-top: 8px solid #555555; border-right: 8px solid transparent; border-left: 8px solid transparent; }
65
  #wpdcom span:hover.wpd-field-desc span {visibility: visible; opacity: 1; bottom: 38px; left: 50%; margin-left: -105px; z-index: 999999; }
 
66
 
67
 
68
 
63
  #wpdcom span.wpd-field-desc span {position: absolute; width:200px; color: #FFFFFF; background: #555555; height:auto; line-height: 17px; padding:8px 10px; font-size:12px; text-align: center; visibility: hidden; border-radius: 6px; left: -150px; }
64
  #wpdcom span.wpd-field-desc span:after { content: ''; position: absolute; top: 100%; left: 50%; width: 0; height: 0; border-top: 8px solid #555555; border-right: 8px solid transparent; border-left: 8px solid transparent; }
65
  #wpdcom span:hover.wpd-field-desc span {visibility: visible; opacity: 1; bottom: 38px; left: 50%; margin-left: -105px; z-index: 999999; }
66
+ #comments #wpdcom .wpdiscuz-embed-wrapper .fb_iframe_widget > span{display: inline-block;}
67
 
68
 
69
 
themes/default/style-rtl.css CHANGED
@@ -14,6 +14,7 @@ Version: 1.0
14
  #wpdcom *{box-sizing:border-box; line-height: initial;}
15
  #wpdcom i{margin:0;}
16
  #comments #wpdcom span, #respond #wpdcom span, #wpdcom span{display: inline;letter-spacing: inherit;text-transform: none;font-size: 1em;}
 
17
  #wpdcom form{margin: 0px; padding: 0px; border: none; background: none;}
18
  #wpdcom input:required {box-shadow: 0px 0px 1px #555;}
19
  #wpdcom button{min-height: auto; min-width: auto; max-width: auto; min-height: auto; display: inline-block; font-weight:normal;text-transform: none;}
14
  #wpdcom *{box-sizing:border-box; line-height: initial;}
15
  #wpdcom i{margin:0;}
16
  #comments #wpdcom span, #respond #wpdcom span, #wpdcom span{display: inline;letter-spacing: inherit;text-transform: none;font-size: 1em;}
17
+ #comments #wpdcom .wpdiscuz-embed-wrapper .fb_iframe_widget > span{display: inline-block;}
18
  #wpdcom form{margin: 0px; padding: 0px; border: none; background: none;}
19
  #wpdcom input:required {box-shadow: 0px 0px 1px #555;}
20
  #wpdcom button{min-height: auto; min-width: auto; max-width: auto; min-height: auto; display: inline-block; font-weight:normal;text-transform: none;}
themes/default/style.css CHANGED
@@ -14,6 +14,7 @@ Version: 7.0.0
14
  #wpdcom *{box-sizing:border-box; line-height: initial;}
15
  #wpdcom i{margin:0;}
16
  #comments #wpdcom span, #respond #wpdcom span, #wpdcom span{display: inline;letter-spacing: inherit;text-transform: none;font-size: 1em;}
 
17
  #wpdcom form{margin: 0px; padding: 0px; border: none; background: none;}
18
  #wpdcom input:required {box-shadow: 0px 0px 1px #555;}
19
  #wpdcom button{min-height: auto; min-width: auto; max-width: auto; min-height: auto; display: inline-block; font-weight:normal;text-transform: none;}
14
  #wpdcom *{box-sizing:border-box; line-height: initial;}
15
  #wpdcom i{margin:0;}
16
  #comments #wpdcom span, #respond #wpdcom span, #wpdcom span{display: inline;letter-spacing: inherit;text-transform: none;font-size: 1em;}
17
+ #comments #wpdcom .wpdiscuz-embed-wrapper .fb_iframe_widget > span{display: inline-block;}
18
  #wpdcom form{margin: 0px; padding: 0px; border: none; background: none;}
19
  #wpdcom input:required {box-shadow: 0px 0px 1px #555;}
20
  #wpdcom button{min-height: auto; min-width: auto; max-width: auto; min-height: auto; display: inline-block; font-weight:normal;text-transform: none;}
utils/class.WpdiscuzHelperUpload.php CHANGED
@@ -325,12 +325,13 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
325
  if ($mimeType = $this->isImage($file)) {
326
  if ((strpos($mimeType, "image/") !== false) && empty($extension)) {
327
  $file["name"] .= ".jpg";
 
328
  }
329
  } else {
330
  $mimeType = $this->getMimeType($file, $extension);
331
  }
332
 
333
- if ($this->isAllowedFileType($mimeType)) {
334
  if (empty($extension)) {
335
  if (strpos($mimeType, "image/") === false) {
336
  foreach ($this->mimeTypes as $ext => $mimes) {
@@ -377,13 +378,14 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
377
  wp_send_json_success($response);
378
  }
379
 
380
- private function isAllowedFileType($mimeType) {
381
  $isAllowed = false;
382
  if (!empty($this->mimeTypes) && is_array($this->mimeTypes)) {
383
  foreach ($this->mimeTypes as $ext => $mimes) {
384
- $isAllowed = in_array($mimeType, explode("|", $mimes));
385
- if ($isAllowed) {
386
- break;
 
387
  }
388
  }
389
  }
@@ -400,8 +402,9 @@ class WpdiscuzHelperUpload implements WpDiscuzConstants {
400
  } elseif ($extension) {
401
  foreach ($this->mimeTypes as $ext => $mimeTypes) {
402
  $exp = explode("|", $mimeTypes);
403
- if (in_array($extension, $exp)) {
404
  $mimeType = $exp[0];
 
405
  }
406
  }
407
  }
325
  if ($mimeType = $this->isImage($file)) {
326
  if ((strpos($mimeType, "image/") !== false) && empty($extension)) {
327
  $file["name"] .= ".jpg";
328
+ $extension = "jpg";
329
  }
330
  } else {
331
  $mimeType = $this->getMimeType($file, $extension);
332
  }
333
 
334
+ if ($this->isAllowedFileType($mimeType, $extension)) {
335
  if (empty($extension)) {
336
  if (strpos($mimeType, "image/") === false) {
337
  foreach ($this->mimeTypes as $ext => $mimes) {
378
  wp_send_json_success($response);
379
  }
380
 
381
+ private function isAllowedFileType($mimeType, $extension) {
382
  $isAllowed = false;
383
  if (!empty($this->mimeTypes) && is_array($this->mimeTypes)) {
384
  foreach ($this->mimeTypes as $ext => $mimes) {
385
+ if ($ext === $extension) {
386
+ if ($isAllowed = in_array($mimeType, explode("|", $mimes))) {
387
+ break;
388
+ }
389
  }
390
  }
391
  }
402
  } elseif ($extension) {
403
  foreach ($this->mimeTypes as $ext => $mimeTypes) {
404
  $exp = explode("|", $mimeTypes);
405
+ if ($extension === $ext) {
406
  $mimeType = $exp[0];
407
+ break;
408
  }
409
  }
410
  }