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

Fix a typo and a tooltip message in Diagnostics #641

Merged
merged 4 commits into from Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/helpers/DiagnosticsHelper.php
bencroker marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -361,7 +361,7 @@ public static function getTests(): array
$tests[] = [
'pass' => $pass,
'message' => $message,
'info' => '<a href="https://craftcms.com/docs/4.x/globals.html" target="">Globals</a> should be avoided, since they are preloaded on every page in your site, unless the <code>refreshCacheAutomaticallyForGlobals</code> config setting is disabled. <a href="https://putyourlightson.com/plugins/blitz#2-avoid-using-globals" target="_blank" class="go">Learn more</a>',
'info' => 'With the <code>refreshCacheWhenElementSavedUnchanged</code> config setting disabled, cached pages are refreshed only when an element is saved and its content changed. This is recommended and should only be enabled with good reason, as it can cause more refresh cache jobs to be created than necessary.',
];

/**
Expand Down Expand Up @@ -400,10 +400,10 @@ public static function getTests(): array
*/
$globalSetCount = GlobalSet::find()->count();
if ($globalSetCount > 0) {
$pass = $settings->refreshCacheAutomaticallyForGlobals;
$pass = (false === $settings->refreshCacheAutomaticallyForGlobals);
if ($pass) {
$message = '<a href="' . UrlHelper::cpUrl('globals') . '">' . Craft::t('blitz', '{num, plural, =1{global exists} other{globals exist}}', ['num' => $globalSetCount]) . '</a> and
<code>refreshCacheAutomaticallyForGlobals</code> is diabled.';
<code>refreshCacheAutomaticallyForGlobals</code> is disabled.';
} else {
$message = '<a href="' . UrlHelper::cpUrl('globals') . '">' . Craft::t('blitz', '{num, plural, =1{global exists} other{globals exist}}', ['num' => $globalSetCount]) . '</a> and
<code>refreshCacheAutomaticallyForGlobals</code> is enabled.';
Expand Down Expand Up @@ -500,9 +500,9 @@ public static function getTests(): array
$now = new DateTime();
$pass = $refreshExpired !== null && $refreshExpired > $now->modify('-24 hours');
if ($pass) {
$message = 'The <code>blitz/cache/refresh-expired</code> console command has not been executed within the past 24 hours.';
} else {
$message = 'The <code>blitz/cache/refresh-expired</code> console command has been executed within the past 24 hours.';
} else {
$message = 'The <code>blitz/cache/refresh-expired</code> console command has not been executed within the past 24 hours.';
}
$tests[] = [
'pass' => $pass,
Expand Down