Comments – wpDiscuz - Version 5.1.7

Version Description

Download this release

Release Info

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

Code changes from version 5.1.6 to 5.1.7

class.WpdiscuzCore.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Plugin Name: wpDiscuz
5
  * Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
- * Version: 5.1.6
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: https://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
3
  /*
4
  * Plugin Name: wpDiscuz
5
  * Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
+ * Version: 5.1.7
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: https://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
forms/wpdFormAttr/Form.php CHANGED
@@ -835,8 +835,8 @@ class Form {
835
  }
836
  $user_can_comment = true;
837
  $this->initFormMeta();
838
- if ($currentUser && $currentUser->ID && $post->post_author && $post->post_author != $currentUser->ID) {
839
- if ($currentUser->roles && is_array($currentUser->roles)) {
840
  $postId = $post && isset($post->ID) ? $post->ID : $postId;
841
  $this->generalOptions['roles_cannot_comment'] = isset($this->generalOptions['roles_cannot_comment']) ? $this->generalOptions['roles_cannot_comment'] : array();
842
  foreach ($currentUser->roles as $role) {
@@ -847,9 +847,9 @@ class Form {
847
  break;
848
  }
849
  }
850
- } else {
851
- $user_can_comment = $this->generalOptions['guest_can_comment'];
852
  }
 
 
853
  }
854
  if ($user_can_comment && class_exists('WooCommerce') && get_post_type($postId) == 'product') {
855
  if (get_option('woocommerce_review_rating_verification_required') === 'no' || wc_customer_bought_product('', get_current_user_id(), $postId)) {
835
  }
836
  $user_can_comment = true;
837
  $this->initFormMeta();
838
+ if ($currentUser && $currentUser->ID) {
839
+ if ($post->post_author && $post->post_author != $currentUser->ID && $currentUser->roles && is_array($currentUser->roles)) {
840
  $postId = $post && isset($post->ID) ? $post->ID : $postId;
841
  $this->generalOptions['roles_cannot_comment'] = isset($this->generalOptions['roles_cannot_comment']) ? $this->generalOptions['roles_cannot_comment'] : array();
842
  foreach ($currentUser->roles as $role) {
847
  break;
848
  }
849
  }
 
 
850
  }
851
+ } else {
852
+ $user_can_comment = $this->generalOptions['guest_can_comment'];
853
  }
854
  if ($user_can_comment && class_exists('WooCommerce') && get_post_type($postId) == 'product') {
855
  if (get_option('woocommerce_review_rating_verification_required') === 'no' || wc_customer_bought_product('', get_current_user_id(), $postId)) {
options/class.WpdiscuzOptionsSerialized.php CHANGED
@@ -1180,7 +1180,7 @@ class WpdiscuzOptionsSerialized implements WpDiscuzConstants {
1180
  'enableStickButton' => 1,
1181
  'enableCloseButton' => 1,
1182
  'enableDropAnimation' => 1,
1183
- 'isNativeAjaxEnabled' => 1,
1184
  );
1185
  add_option(self::OPTION_SLUG_OPTIONS, serialize($options));
1186
  }
1180
  'enableStickButton' => 1,
1181
  'enableCloseButton' => 1,
1182
  'enableDropAnimation' => 1,
1183
+ 'isNativeAjaxEnabled' => 0,
1184
  );
1185
  add_option(self::OPTION_SLUG_OPTIONS, serialize($options));
1186
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, custom comment form, custom comment field
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 5.1.6
7
  Requires PHP: 5.4 and higher
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -172,7 +172,10 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
172
  == Changelog ==
173
 
174
 
175
- = Comments - wpDiscuz v5.1.6 =
 
 
 
176
 
177
  * Added: More speed based on custom AJAX processor (30% faster).
178
  * Added: Option to enable/disable WP native ajax processor (admin-ajax.php)
3
  Tags: comment, comments, ajax comments, custom comment form, custom comment field
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
+ Stable tag: 5.1.7
7
  Requires PHP: 5.4 and higher
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
172
  == Changelog ==
173
 
174
 
175
+ = Comments - wpDiscuz v5.1.6 / v5.1.7 =
176
+
177
+ * Fixed Bug : Guests commenting issue
178
+ * Fixed Bug : Avatar displaying issue
179
 
180
  * Added: More speed based on custom AJAX processor (30% faster).
181
  * Added: Option to enable/disable WP native ajax processor (admin-ajax.php)
templates/comment/class.WpdiscuzWalker.php CHANGED
@@ -155,7 +155,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
155
  'wpdiscuz_gravatar_size' => $gravatarSize,
156
  'wpdiscuz_gravatar_user_id' => $gravatarUserId,
157
  'wpdiscuz_gravatar_user_email' => $gravatarUserEmail,
158
- );
159
 
160
  $trackOrPingback = $comment->comment_type == 'pingback' || $comment->comment_type == 'trackback';
161
  if ($this->optionsSerialized->wordpressShowAvatars) {
@@ -166,6 +166,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
166
  $hideAvatarStyle = $args['is_rtl'] ? 'style="margin-right:0;"' : 'style="margin-left:0;"';
167
  }
168
 
 
169
  if (!$this->optionsSerialized->disableProfileURLs) {
170
  if ($profileUrl) {
171
  $attributes = apply_filters('wpdiscuz_avatar_link_attributes', array('href' => $profileUrl, 'target' => '_blank'));
@@ -179,8 +180,6 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
179
  } else {
180
  $commentAuthorAvatar = "<a href='$profileUrl' target='_blank'>$authorAvatar</a>";
181
  }
182
- } else {
183
- $commentAuthorAvatar = $authorAvatar;
184
  }
185
 
186
  if ($commentAuthorUrl) {
155
  'wpdiscuz_gravatar_size' => $gravatarSize,
156
  'wpdiscuz_gravatar_user_id' => $gravatarUserId,
157
  'wpdiscuz_gravatar_user_email' => $gravatarUserEmail,
158
+ );
159
 
160
  $trackOrPingback = $comment->comment_type == 'pingback' || $comment->comment_type == 'trackback';
161
  if ($this->optionsSerialized->wordpressShowAvatars) {
166
  $hideAvatarStyle = $args['is_rtl'] ? 'style="margin-right:0;"' : 'style="margin-left:0;"';
167
  }
168
 
169
+ $commentAuthorAvatar = $authorAvatar;
170
  if (!$this->optionsSerialized->disableProfileURLs) {
171
  if ($profileUrl) {
172
  $attributes = apply_filters('wpdiscuz_avatar_link_attributes', array('href' => $profileUrl, 'target' => '_blank'));
180
  } else {
181
  $commentAuthorAvatar = "<a href='$profileUrl' target='_blank'>$authorAvatar</a>";
182
  }
 
 
183
  }
184
 
185
  if ($commentAuthorUrl) {