viratraaz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpThanks @otto42 I found solution. I also learnt many wordpress core functions now.
Although it took 2 days to solve it. But the solution is very easy.
Final Solution:
Step 1: Change your theme for few moments, (choose any light theme).
Step 2: Disable all installed plugins.
Step 3: Activate back your desired theme and plugins.
Step 4: Install a fresh wordpress in your local machine.
Step 6: Copy local_directory/wp-includes/class-phpmailer.php and local_directory/wp-includes/class-smtp.php
Step 7: Paste this file here: site_directory/wp-includes/ (replace both files if these are already there)Solution close
[ Contact URL removed, keep support in these forums ]
Reason for this bug: Some plugins or themes create it’s own PHPmailer and delete some files conaining PHPmailer. After uninstlling or deactivating them, required PHPmailer get disappear and it start creating many errors.
Explanations: During debugging process, I found that in site_directory/wp-includes/pluggable.php, wp_mail function is defined. $phpmailer variable is globally called. after calling this variable, it checks for if it has PHPmailer instance. If $phpmailer was not defined properly earlier, it includes site_directory/wp-includes/class-phpmailer.php and site_directory/wp-includes/class-smtp.php . But I found that site_directory/wp-includes/class-phpmailer.php is unavailable. I added this file and bug got fixed.
Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpPlease download fresh copy of wordpress 5.1.1 from https://ww.wp.xz.cn/download/
and install it. Then look for the filesite_directory/wp-includes/comment.php
Search for
function wp_new_comment(
You’ll see a function is defined with the name
wp_new_comment( $commentdata, $avoid_die = false )
at the last second line of this function, you’ll find a function being called
do_action( ‘comment_post’, $comment_ID, $commentdata[‘comment_approved’], $commentdata );
Please tell me the use of this function (do_action) here
- This reply was modified 7 years, 1 month ago by viratraaz.
Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpfirst:
I download fresh wordpress 5.1.1 from https://ww.wp.xz.cn/download/
I compared code from file site_directory/wp-comments-post.php , site_directory/wp-includes/comment.php and site_directory/wp-includes/plugin.php
I found no difference in code.Second:
I installed and activated WordFence.
Then I ran scan and I found no issue https://ibb.co/mrj3GPhForum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpOpen
site_directory/wp-includes/comment.phpSearch for
wp_new_comment( $commentdata, $avoid_die = false ){....}read this function
see the last second line, it is
do_action( ‘comment_post’, $comment_ID, $commentdata[‘comment_approved’], $commentdata );If I remove/comment this line, everything works great.
Secondly:
I followed your suggestion
I installed plugin from https://ww.wp.xz.cn/plugins/health-check/
then I activated the plugin.
after that I started troubleshooting, I got a message https://ibb.co/hDJsgg9
then I test the bug again. The bug didn’t get resolved.Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpbetter, if i know, what is the use of
do_action( ‘comment_post’, $comment_ID, $commentdata[‘comment_approved’], $commentdata );in
wp_new_comment( $commentdata, $avoid_die = false )function from file site_directory/wp-includes/comment.php , i could write my own code or find any alternative solution.Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpI am able to edit both the field in General Settings from frontend admin panel
Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpWordPress Address (URL) : https://questuff.com Site Address (URL) : https://questuff.comI have no knowledge of wordpress core files. I just proceeded from file site_directory/wp-comments-post.php to check what is causing problem.
- This reply was modified 7 years, 1 month ago by viratraaz.
Forum: Fixing WordPress
In reply to: Comment gets stuck at https://randomwpsite.com/wp-comments-post.phpThe problem is still there in troubleshooter running mode.
Actually, when any user try to comment on any post, it gets stuck at https:///wp-comments-post.php with a post data. Usually, it should be redirected back to the post. But it doesn’t.
As I mentioned abovedo_action( ‘comment_post’, $comment_ID, $commentdata[‘comment_approved’], $commentdata );inwp_new_comment( $commentdata, $avoid_die = false )function from file-
site_directory/wp-includes/comment.php
is not working.
- This reply was modified 7 years, 1 month ago by viratraaz.