Conversation
supportHello, I’ve got this error showing: Warning: Division by zero in /www/blog/wp-content/plugins/dcg-display-plugin-data/dcg-display-plugin-data.php on line 41 with this plugin https://wordpress.org/plugins/phoenix-media-rename/ The informations are showing correctly. https://wordpress.org/plugins/dcg-display-plugin-data/
Could you provide short-code you’ve tried to add (and got the above warning) ?
I’ve put [dcg_display_plugin_data name=’phoenix-media-rename’] You can see it here: https://frama.link/hm74aYqk
Sorry! I am unable to replicate the issue. When I’ve added [dcg_display_plugin_data name='phoenix-media-rename'] shortcode, it given (0 out of 5 stars) with no errors/warnings.
Very strange. As you can see, this is a very basic site. php7 related ?
I’ve intalled the plugin on other site I manage on a completely different webhoster and… same error. https://frama.link/wFaVmU3I Could it be related to the thing they are not english sites ?
Line 41 is $calculate_average_rating = ((($stars[0] * 5) + ($stars[1] * 4) + ($stars[2] * 3) + ($stars[3] * 2) + ($stars[4] * 1)) / $decoded_data->num_ratings); so I suspect it’s related to the fact the plugin is not rated for the moment. Can you check this ? I will add a rating to the plugin and see if the error disepear.
Please try this… Open dcg-display-plugin-data.php and update line # 41. if ($decoded_data->num_ratings > 0) $calculate_average_rating = ((($stars[0] * 5) + ($stars[1] * 4) + ($stars[2] * 3) + ($stars[3] * 2) + ($stars[4] * 1)) / $decoded_data->num_ratings); This should do the trick.
The same 🙁
Please try this updated code: https://wordpress.org/support/topic/division-by-zero-7?replies=9#post-8814106
The same 🙁
Try version 1.2 (pre-release) of this plugin from Github and it should fix such kind of issues. https://github.com/dipakcg/dcg-display-plugin-data Let me know how it goes this time.
It looks good. Thanks.
Could you provide short-code you’ve tried to add (and got the above warning) ?
I’ve put [dcg_display_plugin_data name=’phoenix-media-rename’] You can see it here: https://frama.link/hm74aYqk
Sorry! I am unable to replicate the issue. When I’ve added [dcg_display_plugin_data name='phoenix-media-rename'] shortcode, it given (0 out of 5 stars) with no errors/warnings.
Very strange. As you can see, this is a very basic site. php7 related ?
I’ve intalled the plugin on other site I manage on a completely different webhoster and… same error. https://frama.link/wFaVmU3I Could it be related to the thing they are not english sites ?
Line 41 is $calculate_average_rating = ((($stars[0] * 5) + ($stars[1] * 4) + ($stars[2] * 3) + ($stars[3] * 2) + ($stars[4] * 1)) / $decoded_data->num_ratings); so I suspect it’s related to the fact the plugin is not rated for the moment. Can you check this ? I will add a rating to the plugin and see if the error disepear.
Please try this… Open dcg-display-plugin-data.php and update line # 41. if ($decoded_data->num_ratings > 0) $calculate_average_rating = ((($stars[0] * 5) + ($stars[1] * 4) + ($stars[2] * 3) + ($stars[3] * 2) + ($stars[4] * 1)) / $decoded_data->num_ratings); This should do the trick.
The same 🙁
Please try this updated code: https://wordpress.org/support/topic/division-by-zero-7?replies=9#post-8814106
The same 🙁
Try version 1.2 (pre-release) of this plugin from Github and it should fix such kind of issues. https://github.com/dipakcg/dcg-display-plugin-data Let me know how it goes this time.
It looks good. Thanks.