isReferred()) { $data['referred'] = $visitorProfile->getReferrer(); $data['source_channel'] = $visitorProfile->getSource()->getChannel(); $data['source_name'] = $visitorProfile->getSource()->getName(); } } return $data; } /** * Add menu item * * @param array $items * @return array */ public function addMenuItem($items) { $items['referrals'] = [ 'sub' => 'overview', 'title' => esc_html__('Referrals', 'wp-statistics'), 'page_url' => 'referrals', 'callback' => ReferralsPage::class, 'priority' => 27 ]; return $items; } }