at path:
ROOT
/
wp-content
/
plugins
/
woocommerce
/
src
/
Internal
/
McStats.php
run:
R
W
Run
Abilities
DIR
2026-04-15 05:42:46
R
W
Run
AbilitiesApi
DIR
2026-04-15 05:42:46
R
W
Run
AddressProvider
DIR
2026-04-15 05:42:46
R
W
Run
Admin
DIR
2026-04-15 05:42:47
R
W
Run
Agentic
DIR
2026-04-15 05:42:38
R
W
Run
BatchProcessing
DIR
2026-04-15 05:42:47
R
W
Run
CLI
DIR
2026-04-15 05:42:38
R
W
Run
Caches
DIR
2026-04-15 05:42:47
R
W
Run
ComingSoon
DIR
2026-04-15 05:42:47
R
W
Run
CostOfGoodsSold
DIR
2026-04-15 05:42:47
R
W
Run
Customers
DIR
2026-04-15 05:42:47
R
W
Run
DataStores
DIR
2026-04-15 05:42:47
R
W
Run
DependencyManagement
DIR
2026-04-15 05:42:47
R
W
Run
Email
DIR
2026-04-15 05:42:47
R
W
Run
EmailEditor
DIR
2026-04-15 05:42:47
R
W
Run
Features
DIR
2026-04-15 05:42:47
R
W
Run
Integrations
DIR
2026-04-15 05:42:47
R
W
Run
Jetpack
DIR
2026-04-15 05:42:47
R
W
Run
Logging
DIR
2026-04-15 05:42:47
R
W
Run
MCP
DIR
2026-04-15 05:42:47
R
W
Run
Orders
DIR
2026-04-15 05:42:47
R
W
Run
ProductAttributesLookup
DIR
2026-04-15 05:42:47
R
W
Run
ProductDownloads
DIR
2026-04-15 05:42:38
R
W
Run
ProductFeed
DIR
2026-04-15 05:42:47
R
W
Run
ProductFilters
DIR
2026-04-15 05:42:47
R
W
Run
ProductImage
DIR
2026-04-15 05:42:47
R
W
Run
PushNotifications
DIR
2026-04-15 05:42:47
R
W
Run
ReceiptRendering
DIR
2026-04-15 05:42:47
R
W
Run
RestApi
DIR
2026-04-15 05:42:38
R
W
Run
Settings
DIR
2026-04-15 05:42:47
R
W
Run
StockNotifications
DIR
2026-04-15 05:42:47
R
W
Run
Traits
DIR
2026-04-15 05:42:47
R
W
Run
TransientFiles
DIR
2026-04-15 05:42:47
R
W
Run
Utilities
DIR
2026-04-15 05:42:47
R
W
Run
WCCom
DIR
2026-04-15 05:42:47
R
W
Run
AssignDefaultCategory.php
1.95 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
Brands.php
1.27 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
DownloadPermissionsAdjuster.php
6.52 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
McStats.php
2.1 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
OrderCouponDataMigrator.php
8.33 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
RegisterHooksInterface.php
504 By
2026-04-15 05:42:47
R
W
Run
Delete
Rename
RestApiControllerBase.php
8.01 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
RestApiParameterUtil.php
5.72 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
RestockRefundedItemsAdjuster.php
2.08 KB
2026-04-15 05:42:47
R
W
Run
Delete
Rename
error_log
up
📄
McStats.php
Save
<?php /** * WooCommerce MC Stats package */ declare( strict_types = 1 ); namespace Automattic\WooCommerce\Internal; use Automattic\Jetpack\A8c_Mc_Stats; /** * Class MC Stats, used to record internal usage stats for Automattic. * * This class is a wrapper around the Jetpack MC Stats package. * See https://github.com/Automattic/jetpack-a8c-mc-stats/tree/trunk for more details. */ class McStats extends A8c_Mc_Stats { /** * Return the stats from a group in an array ready to be added as parameters in a query string * * Jetpack MC Stats package prefixes group names with "x_jetpack-" so we override this method to prefix group names with "x_woocommerce-". * * @param string $group_name The name of the group to retrieve. * @return array Array with one item, where the key is the prefixed group and the value are all stats concatenated with a comma. If group not found, an empty array will be returned */ public function get_group_query_args( $group_name ) { $stats = $this->get_current_stats(); if ( isset( $stats[ $group_name ] ) && ! empty( $stats[ $group_name ] ) ) { return array( "x_woocommerce-{$group_name}" => implode( ',', $stats[ $group_name ] ) ); } return array(); } /** * Outputs the tracking pixels for the current stats and empty the stored stats from the object * * @return void */ public function do_stats() { if ( ! \WC_Site_Tracking::is_tracking_enabled() ) { return; } parent::do_stats(); } /** * Runs stats code for a one-off, server-side. * * @param string $url string The URL to be pinged. Should include `x_woocommerce-{$group}={$stats}` or whatever we want to store. * * @return bool If it worked. */ public function do_server_side_stat( $url ) { if ( ! \WC_Site_Tracking::is_tracking_enabled() ) { return false; } return parent::do_server_side_stat( $url ); } /** * Pings the stats server for the current stats and empty the stored stats from the object * * @return void */ public function do_server_side_stats() { if ( ! \WC_Site_Tracking::is_tracking_enabled() ) { return; } parent::do_server_side_stats(); } }