Skip to content

Unnecessary HEAD requests #294

@cristimirt

Description

@cristimirt

The plugin is checking for the existence of a certain css file on every admin page load, via the FontAwesome_SVG_Styles_Manager::ensure_svg_styles_with_admin_notice_warning() function, and that's reasonable.
However, this function is called on the init hook if is_admin() returns true, which happens on every ajax request, be it from the backend or the frontend of the website. This can quickly turn into hundreds or thousands of HEAD requests per minute, which are not needed and could cause issues with too eager or misconfigured firewalls.

I'd suggest checking for wp_doing_ajax() at the beginning of the FontAwesome::initialize_admin() function, and return early if it is an AJAX request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions