All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: [WP-Poll] Minor Bug Report + Fix Suggestion  (Read 421 times)

0 Members and 1 Guest are viewing this topic.

Offline Dazmogan

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: own
[WP-Poll] Minor Bug Report + Fix Suggestion
« on: 26 January 2010, 10:49 »
Hi,

the way you calc the result percentages works in most cases but there are cases where a result ends up with -1% which looks quite buggy. Example:

3 Votes (0.38 -> 38%)
2 Votes (0.25 -> 25%)
2 Votes (0.25 -> 25%)
1 Vote (0.125 -> 13%) --> ugh, 38+25+25+13 = 101
0 Votes --> -1% due to the following line

// wp-polls.php l.635
$percentage_error_buffer = 100 - array_sum($poll_answer_percentage_array);

Quick Fix:
// wp-polls.php after l.638
if ($poll_answer_percentage < 0) {
   $poll_answer_percentage = 0;
}

Sum is still 101% but no one will notice. Much better than having a negative number.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: [WP-Poll] Minor Bug Report + Fix Suggestion
« Reply #1 on: 26 January 2010, 14:04 »
« Last Edit: 26 January 2010, 14:37 by GaMerZ »

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline mmtux

  • Newbie
  • *
  • Posts: 2
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: plainscape
Re: [WP-Poll] Minor Bug Report + Fix Suggestion
« Reply #2 on: 04 February 2010, 15:42 »
In my blog i have a sum of 176 % in a poll which is a little bit too much ;) Multi answers were allowed. I don't know whats going wrong, I would be very happy if you could fix it. Link to the blog post: http://www.dreambox-blog.com/index.php/2785/720p-vs-1080i-was-ist-das-bessere-hd-umfrage-8

Thanks :)

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: [WP-Poll] Minor Bug Report + Fix Suggestion
« Reply #3 on: 05 February 2010, 00:21 »
Download the dev version http://downloads.wordpress.org/plugin/wp-polls.zip it should fix it

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline mmtux

  • Newbie
  • *
  • Posts: 2
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: plainscape
Re: [WP-Poll] Minor Bug Report + Fix Suggestion
« Reply #4 on: 06 February 2010, 20:04 »
should it fix already closed polls, too?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: [WP-Poll] Minor Bug Report + Fix Suggestion
« Reply #5 on: 07 February 2010, 16:56 »
You mean Poll Archive? I just fixed it. Re-download the zip file.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.