finder = $dataFinder; } private function isActivePlugin($pluginName) { return Plugin\Manager::getInstance()->isPluginActivated($pluginName); } public function getChallenges() { /** @var Challenge[] $challenges */ $challenges = array( StaticContainer::get(ChallengeTrackingCode::class), ); if ($this->isActivePlugin('Goals')) { $challenges[] = StaticContainer::get(ChallengeCreatedGoal::class); } $challenges[] = StaticContainer::get(ChallengeCustomLogo::class); if ($this->isActivePlugin('UsersManager') && UsersManager::isUsersAdminEnabled()) { $challenges[] = StaticContainer::get(ChallengeAddedUser::class); } if ($this->isActivePlugin('SitesManager') && SitesManager::isSitesAdminEnabled()) { $challenges[] = StaticContainer::get(ChallengeAddedWebsite::class); } $challenges[] = StaticContainer::get(ChallengeFlattenActions::class); $challenges[] = StaticContainer::get(ChallengeChangeVisualisation::class); if ($this->isActivePlugin('ScheduledReports')) { $challenges[] = StaticContainer::get(ChallengeScheduledReport::class); } if ($this->isActivePlugin('Dashboard')) { $challenges[] = StaticContainer::get(ChallengeCustomiseDashboard::class); } if ($this->isActivePlugin('SegmentEditor')) { $challenges[] = StaticContainer::get(ChallengeAddedSegment::class); } if ($this->isActivePlugin('Annotations')) { $challenges[] = StaticContainer::get(ChallengeAddedAnnotation::class); } if ($this->isActivePlugin('TwoFactorAuth')) { $challenges[] = StaticContainer::get(ChallengeSetupTwoFa::class); } if (Controller::isGeneralSettingsAdminEnabled()) { $challenges[] = StaticContainer::get(ChallengeDisableBrowserArchiving::class); } if (UserCountry::isGeoLocationAdminEnabled()) { $challenges[] = StaticContainer::get(ChallengeConfigureGeolocation::class); } // we're adding this simple challenge only later in the process since there might not be enough data yet in // the beginning to actually get much value from it $challenges[] = StaticContainer::get(ChallengeSelectDateRange::class); if ($this->isActivePlugin('Live')) { $challenges[] = StaticContainer::get(ChallengeViewVisitsLog::class); $challenges[] = StaticContainer::get(ChallengeViewVisitorProfile::class); } $challenges[] = StaticContainer::get(ChallengeViewRowEvolution::class); if ($this->isActivePlugin('Marketplace')) { $challenges[] = StaticContainer::get(ChallengeBrowseMarketplace::class); } /** * Triggered to add new challenges to the "welcome to Matomo tour". * * **Example** * * public function addChallenge(&$challenges) * { * $challenges[] = new MyChallenge(); * } * * @param Challenge[] $challenges An array of challenges */ Piwik::postEvent('Tour.filterChallenges', array(&$challenges)); return $challenges; } }