Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable Diagnostics plugin #14304

Closed
mattab opened this issue Apr 2, 2019 · 0 comments · Fixed by #14349
Closed

Allow to disable Diagnostics plugin #14304

mattab opened this issue Apr 2, 2019 · 0 comments · Fixed by #14349
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Apr 2, 2019

Currently the Diagnostics plugin cannot be disabled:

protected $pluginToAlwaysActivate = array(
'CoreHome',
'Diagnostics',
'CoreUpdater',
'CoreAdminHome',
'CoreConsole',

For some reason we need to disable Diagnostics plugin on Matomo Cloud.

-> So we'd like to be able to disable the Diagnostics plugin in Matomo.

If this is not easily possible, then instead we can add a new config ini setting to disable a feature of the plugin in particular (not wanted on Cloud) which displays the UI notice:
image

Done here:

public function onNoData(View $dataTableView)
{
if (!Piwik::isUserHasSomeAdminAccess()) {
return;
}
if (Rules::isBrowserTriggerEnabled()) {
return;
}
$lastSuccessfulRun = CronArchivingLastRunCheck::getTimeSinceLastSuccessfulRun();
if ($lastSuccessfulRun > CronArchivingLastRunCheck::SECONDS_IN_DAY) {
$content = Piwik::translate('Diagnostics_NoDataForReportArchivingNotRun', [
'<a href="https://matomo.org/docs/setup-auto-archiving/" target="_blank" rel="noreferrer noopener">',
'</a>',
]);
$notification = new Notification($content);
$notification->priority = Notification::PRIORITY_HIGH;
$notification->context = Notification::CONTEXT_INFO;
$notification->flags = Notification::FLAG_NO_CLEAR;
$notification->type = Notification::TYPE_TRANSIENT;
$notification->raw = true;
$dataTableView->notifications[self::NO_DATA_ARCHIVING_NOT_RUN_NOTIFICATION_ID] = $notification;
}
}

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Apr 2, 2019
@mattab mattab added this to the 3.10.0 milestone Apr 2, 2019
@katebutler katebutler self-assigned this Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants