Could you provide short-code you’ve tried to add (and got the above warning)?
Thread Starter
Li-An
(@li-an)
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.
Thread Starter
Li-An
(@li-an)
Very strange. As you can see, this is a very basic site. php7 related ?
Thread Starter
Li-An
(@li-an)
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 ?
Thread Starter
Li-An
(@li-an)
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.
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.