diff --git a/CHANGELOG.md b/CHANGELOG.md index fc55ddaa..681461ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes for Blitz +## 4.18.2 - Unreleased + +### Fixed + +- Fixed a bug in which modules that were not bootstrapped were throwing an error when generating a report in the Blitz Diagnostics utility ([#668](https://github.com/putyourlightson/craft-blitz/issues/668)). + ## 4.18.1 - 2024-05-16 ### Added diff --git a/composer.json b/composer.json index 563cd028..ea490bbb 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "putyourlightson/craft-blitz", "description": "Intelligent static page caching for creating lightning-fast sites.", - "version": "4.18.1", + "version": "4.18.2", "type": "craft-plugin", "homepage": "https://putyourlightson.com/plugins/blitz", "license": "proprietary", diff --git a/src/templates/_utilities/diagnostics/_includes/report.twig b/src/templates/_utilities/diagnostics/_includes/report.twig index 00bf4e15..08aad31b 100644 --- a/src/templates/_utilities/diagnostics/_includes/report.twig +++ b/src/templates/_utilities/diagnostics/_includes/report.twig @@ -7,18 +7,19 @@ #### Installed Plugins {# @var plugin \craft\base\Plugin #} -{% for plugin in craft.app.plugins.allPlugins %} -- {{ plugin.name }}: {{ plugin.version }} +{% for plugin in craft.app.plugins.allPlugins -%} + - {{ plugin.name }}: {{ plugin.version }} {% endfor %} #### Loaded Modules {# @var module \yii\base\Module #} -{% for module in craft.app.modules %} -{% if module is not instance of('\\craft\\base\\Plugin') %} -- {{ module.id }}: {{ className(module) }} -{% endif %} -{% endfor %} +{% for module in craft.app.modules(true) -%} + {% if module is not instance of('\\craft\\base\\Plugin') -%} + - {{ module.id }}: {{ className(module) }} + {{- '\n' -}} + {% endif %} +{%- endfor %} #### Blitz Plugin Settings @@ -28,24 +29,36 @@ #### Recommendations -{% for test in craft.blitz.diagnostics.getTests() %} -- {{ test.pass ? '✅' : '❌' }} {{ test.message|striptags }} -{% endfor -%} - -{%- for siteId in craft.app.sites.getAllSiteIds|sort %} - -#### Site Tracking {{ craft.app.isMultiSite ? '[#' ~ siteId ~ ']' }} - -- Tracked Pages: {{ craft.blitz.diagnostics.getPagesCount(siteId) }} -- Tracked Includes: {{ craft.blitz.diagnostics.getIncludesCount(siteId) }} -- Tracked Query String Params: {{ craft.blitz.diagnostics.getParamsCount(siteId) }} -- Tracked Elements: {{ craft.blitz.diagnostics.getElementsCount(siteId) }} -{% for elementType in craft.blitz.diagnostics.getElementTypes(siteId) %} - - {{ elementType.type }}: {{ elementType.count|number }} -{% endfor -%} -- Tracked Element Queries: {{ craft.blitz.diagnostics.getElementQueriesCount(siteId) }} -{% for elementQueryType in craft.blitz.diagnostics.getElementQueryTypes(siteId) %} - - {{ elementQueryType.type }}: {{ elementQueryType.count|number }} -{% endfor -%} -- Tracked Tags: {{ craft.blitz.diagnostics.getTagsCount(siteId) }} +{% for test in craft.blitz.diagnostics.getTests() -%} + - {{ test.pass ? '✅' : '❌' }} {{ test.message|striptags }} + {{- '\n' -}} +{% endfor %} + +{% for siteId in craft.app.sites.getAllSiteIds|sort -%} + #### Site Tracking {{ craft.app.isMultiSite ? '[#' ~ siteId ~ ']' }} + {{- '\n' -}} + {{- '\n' -}} + - Tracked Pages: {{ craft.blitz.diagnostics.getPagesCount(siteId) }} + {{- '\n' -}} + - Tracked Includes: {{ craft.blitz.diagnostics.getIncludesCount(siteId) }} + {{- '\n' -}} + - Tracked Query String Params: {{ craft.blitz.diagnostics.getParamsCount(siteId) }} + {{- '\n' -}} + - Tracked Elements: {{ craft.blitz.diagnostics.getElementsCount(siteId) }} + {{- '\n' -}} + {% for elementType in craft.blitz.diagnostics.getElementTypes(siteId) %} + {{- '\t' -}}- {{ elementType.type }}: {{ elementType.count|number }} + {{- '\n' -}} + {% endfor -%} + - Tracked Element Queries: {{ craft.blitz.diagnostics.getElementQueriesCount(siteId) }} + {{- '\n' -}} + {% for elementQueryType in craft.blitz.diagnostics.getElementQueryTypes(siteId) %} + {{- '\t' -}}- {{ elementQueryType.type }}: {{ elementQueryType.count|number }} + {{- '\n' -}} + {%- endfor -%} + - Tracked Tags: {{ craft.blitz.diagnostics.getTagsCount(siteId) }} + {%- if not loop.last %} + {{- '\n' -}} + {{- '\n' -}} + {% endif -%} {% endfor %}