Skip to content

Commit

Permalink
Get loaded modules only, format spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jun 1, 2024
1 parent 26b9ca3 commit 64af11e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
67 changes: 40 additions & 27 deletions src/templates/_utilities/diagnostics/_includes/report.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 %}

0 comments on commit 64af11e

Please sign in to comment.