Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blitz Hints incorrectly shows hint for hyper fields #756

Open
samuel-clara opened this issue Jan 23, 2025 · 5 comments
Open

Blitz Hints incorrectly shows hint for hyper fields #756

samuel-clara opened this issue Jan 23, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@samuel-clara
Copy link

Bug Report

Blitz hints show hint to Eager-load the relation field of all hyper plugin fields that can't be eager loaded, as they aren't elements.
See: verbb/hyper#103

Diagnostics Report

Application Info

  • PHP version: 8.3.15
  • Craft edition & version: Pro 5.6.1
  • Database driver & version: MySQL 8.0.40

Installed Plugins

  • Blitz: 5.9.9
  • CKEditor: 4.4.0
  • Contact Form: 3.1.0
  • Contact Form Extensions: 5.0.0
  • Do It Yourself widget: 4.1.1
  • Hyper: 2.2.2
  • Image Resizer: 4.0.1
  • Imager X: 5.1.1
  • Knock Knock: 3.0.1
  • Typogrify: 5.0.1

Loaded Modules

  • codeeditor: nystudio107\codeeditor\CodeEditor
  • sprig-core: putyourlightson\sprig\Sprig
  • verbb-base: verbb\base\Base

Blitz Plugin Settings

{
    "debug": false,
    "hintsEnabled": true,
    "cachingEnabled": false,
    "refreshCacheEnabled": true,
    "refreshMode": 3,
    "includedUriPatterns": [],
    "excludedUriPatterns": [],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\FileStorage",
    "cacheStorageSettings": [],
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
    "cacheGeneratorSettings": [],
    "cacheGeneratorTypes": [],
    "customSiteUris": [],
    "cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
    "cachePurgerSettings": [],
    "cachePurgerTypes": [],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
    "deployerSettings": [],
    "deployerTypes": [],
    "ssiEnabled": false,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "onlyCacheLowercaseUris": false,
    "queryStringCaching": 0,
    "includedQueryStringParams": [
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": ".*"
        }
    ],
    "excludedQueryStringParams": [
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": "gclid"
        },
        {
            "enabled": true,
            "siteId": "",
            "queryStringParam": "fbclid"
        }
    ],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": true,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": false,
    "refreshCacheWhenElementSavedNotLive": false,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheDuration": null,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\CommerceIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
    ],
    "defaultCacheControlHeader": "no-store",
    "cacheControlHeader": "public, s-maxage=31536000, max-age=0",
    "cacheControlHeaderExpired": "public, s-maxage=5, max-age=0",
    "sendPoweredByHeader": true,
    "outputComments": true,
    "refreshCacheJobPriority": 10,
    "driverJobBatchSize": 100,
    "driverJobPriority": 100,
    "queueJobTtr": 300,
    "maxRetryAttempts": 10,
    "maxUriLength": 255,
    "mutexTimeout": 1,
    "commands": [],
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

  • ❌ Image transforms are configured not to be generated before page load.
  • ❌ One or more globals exist and refreshCacheAutomaticallyForGlobals is enabled.
  • ❌ Queue jobs are configured to run automatically via web requests.
  • ❌ The Blitz Hints utility is reporting 2 eager-loading opportunities.
  • ❌ The blitz/cache/refresh-expired console command has not been executed within the past 24 hours.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but unchanged.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but not live.
  • ✅ The @web alias is explicitly defined.
  • ✅ The Async Queue plugin is not installed or enabled.

Site Tracking [1]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [2]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [6]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [7]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0
@samuel-clara samuel-clara added the bug Something isn't working label Jan 23, 2025
@samuel-clara samuel-clara changed the title Blitz hints incorrectly shows hint for hyper fields Blitz Hints incorrectly shows hint for hyper fields Jan 23, 2025
@bencroker
Copy link
Collaborator

Thanks for the report. Can you show me the hint as it appears?

@samuel-clara
Copy link
Author

Image

@bencroker
Copy link
Collaborator

And can you show me the queries as they appear in the Twig code?

@samuel-clara
Copy link
Author

samuel-clara commented Jan 24, 2025

Sure I've simplified the code for you

`
{% set button = entry.article_button %}

{% if button.isEmpty() %}
                <div class="btn-wrapper">
                    <a href="{{ button.url }}" {% if button.target %} target="{{ button.target }}"{% endif %} class="btn-clear"><span></span><span></span>{% if button.linkText %}{{ button.linkText }}{% else %}{{ "UI_BTN_DEFAULTANCHOR"|t }}{% endif %}<span></span><span></span></a>
                </div>
            {% endif %}`

@bencroker
Copy link
Collaborator

Thanks! I’ll do some testing locally and let you know what I find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants