Skip to content

Commit

Permalink
Merge pull request #641 from qrazi/fix/fix_typo_and_messaging
Browse files Browse the repository at this point in the history
Fix a typo and a tooltip message in Diagnostics
  • Loading branch information
bencroker committed Mar 19, 2024
2 parents bcb2ae9 + 191abac commit 09d3c4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/helpers/DiagnosticsHelper.php
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

0 comments on commit 09d3c4b

Please sign in to comment.