Blank/Error page after commenting
-
Hi @mylou
yes, there is a blank page after comment.Can you enable debug on your WP site to show us the underlying error?
https://codex.wordpress.org/WP_DEBUGThanks for checking!
I have enabled debug, I’m not sure what to do next. Can you see the underlying error now or is there something I need to do besides enable debug?
Yes found the error.
wp-content/plugins/comment-reply-notification/comment-reply-notification.php on line 113
There is a function named
mysql_escape_string()
. This function is deprecated in higher php versions. You will have to use the subsequent function mysqli-escape-string in it’s place.If you are not sure how to do that. Just paste the contents of that file here so we could assist.
One more thing this is a deprecated function and is insecure. You should not have been using it. Do upgrade the plugin
comment-reply-notification
to the latest version, maybe It resolves the issue automatically.One last thing, disable
WP_DEBUG
now. It shouldn’t be enable on production sites.Thanks so much for the help already!
I did indeed change the PHP version around a month ago. The plugin doesn’t have an update unfortunately, but I think I’ve found the function you’re talking about.
Do you need all of the content? Here I have a few lines:
if((int) mysql_escape_string($_POST[‘comment_parent’]) === 0 || (int) mysql_escape_string($_POST[‘comment_post_ID’]) === 0){
$sendemail = 0;
if (isset($_POST[‘action’]) && $_POST[‘action’] == ‘replyto-comment’ && isset($_POST[‘comment_ID’])) {
$id_parent = $_POST[‘comment_ID’];
if($this->options[‘mail_notify’] === ‘parent_check’){
$request = $wpdb->get_row(“SELECT comment_mail_notify FROM $wpdb->comments WHERE comment_ID=’$id_parent'”);
$sendemail = $request->comment_mail_notify;
} else {
$sendemail = 1;
}
}
if ($sendemail == 0) {
return $id;
}
$comment_parent = mysql_escape_string($_POST[‘comment_ID’]);
$comment_post = mysql_escape_string($_POST[‘comment_post_ID’]);
} else {
$comment_parent = mysql_escape_string($_POST[‘comment_parent’]);
$comment_post = mysql_escape_string($_POST[‘comment_post_ID’]);
}if($this->options[‘mail_notify’] != ‘none’){
$this->mailer($id,$comment_parent,$comment_post);
}
return $id;
}But because you say ‘You should not have been using it’, does that mean the plugin isn’t a safe plugin to use? If it’s needed, I can delete the plugin.
I would recommend using a plugin which does not use deprecated functions. Mysql functions are completely removed in higher PHP version. You site will not work at all If you upgrade to more higher PHP versions.
So It is good to get rid of it immediately.
I see that the plugin was last updated 6 years ago. That’s a long long time.
In WP site security the rule of thumb is to not use outdated plugins and themes @mylou.
That’s indeed a very long time. I removed the plugin and the issue is completely fixed.
Thank you so so much!!!
I’ll keep that in mind! Thank you 🙂
Most Welcome. 🙂
Glad it helped.
- The topic ‘Blank/Error page after commenting’ is closed to new replies.
(@mylou)
7 years, 10 months ago
Hi!
One of my visiters told me that I’ve got an issue with my commenting system. After someone comments, they’re directed to a blank or an error page. I haven’t changed any coding or whatever, so I’ve got no clue what the problem can be.
My website:
http://theblognextdoor.nl
Thanks in advance!