/** * Parsing the received counts from the API and map the keys to plugin friendly values * * @param array $fetched_counts * * @return array */ private function parse_counts(array $fetched_counts) { $counts = array(); foreach ($fetched_counts as $platform_name => $categories) { $new_platform = YMBESEO_GSC_Mapper::platform_from_api($platform_name); foreach ($categories as $category_name => $category) { $new_category = YMBESEO_GSC_Mapper::category_from_api($category_name); $counts[$new_platform][$new_category] = $category; } } return $counts; }