@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $cache = Craft::$app->getCache(); |
| 151 | - $uniqueKey = $groupId . $type . $handle . $siteId; |
|
| 152 | - $cacheKey = self::CACHE_KEY . $uniqueKey; |
|
| 153 | - $queueJobCacheKey = self::QUEUE_JOB_CACHE_KEY . $uniqueKey; |
|
| 151 | + $uniqueKey = $groupId.$type.$handle.$siteId; |
|
| 152 | + $cacheKey = self::CACHE_KEY.$uniqueKey; |
|
| 153 | + $queueJobCacheKey = self::QUEUE_JOB_CACHE_KEY.$uniqueKey; |
|
| 154 | 154 | $result = $cache->get($cacheKey); |
| 155 | 155 | // If the sitemap isn't cached, start a job to create it |
| 156 | 156 | // Even if it is cached, if $throwException === false we should regenerate it, as it is part of |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $dependency = new TagDependency([ |
| 190 | 190 | 'tags' => [ |
| 191 | 191 | self::GLOBAL_SITEMAP_CACHE_TAG, |
| 192 | - self::CACHE_KEY . $uniqueKey, |
|
| 192 | + self::CACHE_KEY.$uniqueKey, |
|
| 193 | 193 | ], |
| 194 | 194 | ]); |
| 195 | 195 | $cache->set($queueJobCacheKey, $jobId, $cacheDuration, $dependency); |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | // Return an empty XML document |
| 222 | 222 | $lines[] = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 223 | 223 | $lines[] = '<?xml-stylesheet type="text/xsl" href="sitemap-empty.xsl"?>'; |
| 224 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'This sitemap has not been generated yet.') . ' -->'; |
|
| 225 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'If you are seeing this in local dev or an') . ' -->'; |
|
| 226 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'environment with `devMode` on, caches only') . ' -->'; |
|
| 227 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'last for 30 seconds in local dev, so it is') . ' -->'; |
|
| 228 | - $lines[] = '<!-- ' . Craft::t('seomatic', 'normal for the sitemap to not be cached.') . ' -->'; |
|
| 224 | + $lines[] = '<!-- '.Craft::t('seomatic', 'This sitemap has not been generated yet.').' -->'; |
|
| 225 | + $lines[] = '<!-- '.Craft::t('seomatic', 'If you are seeing this in local dev or an').' -->'; |
|
| 226 | + $lines[] = '<!-- '.Craft::t('seomatic', 'environment with `devMode` on, caches only').' -->'; |
|
| 227 | + $lines[] = '<!-- '.Craft::t('seomatic', 'last for 30 seconds in local dev, so it is').' -->'; |
|
| 228 | + $lines[] = '<!-- '.Craft::t('seomatic', 'normal for the sitemap to not be cached.').' -->'; |
|
| 229 | 229 | $lines[] = '<urlset>'; |
| 230 | 230 | $lines[] = '</urlset>'; |
| 231 | 231 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | public function invalidateCache(string $handle, int $siteId) |
| 247 | 247 | { |
| 248 | 248 | $cache = Craft::$app->getCache(); |
| 249 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 249 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 250 | 250 | Craft::info( |
| 251 | - 'Sitemap cache cleared: ' . $handle, |
|
| 251 | + 'Sitemap cache cleared: '.$handle, |
|
| 252 | 252 | __METHOD__ |
| 253 | 253 | ); |
| 254 | 254 | } |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | // Craft adds the `tokenParam` URL param back in via UrlHelper, strip it again |
| 101 | 101 | if (Seomatic::$plugin->metaContainers->paginationPage === '1') { |
| 102 | 102 | $token = Craft::$app->getConfig()->getGeneral()->tokenParam; |
| 103 | - $url = preg_replace('~([?&])' . $token . '=[^&]*~', '$1', $url); |
|
| 103 | + $url = preg_replace('~([?&])'.$token.'=[^&]*~', '$1', $url); |
|
| 104 | 104 | $url = rtrim($url, '?&'); |
| 105 | 105 | $url = str_replace(['&&', '?&'], ['&', '?'], $url); |
| 106 | 106 | $data['href'] = $url; |
@@ -265,7 +265,7 @@ |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if (empty($html) && !empty($this->templatePath)) { |
| 268 | - $html = '/* ' . $this->name . Craft::t('seomatic', ' script did not render') . ' */' . PHP_EOL; |
|
| 268 | + $html = '/* '.$this->name.Craft::t('seomatic', ' script did not render').' */'.PHP_EOL; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | return $html; |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [ |
|
| 22 | + MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'Meta Title Tag', |
| 25 | 25 | 'handle' => TitleService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaTitleContainer::class, |
|
| 26 | + 'class' => (string) MetaTitleContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [ |
|
| 22 | + MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'JsonLd Tags', |
| 25 | 25 | 'handle' => JsonLdService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaJsonLdContainer::class, |
|
| 26 | + 'class' => (string) MetaJsonLdContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [ |
|
| 22 | + MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'Meta Title Tag', |
| 25 | 25 | 'handle' => TitleService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaTitleContainer::class, |
|
| 26 | + 'class' => (string) MetaTitleContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [ |
|
| 22 | + MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'JsonLd Tags', |
| 25 | 25 | 'handle' => JsonLdService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaJsonLdContainer::class, |
|
| 26 | + 'class' => (string) MetaJsonLdContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [ |
|
| 22 | + MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'Meta Title Tag', |
| 25 | 25 | 'handle' => TitleService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaTitleContainer::class, |
|
| 26 | + 'class' => (string) MetaTitleContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [ |
|
| 22 | + MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'JsonLd Tags', |
| 25 | 25 | 'handle' => JsonLdService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaJsonLdContainer::class, |
|
| 26 | + 'class' => (string) MetaJsonLdContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |