# metricool/2.1.1/app/Features/AdminNotices/Notices/UpgradeNotice.php

Metricool – Social media and site statistics, version 2.1.1. 76 lines.

- Page: https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Features/AdminNotices/Notices/UpgradeNotice.php
- Raw: https://pluginprobe.com/plugins/metricool/2.1.1/raw/app/Features/AdminNotices/Notices/UpgradeNotice.php
- Modified: 2026-08-20T14:08:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Features/AdminNotices/Notices/UpgradeNotice.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Metricool\Features\AdminNotices\Notices;

use Metricool\Features\AdminNotices\AbstractAdminNotice;
use Metricool\Services\DashboardService;
use Metricool\Support\Helpers\Storages\EnvironmentConfig;
use Metricool\Traits\HasAllowlistControl;

final class UpgradeNotice extends AbstractAdminNotice
{
    use HasAllowlistControl;

    public const IDENTIFIER = 'upgrade';

    private DashboardService $dashboard;

    public function __construct(EnvironmentConfig $env, DashboardService $dashboard)
    {
        parent::__construct($env);

        $this->dashboard = $dashboard;
    }

    /**
     * @inheritDoc
     */
    protected function canDisplay(): bool
    {
        return $this->dashboard->isUserOnDashboard() === false &&
            $this->dashboard->isForcedLogin();
    }

    /**
     * @inheritDoc
     */
    public function isSnoozable(): bool
    {
        return false;
    }

    /**
     * @inheritDoc
     */
    public function getCtaUrl(): string
    {
        return $this->env->getUrl('plugin.dashboard_url');
    }

    /**
     * @inheritDoc
     */
    public function getCtaLabel(): string
    {
        return __('Sign in now!', 'metricool');
    }

    /**
     * @inheritDoc
     */
    protected function getContentView(): string
    {
        return 'admin/notices/upgrade-notice';
    }

    /**
     * @inheritDoc
     */
    protected function getContentVariables(): array
    {
        return [];
    }
}

```
