Poll Fix

For those who also have this problem of someone spamming a poll option, I made a simple solution (checks for IP and stops people from refreshing and re-sending the POST information):

First, make a new file called vars.php in wp-content/plugins/. Accordingly put variables in there called $prefix (database prefix), $user1, $pass1, and $server1, using your MySQL information.

wp-content/plugins/polls.php

Next, place this as wp-admin/polls-manager.php.

Put this in index.php somewhere.

Lastly, run this on your database:



– Table structure for table `ip`

CREATE TABLE `ip` (
`id` int(11) NOT NULL auto_increment,
`ip` varchar(16) NOT NULL default ‘’,
KEY `id` (`id`)
) TYPE=MyISAM ;

Make sure to put it in your wordpress database.

Right now, it adds support for one vote per IP. When a new poll is added, the entries in the ip table are removed. Simple fix, but I hope it saved someone 5 minutes.

Leave a Reply