I'm asking for your help to develop a system average. I have a website video games and I created a function that automatically calculates the average for each review. It works very well. The problem is that I would like to display in my sidebar Rated 5 games. Unfortunately, I can not ask WP to calculate and compare each mean. It will take a lot of time. So I'd like to do is calculated at the publication of the review in the admin to save automatically mean a meta. I do not know anything about the possibility in the administration. Is it possible? If yes, how? thank you
/* RATE */
function get_rate_overall($rate=bool){
$graphics = get_field('graphics');
$gameplay = get_field('game-play');
$life = get_field('life');
$sound = get_field('sound');
$overall = $graphics + $gameplay + $life + $sound;
$overall = $overall / 4;
if (is_float($overall)) { $overall = number_format($overall,1); }
if ($rate == true) { echo $overall.'/10'; }
if ($rate == false) { echo $overall; }
}