optimized the code for calculating location stats (from admin and cron)
Merge branch 'locstats' into hotfixes