-
Notifications
You must be signed in to change notification settings - Fork 23
Unnecessary HEAD requests #294
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels