Adding comments posted before plugin was installed

By design this plugin only displays the most recent comments that are posted after the plugin is activated.

If you want to see comments right away, you can update the site_comments table with your previous comments via a script that was inspired by the post-populator.php script written for the Post Indexer plugin.

Create a new file in the wp-content directory. I called it comment-populator.php and copy and paste the following code into and save:

<?php
// load wordpress
if (empty($wp)) {
require_once('../wp-load.php'); }
// grab a list of all blogs
$blogs = get_blog_list(0, 'all');
foreach ($blogs as $blog) {
// switch to this blog
switch_to_blog($blog['blog_id']);
echo 'Blog '.$blog['blog_id'].': '.$blog['domain'];
// pull all approved comments for this blog
$comments = get_comments('status=approve');
// add  each comment in the index
foreach ($comments as $comment) {
comment_indexer_comment_insert_update($comment->comment_ID);
}
echo $blog['path'] . ": " . count($comments) . " comments. <br />";
// switch back to default blog
restore_current_blog();
}
?>

Run the script via your browser with the following URL:
http://yourdomainhere.com/wp-content/comment-populator.php

Only approved comments will be added and you'll see how many comments from each blog are added when the script runs.

There is one more step you need to complete in order for most recent comments to be displayed. The widget orders comments by the comment_date_stamp which is generated as the comments are added to the table which reflects the date and time you ran the script, not when the comment was posted.

Open wp-content/plugins/recent-global-comments-widget/recent-global-comments-widget.php. Scroll to about line 138 and edit the query. Change ORDER BY comment_date_timestamp to comment_date_gmt. It should look like the following:

$query = "SELECT * FROM " . $wpdb->base_prefix . "site_comments WHERE blog_public = '1' AND comment_approved = '1' AND comment_type != 'pingback' ORDER BY comment_date_gmt DESC LIMIT " . $options['recent-global-comments-number'];