Fixing pending comments issue

General

WordPress comments are very reliable and it is very rare that you’ll ever see this issue on your site. But just like with all technology, things sometimes fail and then you need to debug and correct them. I searched internet and found nothing. Hopefully, some of you will find this post useful.

Film & Game Releases: Week of May 24
Monday May 20, 2019

CHECK OUT OUR LIST OF MOVIE RELEASES FOR THE WEEK OF May 24, 2019! From Aladdin to Team Sonic Racing, here is a schedule of the films and games coming out soon! Film Release Schedule Aladdin Synopsis from The Numbers: Aladdin is the exciting tale of the charming street rat Aladdin, the courageous and self-determined […]

The post Film & Game Releases: Week of May 24 appeared first on Dua xe moto.

So, one day all of a sudden I find that I have 24 pending comments in my WordPress admin dashboard comments panel and when I click on pending comments link it shows no comments.

Music Production Alumnae Spotlight: Zatina Gardner
Tuesday March 26, 2019

Music Production Alumna talks singing gospel in church to performing at the Apollo Theatre Meet Zatina. She’s a recent graduate with serious ambition. We interviewed Zatina at the last alumni mixer and gleaned so much positive insight into her experience in the music industry. Zatina shares the importance of always staying true to your vision […]

The post Music Production Alumnae Spotlight: Zatina Gardner appeared first on Dua xe moto.

I realised that people were commenting but getting the error.
 

So, first I tried to optimise database which did not work. Then I started debugging code, the error message appears from wp-includes/comments.php which runs the function wp_new_comment which runs the function wp_insert_comment  which runs $wpdb->insert in wp-includes/wp-db.php which runs the function _insert_replace_helper and in this function I got the generated sql file. I printed the sql query [ print_r($this->prepare( $sql, $values ) ) ] and ran the query directly in the database. Then I found that the query was running but the comment_ID was generated as 0.

So, it was a database issue, when I edited the structure of the wp_comments table, I found that comment_ID was neither set as primary key, not it was set on auto increment mode.

Requirements to Study in Germany for Indian Students
Tuesday November 20, 2018

Studying in Germany for Indian students comes with a lot of benefits because German universities are globally ranked and valued for their top-class quality. Their state-of-the-art facilities, countless funding options, research-based courses, award-winning curriculums, diverse and vibrant student community, plus a unique lifestyle ensures you get the best studying experience ever. These features have turned […]

The post Requirements to Study in Germany for Indian Students appeared first on Dua xe moto.

The fix was to remove all the comments with comment_ID as 0 and then setting the comment_ID as primary key and auto-increment.

Finally comments were back on my site.

The post Fixing pending comments issue appeared first on VibeThemes.