diff --git a/src/Telemetry/Report/Report.php b/src/Telemetry/Report/Report.php index 2037384..30d4506 100644 --- a/src/Telemetry/Report/Report.php +++ b/src/Telemetry/Report/Report.php @@ -215,7 +215,7 @@ public function getTrackingData() ]; if ($this->addPluginData) { - $data['plugins'] = $reportInfo->getPluginInfo($allPlugins['activePlugins']); + $data['plugins'] = $reportInfo->getPluginInfo($allPlugins['activePlugins'], $this->client->slug); } if (\is_array($this->extraInfo) && !empty($this->extraInfo)) { diff --git a/src/Telemetry/Report/ReportInfo.php b/src/Telemetry/Report/ReportInfo.php index 6f83700..142693a 100644 --- a/src/Telemetry/Report/ReportInfo.php +++ b/src/Telemetry/Report/ReportInfo.php @@ -2,8 +2,6 @@ namespace BitApps\WPTelemetry\Telemetry\Report; -use BitApps\Pi\Config; - class ReportInfo { /** @@ -212,10 +210,11 @@ public function getAllPlugins() * Get plugin info * * @param mixed $activePlugins + * @param string $slug * * @return array */ - public function getPluginInfo($activePlugins) + public function getPluginInfo($activePlugins, $slug) { $pluginInfo = []; @@ -232,8 +231,8 @@ public function getPluginInfo($activePlugins) ]; } - if (\array_key_exists(Config::SLUG, $pluginInfo)) { - unset($pluginInfo[Config::SLUG]); + if (\array_key_exists($slug, $pluginInfo)) { + unset($pluginInfo[$slug]); } return $pluginInfo;