PATH:
home
/
niazsaze
/
public_html
/
wp-content
/
plugins
/
wp-statistics
/
includes
<?php namespace WP_STATISTICS; use WP_Statistics\Service\Analytics\Referrals\ReferralsDatabase; class SearchEngine { /** * Default error not founding search engine * * @var string */ public static $error_found = 'No search query found!'; /** * Get base assets url search engine logo * * @return string */ public static function Asset() { return WP_STATISTICS_URL . 'assets/images/search-engine/'; } /** * Get List Of Search engine in WP Statistics * * @deprecated This function is deprecated. use ReferralsDatabase::getList() * @param bool $all * @return array */ public static function getList($all = false) { $referralsDatabase = new ReferralsDatabase(); $referralsDatabase = $referralsDatabase->getList(); $searchEngines = array_filter($referralsDatabase, function ($sourceChannel) { return $sourceChannel['type'] === 'search' && count($sourceChannel['channels']) > 1; }); $searchEngines = reset($searchEngines); $engines = []; foreach ($searchEngines['channels'] as $searchEngine) { $engines[$searchEngine['identifier']] = [ 'name' => $searchEngine['name'], 'translated' => $searchEngine['name'], 'logo_url' => self::Asset() . $searchEngine['identifier'] . '.png', 'tag' => $searchEngine['identifier'] ]; } return apply_filters('wp_statistics_search_engine_list', $engines); } /** * Return Default Value if Search Engine Not Exist * * @return array */ public static function default_engine() { return array( 'name' => _x('Unknown', 'Search Engine', 'wp-statistics'), 'tag' => '', 'sqlpattern' => '', 'regexpattern' => '', 'querykey' => 'q', 'image' => 'unknown.png', 'logo_url' => self::Asset() . 'unknown.png' ); } /** * Get Information About Custom Search Engine * * @param bool|false $engine * @return array|bool */ public static function get($engine = false) { // If there is no URL and no referrer, always return false. if ($engine == false) { return false; } // Get the list of search engines $search_engines = self::getList(); // Search Key in List if (array_key_exists($engine, $search_engines)) { return $search_engines[$engine]; } // If no SE matched, return some defaults. return self::default_engine(); } }
[-] class-wp-statistics-geoip.php
[edit]
[-] defines.php
[edit]
[-] class-wp-statistics-privacy-exporter.php
[edit]
[-] template-functions.php
[edit]
[-] class-wp-statistics-helper.php
[edit]
[-] class-wp-statistics-rest-api.php
[edit]
[-] class-wp-statistics-search-engine.php
[edit]
[-] class-wp-statistics-schedule.php
[edit]
[-] class-wp-statistics-purge.php
[edit]
[-] class-wp-statistics-timezone.php
[edit]
[-] class-wp-statistics-shortcode.php
[edit]
[-] class-wp-statistics.php
[edit]
[-] class-wp-statistics-option.php
[edit]
[+]
api
[-] class-wp-statistics-user.php
[edit]
[-] class-wp-statistics-pages.php
[edit]
[-] class-wp-statistics-mail.php
[edit]
[-] class-wp-statistics-install.php
[edit]
[-] class-wp-statistics-meta-box.php
[edit]
[-] class-wp-statistics-uninstall.php
[edit]
[+]
defines
[-] class-wp-statistics-frontend.php
[edit]
[-] class-wp-statistics-historical.php
[edit]
[-] class-wp-statistics-user-online.php
[edit]
[-] class-wp-statistics-country.php
[edit]
[-] class-wp-statistics-db.php
[edit]
[-] class-wp-statistics-admin-bar.php
[edit]
[-] class-wp-statistics-referred.php
[edit]
[-] class-wp-statistics-privacy-erasers.php
[edit]
[-] class-wp-statistics-user-agent.php
[edit]
[-] class-wp-statistics-hits.php
[edit]
[+]
libraries
[-] class-wp-statistics-menus.php
[edit]
[+]
admin
[+]
..
[-] class-wp-statistics-ip.php
[edit]
[-] class-wp-statistics-exclusion.php
[edit]
[-] class-wp-statistics-widget.php
[edit]
[-] class-wp-statistics-visitor.php
[edit]