WPIntell

Source evidence

division by zero

DCG Display Plugin Data (from wordpress.org) · support · 2016-08-29T15:22:00+00:00

mixedsentiment
mediumseverity
0.78relevance
12replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Li-An resolved
Hello, 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.

Comments

12 shown
Dipak Gajjar 2016-08-29T16:32:00+00:00

Could you provide short-code you’ve tried to add (and got the above warning) ?

Li-An 2016-08-29T16:57:00+00:00

I’ve put [dcg_display_plugin_data name=’phoenix-media-rename’] You can see it here: https://frama.link/hm74aYqk

Dipak Gajjar 2016-08-29T17:45:00+00:00

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.

Li-An 2016-08-29T17:50:00+00:00

Very strange. As you can see, this is a very basic site. php7 related ?

Li-An 2016-08-29T18:03:00+00:00

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 ?

Li-An 2016-08-29T18:08:00+00:00

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.

Dipak Gajjar 2016-08-29T18:13:00+00:00

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.

Li-An 2016-08-29T18:17:00+00:00

The same 🙁

Dipak Gajjar 2016-08-29T18:20:00+00:00

Please try this updated code: https://wordpress.org/support/topic/division-by-zero-7?replies=9#post-8814106

Li-An 2016-08-29T21:07:00+00:00

The same 🙁

Dipak Gajjar 2016-08-30T11:29:00+00:00

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.

Li-An 2016-08-30T12:24:00+00:00

It looks good. Thanks.