databaseFileName; } /** * Retrieves the referrals list from the stored file. * * @return array */ public function getList() { $result = []; try { $file = $this->getFilePath(); $referralsList = file_get_contents($file); $referralsList = json_decode($referralsList, true); if (json_last_error() !== JSON_ERROR_NONE) { throw new Exception(esc_html__('Failed to parse the referrals database file.', 'wp-statistics')); } $result = $referralsList; } catch (Exception $e) { WP_Statistics()->log($e->getMessage(), 'error'); $result = []; } return apply_filters('wp_statistics_referrals_list', $result); } }