So the problem was that cookies did not work at all, and that even with IP blocking it only recognised that the user had voted after they tried to vote again. After some digging I found the problems.
A few issues with the code result in php notices. If the environment has error reporting on, these cause headers to be sent, and that means setcookie fails.
There were also a couple of admin glitches which had similar causes.
Here are some of the log entries that show the problems:
[16-May-2014 10:01:52 UTC] PHP Notice: Undefined variable: feeditems in /wp-content/plugins/yop-poll/inc/admin.php on line 8714
[16-May-2014 10:01:54 UTC] PHP Strict Standards: Non-static method Yop_Poll_Model::return_template_preview_html() should not be called statically, assuming $this from incompatible context in /wp-content/plugins/yop-poll/inc/admin.php on line 6974
[16-May-2014 10:01:54 UTC] PHP Strict Standards: Non-static method Yop_Poll_Model::return_poll_css() should not be called statically, assuming $this from incompatible context in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 2944
[16-May-2014 10:02:46 UTC] PHP Notice: Trying to get property of non-object in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 3713
[16-May-2014 10:02:46 UTC] PHP Notice: Trying to get property of non-object in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 3714
[16-May-2014 10:02:46 UTC] PHP Notice: Undefined variable: log in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 2238
[16-May-2014 10:02:46 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /wp-content/plugins/yop-poll/inc/yop_poll_model.php:3713) in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 3806
[16-May-2014 10:02:46 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /wp-content/plugins/yop-poll/inc/yop_poll_model.php:3713) in /wp-content/plugins/yop-poll/inc/yop_poll_model.php on line 3807
I made the following changes:
admin.php
6974 and 7016: Replaced Yop_Poll_Model::return_template_preview_html with $yop_poll_model->return_template_preview_html
yop_poll_model.php
2944: Replaced self::return_poll_css with $this->return_poll_css
2238: Replaced undefined variable $log with a blank string – obviously this is not ideal.
3713+ (is_ban): Added a check so we only attempt to read the user login and email if this is a logged in user.
With these changes, cookie based blocking appears to work properly, and if the user comes back to the site after having voted, they see the results as intended.