@@ -75,8 +75,11 @@ |
||
75 | 75 | </ul><?php endif; ?><?php endforeach; ?><?php endif; ?></div> |
76 | 76 | </details> |
77 | 77 | </td> |
78 | -<?php else: ?> |
|
78 | +<?php else { |
|
79 | + : ?> |
|
79 | 80 | <td> |
80 | 81 | <div class="callout callout-secondary seomatic-callout">not included</div> |
81 | 82 | </td> |
82 | -<?php endif; ?> |
|
83 | +<?php endif; |
|
84 | +} |
|
85 | +?> |
@@ -45,7 +45,10 @@ |
||
45 | 45 | </div> |
46 | 46 | </details> |
47 | 47 | </td> |
48 | -<?php else: ?> |
|
48 | +<?php else { |
|
49 | + : ?> |
|
49 | 50 | <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
50 | 51 | Yii::$app->charset, true) ?></td> |
51 | -<?php endif; ?> |
|
52 | +<?php endif; |
|
53 | +} |
|
54 | +?> |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $query |
242 | 242 | ->setCalendar($metaBundle->sourceHandle) |
243 | 243 | ->setLoadOccurrences(false) |
244 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
245 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
244 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
245 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
246 | 246 | |
247 | 247 | return $query; |
248 | 248 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
406 | 406 | [ |
407 | 407 | 'sourceId' => $sourceModel->id, |
408 | - 'sourceName' => (string)$sourceModel->name, |
|
408 | + 'sourceName' => (string) $sourceModel->name, |
|
409 | 409 | 'sourceHandle' => $sourceModel->handle, |
410 | 410 | ] |
411 | 411 | ); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | ->siteId($metaBundle->sourceSiteId) |
219 | 219 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
220 | 220 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
221 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
221 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | return $query; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
375 | 375 | [ |
376 | 376 | 'sourceId' => $sourceModel->id, |
377 | - 'sourceName' => (string)$sourceModel->name, |
|
377 | + 'sourceName' => (string) $sourceModel->name, |
|
378 | 378 | 'sourceHandle' => $sourceModel->handle, |
379 | 379 | ] |
380 | 380 | ); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | // Set the property |
68 | 68 | $value = $args[0]; |
69 | 69 | if (is_object($value) && $value instanceof Markup) { |
70 | - $value = (string)$value; |
|
70 | + $value = (string) $value; |
|
71 | 71 | } |
72 | 72 | $property->setValue($this, $value); |
73 | 73 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // Add a URL to the schema.org type if this is a MetaJsonLD object |
163 | 163 | if ($isMetaJsonLdModel) { |
164 | 164 | /** @var MetaJsonLd $this */ |
165 | - $extraInfo = ' for http://schema.org/' . $this->type; |
|
165 | + $extraInfo = ' for http://schema.org/'.$this->type; |
|
166 | 166 | } |
167 | 167 | $errorMsg = |
168 | 168 | Craft::t('seomatic', 'Scenario: "') |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | . print_r($this->render(), true); |
174 | 174 | Craft::info($errorMsg, __METHOD__); |
175 | 175 | foreach ($this->errors as $param => $errors) { |
176 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
176 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
177 | 177 | /** @var array $errors */ |
178 | 178 | foreach ($errors as $error) { |
179 | - $errorMsg .= ' -> ' . $error; |
|
179 | + $errorMsg .= ' -> '.$error; |
|
180 | 180 | // Change the error level depending on the error message if this is a MetaJsonLD object |
181 | 181 | if ($isMetaJsonLdModel) { |
182 | 182 | if (strpos($error, 'recommended') !== false) { |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
192 | - Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__); |
|
192 | + Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__); |
|
193 | 193 | // Extra debugging info for MetaJsonLd objects |
194 | 194 | if ($isMetaJsonLdModel) { |
195 | 195 | /** @var MetaJsonLd $className */ |
196 | 196 | $className = get_class($this); |
197 | 197 | if (!empty($className->schemaPropertyDescriptions[$param])) { |
198 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
199 | - $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param]; |
|
198 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
199 | + $errorMsg .= ' -> '.$className->schemaPropertyDescriptions[$param]; |
|
200 | 200 | Craft::info($errorMsg, __METHOD__); |
201 | 201 | } |
202 | 202 | } |
@@ -238,10 +238,10 @@ |
||
238 | 238 | } |
239 | 239 | // Make sure these are strings |
240 | 240 | if (!empty($this->facebookProfileId)) { |
241 | - $this->facebookProfileId = (string)$this->facebookProfileId; |
|
241 | + $this->facebookProfileId = (string) $this->facebookProfileId; |
|
242 | 242 | } |
243 | 243 | if (!empty($this->facebookAppId)) { |
244 | - $this->facebookAppId = (string)$this->facebookAppId; |
|
244 | + $this->facebookAppId = (string) $this->facebookAppId; |
|
245 | 245 | } |
246 | 246 | // Identity |
247 | 247 | if (is_array($this->identity)) { |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | // Constants |
44 | 44 | // ========================================================================= |
45 | 45 | |
46 | - const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
46 | + const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
47 | 47 | |
48 | - const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
48 | + const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
49 | 49 | |
50 | - const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
50 | + const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
51 | 51 | |
52 | 52 | const SEARCH_ENGINE_SUBMISSION_URLS = [ |
53 | 53 | ]; |
@@ -247,19 +247,19 @@ discard block |
||
247 | 247 | $siteId = $groupSiteIds[0]; |
248 | 248 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
249 | 249 | if (!empty($sitemapIndexUrl)) { |
250 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
250 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
251 | 251 | // create new guzzle client |
252 | 252 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
253 | 253 | // Submit the sitemap index to each search engine |
254 | 254 | try { |
255 | 255 | $guzzleClient->post($submissionUrl); |
256 | 256 | Craft::info( |
257 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
257 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
258 | 258 | __METHOD__ |
259 | 259 | ); |
260 | 260 | } catch (\Exception $e) { |
261 | 261 | Craft::error( |
262 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
262 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
263 | 263 | __METHOD__ |
264 | 264 | ); |
265 | 265 | } |
@@ -321,19 +321,19 @@ discard block |
||
321 | 321 | foreach ($searchEngineUrls as &$url) { |
322 | 322 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
323 | 323 | if (!empty($sitemapUrl)) { |
324 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
324 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
325 | 325 | // create new guzzle client |
326 | 326 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
327 | 327 | // Submit the sitemap index to each search engine |
328 | 328 | try { |
329 | 329 | $guzzleClient->post($submissionUrl); |
330 | 330 | Craft::info( |
331 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
331 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
332 | 332 | __METHOD__ |
333 | 333 | ); |
334 | 334 | } catch (\Exception $e) { |
335 | 335 | Craft::error( |
336 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
336 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
337 | 337 | __METHOD__ |
338 | 338 | ); |
339 | 339 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | . '-' |
375 | 375 | . $metaBundle->sourceSiteId |
376 | 376 | . '-sitemap' |
377 | - . (!empty($page) ? '-p' . $page : '') |
|
377 | + . (!empty($page) ? '-p'.$page : '') |
|
378 | 378 | . '.xml', |
379 | 379 | null, |
380 | 380 | null, |
@@ -403,19 +403,19 @@ discard block |
||
403 | 403 | foreach ($searchEngineUrls as &$url) { |
404 | 404 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
405 | 405 | if (!empty($sitemapUrl)) { |
406 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
406 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
407 | 407 | // create new guzzle client |
408 | 408 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
409 | 409 | // Submit the sitemap index to each search engine |
410 | 410 | try { |
411 | 411 | $guzzleClient->post($submissionUrl); |
412 | 412 | Craft::info( |
413 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
413 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
414 | 414 | __METHOD__ |
415 | 415 | ); |
416 | 416 | } catch (\Exception $e) { |
417 | 417 | Craft::error( |
418 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
418 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
419 | 419 | __METHOD__ |
420 | 420 | ); |
421 | 421 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | } |
494 | 494 | |
495 | 495 | foreach ($sites as $site) { |
496 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
496 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | return rtrim($result, PHP_EOL); |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | { |
525 | 525 | // Always just invalidate the sitemap cache now, since we're doing paginated sitemaps |
526 | 526 | $cache = Craft::$app->getCache(); |
527 | - TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
527 | + TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
528 | 528 | Craft::info( |
529 | - 'Sitemap cache cleared: ' . $handle, |
|
529 | + 'Sitemap cache cleared: '.$handle, |
|
530 | 530 | __METHOD__ |
531 | 531 | ); |
532 | 532 | } |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | $cache = Craft::$app->getCache(); |
143 | - $pageCacheSuffix = 's' . (int)$metaBundle->metaSitemapVars->sitemapPageSize . 'p' . $page; |
|
143 | + $pageCacheSuffix = 's'.(int) $metaBundle->metaSitemapVars->sitemapPageSize.'p'.$page; |
|
144 | 144 | |
145 | - $uniqueKey = $groupId . $type . $handle . $siteId . $pageCacheSuffix; |
|
146 | - $cacheKey = self::CACHE_KEY . $uniqueKey; |
|
145 | + $uniqueKey = $groupId.$type.$handle.$siteId.$pageCacheSuffix; |
|
146 | + $cacheKey = self::CACHE_KEY.$uniqueKey; |
|
147 | 147 | $result = $cache->get($cacheKey); |
148 | 148 | |
149 | 149 | // If the sitemap isn't cached, render it immediately |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | $dependency = new TagDependency([ |
161 | 161 | 'tags' => [ |
162 | 162 | self::GLOBAL_SITEMAP_CACHE_TAG, |
163 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
164 | - self::SITEMAP_CACHE_TAG . $handle . $siteId . $pageCacheSuffix, |
|
163 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
164 | + self::SITEMAP_CACHE_TAG.$handle.$siteId.$pageCacheSuffix, |
|
165 | 165 | ], |
166 | 166 | ]); |
167 | 167 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | // Output some info if this is a console app |
175 | 175 | if (Craft::$app instanceof ConsoleApplication) { |
176 | - echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL; |
|
176 | + echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | // If the FastCGI Cache Bust plugin is installed, clear its caches too |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } else { |
189 | 189 | if (Craft::$app instanceof ConsoleApplication) { |
190 | - echo 'Found in cache' . PHP_EOL; |
|
190 | + echo 'Found in cache'.PHP_EOL; |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | public function invalidateCache(string $handle, int $siteId) |
204 | 204 | { |
205 | 205 | $cache = Craft::$app->getCache(); |
206 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
206 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
207 | 207 | Craft::info( |
208 | - 'Sitemap cache cleared: ' . $handle, |
|
208 | + 'Sitemap cache cleared: '.$handle, |
|
209 | 209 | __METHOD__ |
210 | 210 | ); |
211 | 211 | } |