Hi, can you please tell me how can I adjust the time it take to redirect the first-time commenters to a page? Right now it takes a few second and I want to reduce it as much as posible. Thanks
thank you
I'm sorry, but there is no option to change the redirection time.
You should change the time manually in wpDiscuz files.
1. Please open the wpdiscuz.js file, in the /wp-content/plugins/wpdiscuz/assets/js/ folder
2. Find the wpdiscuzRedirect function, and change the 5000 value as you like
Warning: Making changes to active plugins is not recommended. You should deactivate the plugin before making any changes.
The changes will be lost after the update, however, we'll take into consideration to change the value in future updates.
Thank you for taking the time to show me the solution. It works!
Is is posible to have the redirect active for all the comments not only for the first timers?
Thanks again
Please follow the steps below:
1. Open the class.WpdiscuzCore.php file, in /wp-content/plugins/wpdiscuz/ folder.
2. Find the redirect() function:
public function redirect() {
$messageArray = array('code' => 0);
$commentId = isset($_POST['commentId']) ? intval($_POST['commentId']) : 0;
if ($this->optionsSerialized->redirectPage && $commentId) {
$comment = get_comment($commentId);
if ($comment->comment_ID) {
$userCommentCount = get_comments(array('author_email' => $comment->comment_author_email, 'count' => true));
if ($userCommentCount == 1) {
$messageArray['code'] = 1;
$messageArray['redirect_to'] = get_permalink($this->optionsSerialized->redirectPage);
}
}
}
$this->commentsArgs['caller'] = '';
wp_die(json_encode($messageArray));
}
3. Replace with this one:
public function redirect() {
$messageArray = array('code' => 0);
$commentId = isset($_POST['commentId']) ? intval($_POST['commentId']) : 0;
if ($this->optionsSerialized->redirectPage && $commentId) {
$comment = get_comment($commentId);
if ($comment->comment_ID) {
$messageArray['code'] = 1;
$messageArray['redirect_to'] = get_permalink($this->optionsSerialized->redirectPage);
}
}
$this->commentsArgs['caller'] = '';
wp_die(json_encode($messageArray));
}
Please note the changes will be overwritten after the update, you should keep the function somewhere locally, and change after the update.
I appreciate it, thank you.
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.
Thank you kimchi very much.