Closed barisunver closed 9 years ago
BTW, any plans on putting a "Sweep All" button?
+1 on the sweep all button!
Thanks @barisunver, I will fix it on monday! yea it was a copy and paste coding to get the job done. Only after that I will refactor :p
I have plans on Sweep All and cron job. My concern for sweep off is that I afraid it might timeout because the process is quite heavy unless I switched it to AJAX based.
I was about to open a new issue regarding this matter. Please update the latest version on WordPress.org :)
Warning: Division by zero in /home/***/public_html/wp-content/plugins/wp-sweep/admin.php on line 184
I use Disqus in my blog, so I don't keep comments in my database. Naturally, when WP-Sweep uses the code below:
<?php echo round( ( $deleted_comments/$total_comments ) * 100, 2 ); ?>
It returns a warning of "division by zero". This is of course, one of the five lines of code that checks the comments table.
The code below works better:
<?php echo ( $total_comments > 0 ? round( ( $deleted_comments / $total_comments ) * 100, 2 ) : 0 ); ?>%
But I suggest you use a simple function that you can use anywhere to make the code cleaner: