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

Should elements in the Admin Bar be excluded from processing by Optimization Detective? #1806

Closed
westonruter opened this issue Jan 19, 2025 · 1 comment · Fixed by #1816
Closed
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@westonruter
Copy link
Member

When the admin bar is shown on the page, elements inside of it are visited by tag visitors in Optimization Detective. However, there seems to be very little to no benefit to visiting these elements. In the same way descendants of NOSCRIPT are omitted from processing (#1783), it would seem like DIV#wpadminbar should also be skipped. For example, when a tag visitor is tracking IMG tags, the first two elements appearing in URL Metrics for pages with a logged-in user would be:

Image

Raw JSON
{
    "isLCP": false,
    "isLCPCandidate": false,
    "xpath": "/HTML/BODY/DIV/*[1][self::DIV]/*[2][self::UL]/*[1][self::LI]/*[1][self::A]/*[2][self::IMG]",
    "intersectionRatio": 1,
    "intersectionRect": {
        "x": 1353.779296875,
        "y": 5.3125,
        "width": 17.24609375,
        "height": 17.24609375,
        "top": 5.3125,
        "right": 1371.025390625,
        "bottom": 22.55859375,
        "left": 1353.779296875
    },
    "boundingClientRect": {
        "x": 1353.779296875,
        "y": 5.3125,
        "width": 17.24609375,
        "height": 17.24609375,
        "top": 5.3125,
        "right": 1371.025390625,
        "bottom": 22.55859375,
        "left": 1353.779296875
    }
}

and

{
    "isLCP": false,
    "isLCPCandidate": false,
    "xpath": "/HTML/BODY/DIV/*[1][self::DIV]/*[2][self::UL]/*[1][self::LI]/*[2][self::DIV]/*[1][self::UL]/*[1][self::LI]/*[1][self::A]/*[1][self::IMG]",
    "intersectionRatio": 0,
    "intersectionRect": {
        "x": 0,
        "y": 0,
        "width": 0,
        "height": 0,
        "top": 0,
        "right": 0,
        "bottom": 0,
        "left": 0
    },
    "boundingClientRect": {
        "x": 0,
        "y": 0,
        "width": 0,
        "height": 0,
        "top": 0,
        "right": 0,
        "bottom": 0,
        "left": 0
    }
}

These correspond to the two Gravatar images here:

Image

Is there any conceivable reason to visit tags in the admin bar?

@westonruter westonruter added [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Bug An existing feature is broken Needs Discussion Anything that needs a discussion/agreement labels Jan 19, 2025
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Jan 19, 2025
@swissspidy
Copy link
Member

I think it makes sense to skip those 👍 Don't see a reason why not

@westonruter westonruter moved this from Not Started/Backlog 📆 to In Progress 🚧 in WP Performance 2024 Jan 21, 2025
@westonruter westonruter moved this from In Progress 🚧 to Code Review 👀 in WP Performance 2024 Jan 21, 2025
@westonruter westonruter added [Type] Enhancement A suggestion for improvement of an existing feature and removed Needs Discussion Anything that needs a discussion/agreement [Type] Bug An existing feature is broken labels Jan 21, 2025
@github-project-automation github-project-automation bot moved this from Code Review 👀 to Done 😃 in WP Performance 2024 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Done 😃
Development

Successfully merging a pull request may close this issue.

2 participants