Skip to content

Commit

Permalink
chore: use client slug
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvomohajan committed Mar 5, 2024
1 parent 45ee391 commit d60d90c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Telemetry/Report/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
9 changes: 4 additions & 5 deletions src/Telemetry/Report/ReportInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace BitApps\WPTelemetry\Telemetry\Report;

use BitApps\Pi\Config;

class ReportInfo
{
/**
Expand Down Expand Up @@ -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 = [];

Expand All @@ -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;
Expand Down

0 comments on commit d60d90c

Please sign in to comment.