Skip to content

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

Closed
@westonruter

Description

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?

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    • Status

      Done 😃

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions