The wp-polls plugin is a nicely written WordPress plugin to handle poll creation, view poll statistics and manage poll distribution in WordPress site.
However, I found a little issue when cleaning up the poll log when managing poll in the poll manager page at latest version (2.63 when writing this post). The log clean-up only deletes the records under wp_pollsip table where the records are associated with the poll id; and all poll question and poll answers related statistics data, which is located under wp_pollsa and wp_pollsq tables, is not reset properly and remains the same.
I located the Ajax function handling in PHP, which is in the main plugin file “wp-polls.php”. In about line 1397, where it is trying to handle the Ajax case “Delete Logs For This Poll Only”. We can see, originally, the query only tries to delete the records under wp_pollsip table. Now we can add the following code to do a quick fix to get rid of all old statistics.
$wpdb->query("UPDATE $wpdb->pollsa SET polla_votes = '0' WHERE polla_qid = $pollq_id"); $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvotes = '0', pollq_totalvoters = '0' WHERE pollq_id = $pollq_id");
Hope this helps others who get confused to see the old poll statistics data after cleaning up the poll logs.