Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ public function __construct(

public function collect(HealthCollection $collection): void
{
if ($this->adminWorkerEnabled) {
$collection->add(
SettingsResult::warning(
'admin-watcher',
'Admin-Worker',
'enabled',
'disabled',
'https://developer.shopware.com/docs/guides/plugins/plugins/framework/message-queue/add-message-handler#the-admin-worker',
),
);
}
$collection->add(
SettingsResult::create(
$this->adminWorkerEnabled ? 'warning' : 'ok',
'admin-watcher',
'Admin-Worker',
$this->adminWorkerEnabled ? 'enabled' : 'disabled',
'disabled',
'https://developer.shopware.com/docs/guides/plugins/plugins/framework/message-queue/add-message-handler#the-admin-worker',
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ private function checkCompression(HealthCollection $collection, string $function
return;
}

$id = strtolower($functionality) . '-compression-method';
$snippet = $functionality . ' compression method';

if ($method === 'gzip') {
$collection->add(
SettingsResult::info(
strtolower($functionality) . '-compression-method',
$functionality . ' compression method',
SettingsResult::create(
'info',
$id,
$snippet,
'gzip',
'zstd',
self::DOCUMENTATION_URL,
Expand All @@ -55,12 +59,15 @@ private function checkCompression(HealthCollection $collection, string $function
return;
}

if ($method === 'zstd' && !\extension_loaded('zstd')) {
if ($method === 'zstd') {
$extensionLoaded = \extension_loaded('zstd');

$collection->add(
SettingsResult::error(
strtolower($functionality) . '-compression-method-extension-zstd',
'PHP extension zstd for ' . $functionality . ' compression method',
'disabled',
SettingsResult::create(
$extensionLoaded ? 'ok' : 'error',
$id . '-extension-zstd',
'PHP extension zstd for ' . $snippet,
$extensionLoaded ? 'enabled' : 'disabled',
'enabled',
self::DOCUMENTATION_URL,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ class DisableAppUrlExternalCheckChecker implements PerformanceCheckerInterface,
public function collect(HealthCollection $collection): void
{
$appUrlCheckDisabled = (bool) EnvironmentHelper::getVariable('APP_URL_CHECK_DISABLED', false);
if (!$appUrlCheckDisabled) {
$collection->add(
SettingsResult::warning(
'app-url-check-disabled',
'App URL external check',
'enabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-app-url-external-check',
),
);
}
$collection->add(
SettingsResult::create(
!$appUrlCheckDisabled ? 'warning' : 'ok',
'app-url-check-disabled',
'App URL external check',
!$appUrlCheckDisabled ? 'enabled' : 'disabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-app-url-external-check',
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ public function __construct(

public function collect(HealthCollection $collection): void
{
if ($this->vault) {
$collection->add(
SettingsResult::info(
'symfony-secrets',
'Disable Symfony Secrets',
'enabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-symfony-secrets',
),
);
}
$collection->add(
SettingsResult::create(
$this->vault ? 'info' : 'ok',
'symfony-secrets',
'Disable Symfony Secrets',
$this->vault ? 'enabled' : 'disabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-symfony-secrets',
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ public function collect(HealthCollection $collection): void

$setting = $this->params->get('shopware.mail.update_mail_variables_on_send');

if (!$setting) {
return;
}

$result = SettingsResult::warning('mail_variables', 'MailVariables updates', 'enabled', 'disabled');

$result->url = 'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#prevent-mail-data-updates';
$collection->add($result);
$collection->add(
SettingsResult::create(
!$setting ? 'ok' : 'warning',
'mail_variables',
'MailVariables updates',
$setting ? 'enabled' : 'disabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#prevent-mail-data-updates'
)
);
}
}
21 changes: 10 additions & 11 deletions src/Components/Health/Checker/PerformanceChecker/EsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ public function __construct(ElasticsearchManager $elasticsearchManager)

public function collect(HealthCollection $collection): void
{
if (!$this->esEnabled) {
$collection->add(
SettingsResult::info(
'elasticsearch',
'Elasticsearch',
'disabled',
'enabled',
'https://developer.shopware.com/docs/guides/hosting/infrastructure/elasticsearch/elasticsearch-setup',
),
);
}
$collection->add(
SettingsResult::create(
!$this->esEnabled ? 'info' : 'ok',
'elasticsearch',
'Elasticsearch',
!$this->esEnabled ? 'disabled' : 'enabled',
'enabled',
'https://developer.shopware.com/docs/guides/hosting/infrastructure/elasticsearch/elasticsearch-setup',
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,16 @@ public function collect(HealthCollection $collection): void
if (\version_compare($this->shopwareVersion, '6.7.0.0', '>=')) {
return;
}

if ($this->cacheTaggingEachConfig || $this->cacheTaggingEachSnippet || $this->cacheTaggingEachThemeConfig) {
$collection->add(
// only info, because it only affects redis, varnish etc.
SettingsResult::info(
'fine-grained-caching',
'Fine-grained caching on Redis, Varnish etc.',
'enabled',
'disabled',
self::DOCUMENTATION_URL,
),
);
}
$collection->add(
// only info, because it only affects redis, varnish etc.
SettingsResult::create(
$this->cacheTaggingEachConfig || $this->cacheTaggingEachSnippet || $this->cacheTaggingEachThemeConfig ? 'info' : 'ok',
'fine-grained-caching',
'Fine-grained caching on Redis, Varnish etc.',
'enabled',
'disabled',
self::DOCUMENTATION_URL,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ public function collect(HealthCollection $collection): void

$cacheId = (string) EnvironmentHelper::getVariable('SHOPWARE_CACHE_ID', '');

if ($cacheId === '') {
$collection->add(
SettingsResult::warning(
'cache-id',
'Fixed cache id',
'not set',
'set',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#cache-id',
),
);
}
$collection->add(
SettingsResult::create(
$cacheId ? 'warning' : 'ok',
'cache-id',
'Fixed cache id',
'not set',
'set',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#cache-id',
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ public function collect(HealthCollection $collection): void
{
$recommended = 'array or redis';

if ($this->userActivity === 'mysql' || $this->queueActivity === 'mysql') {
$collection->add(
SettingsResult::warning(
'increment-storage',
'Increment storage',
'mysql',
$recommended,
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#increment-storage',
),
);
}
$collection->add(
SettingsResult::create(
$this->userActivity === 'mysql' || $this->queueActivity === 'mysql' ? 'warning' : 'ok',
'increment-storage',
'Increment storage',
$this->userActivity === 'mysql' || $this->queueActivity === 'mysql' ? 'mysql' : 'array or redis',
$recommended,
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#increment-storage',
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ public function __construct(

public function collect(HealthCollection $collection): void
{
if ($this->businessEventHandlerLevel->isLowerThan(Level::Warning)) {
$collection->add(SettingsResult::warning(
$collection->add(
SettingsResult::create(
$this->businessEventHandlerLevel->isLowerThan(Level::Warning) ? 'warning' : 'ok',
'business_logger',
'BusinessEventHandler logging',
Logger::toMonologLevel($this->businessEventHandlerLevel)->getName(),
'min WARNING',
$this->url,
));
}
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ public function __construct(

public function collect(HealthCollection $collection): void
{
if (!$this->mailerIsOverQueue) {
$collection->add(
SettingsResult::warning(
'mail',
'Sending mails over queue',
'disabled',
'enabled',
'https://developer.shopware.com/docs/guides/hosting/infrastructure/message-queue#sending-mails-over-the-message-queue',
),
);
}
$collection->add(
SettingsResult::create(
!$this->mailerIsOverQueue ? 'warning' : 'ok',
'mail',
'Sending mails over queue',
$this->mailerIsOverQueue ? 'enabled' : 'disabled',
'enabled',
'https://developer.shopware.com/docs/guides/hosting/infrastructure/message-queue#sending-mails-over-the-message-queue',
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ public function __construct(

public function collect(HealthCollection $collection): void
{
if ($this->isAutoSetupEnabled($this->messageTransportDsn) || $this->isAutoSetupEnabled($this->messageTransportDsnLowPriority) || $this->isAutoSetupEnabled($this->messageTransportDsnFailure)) {
$collection->add(
SettingsResult::info(
'messenger-auto-setup',
'Messenger auto_setup',
'enabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-auto-setup',
),
);
}
$autoSetupState = $this->isAutoSetupEnabled($this->messageTransportDsn) || $this->isAutoSetupEnabled($this->messageTransportDsnLowPriority) || $this->isAutoSetupEnabled($this->messageTransportDsnFailure);

$collection->add(
SettingsResult::create(
$autoSetupState ? 'info' : 'ok',
'messenger-auto-setup',
'Messenger auto_setup',
'enabled',
'disabled',
'https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks.html#disable-auto-setup',
),
);
}

private function isAutoSetupEnabled(string $messageTransportDsn): bool
Expand Down
Loading