Hi, we creating ratings that can only be evaluated by user. If no one has yet submitted a rating, the following error message appears:
"Warning: A non-numeric value encountered in /home/boosterr/public_html/wp-content/themes/explicit/functions/reviews.php on line 391"
After the first evaluation, the warning no longer appears.
At the php nothing was changed.
Many thanks in advance.
Where is this warning appearing - on the front-end of your site or in your error log? If it's appearing on the front-end, just turn off wp_debug so it doesn't display it. It's not an error, it's a warning, and thus it doesn't negatively affect anything within your installation.
Hi, what do you mean by wp_debug turn off? Where i can find it?
Yes it will be on the front end of our site.
Attached files: Bildschirmfoto 2018-12-09 um 20.14.41.png
See here: https://docs.whmpress.com/faq/how-to-enable-or-disable-wp_debug-using-file-manager/
The debug is currently set to false.Should I set it to true and then set it to false again?
Attached files: Bildschirmfoto 2018-12-10 um 21.03.44.png
That means error reporting is likely enabled by your server then. Can you ask your web host to turn off error logging on the front-end?
we talked to the hoster. These said the error log could not be turned off or made invisible is not possible
Can you create a test article without a user review so I can look at the link and see if I can get the notice hidden? You can make it a draft post and give me the direct link to the preview (and I'll need to be able to login to your site to see it too). Thanks.
This link is a review post that has not been rated yet.We noticed once the first review was done, the error message disappears
Here is the test link without user review.
OK I've got a fix for you. Edit the functions/reviews.php file within the theme folder and locate line 391 which looks like this:
$amount = $normalized_rating * 3.6;
Change it to this:
$amount = is_numeric($normalized_rating) ? $normalized_rating * 3.6 : 0;
Yes very good. It works, thank you