Dashicons loaded in frontend by Generatepress theme

  • Hi

    I’m building a website using GP’s “Prime” e-commerce starter site with WordPress, GeneratePress Premium & GenerateBlocks.

    I have found out (helped by Google AI) that normal visitors to my website front-end seem to have to download Dashicons (the official icon font built into WordPress, designed mainly for the WordPress administration screens).

    While investigating what was causing this (with a view to stopping it, to make my webpages load faster) a script that Google AI gave me identified that something on my website was loading “Thickbox” (the native WordPress legacy lightbox library built directly into the WordPress Core).

    When I used another script Google AI gave me to identify what was loading the Dashicons due to the legacy Thickbox script, the result was …

    File path: wp-content/themes/generatepress/header.php (Line: 16)
    File path: wp-content/themes/generatepress/page.php (Line: 17)

    … and Google AI said …

    “Because the file paths point directly to lines 16 and 17 inside your GeneratePress parent theme files (header.php and page.php), it means the code calling the Thickbox script has been manually hardcoded right into your theme templates.
    As established earlier, a clean, official copy of GeneratePress never includes Thickbox. This means either a previous developer edited the parent theme files directly, or a malicious script injected code into them.”

    and

    “You need to view the code on those specific lines to see what is happening. You can do this via your hosting control panel File Manager, SFTP, or by going to Appearance > Theme File Editor in your WordPress dashboard.
    1. Open wp-content/themes/generatepress/header.php and look at Line 16.
    2. Open wp-content/themes/generatepress/page.php and look at Line 17”

    But … I am using a child theme

    I did not go any further

    Please could you tell what you think & what I should do?

    Thanks in advance

  • Hi there,

    I don’t think AI is telling you the right things 🙂

    Line 16 of header.php is<?php wp_head(); ?>, and line 17 of page.php isget_header(); ?>; these are standard functions for WP themes.

    Neither of the codes will cause the visitor to load Thickbox.

    Thickbox is only loaded on the front end if a theme or plugin explicitly registers and queues it using wp_enqueue_script( 'thickbox' ) and wp_enqueue_style( 'thickbox' ). But this kind of code does not exist in GP’s files.

    Can you provide your site link?

  • I don’t see any Dashicon font being loaded on the front end, as you can see in the screenshot, all the fonts loaded are listed here:
    https://app.screencast.com/RI3Zbs4w0W9IB

  • Do the lines in my screenshot https://postimg.cc/k6Mb002x not mean dashicons are being downloaded by visitors?

  • Hi there,

    You’re right that Dashicons is being delivered to visitors. I checked both your live and staging shop pages while logged out, and both include Dashicons CSS, Thickbox CSS, and Thickbox JavaScript.

    The font screenshot missed this because Dashicons embeds its font directly inside the CSS file. It therefore doesn’t need to appear as a separate font download in the Network panel.

    However, Google AI’s conclusion about the GeneratePress files is incorrect. Those lines contain the standard WordPress functions wp_head() and get_header(). Their appearance in a diagnostic trace doesn’t mean Thickbox was hardcoded into the theme or that malicious code was injected. Seeing parent-theme templates while using a child theme is also normal.

    WordPress automatically includes Dashicons when Thickbox’s stylesheet is requested. We therefore need to identify what is requesting Thickbox.

    BeRocket’s Advanced AJAX Product Filters plugin would be a useful first test, although I haven’t confirmed it as the cause. On staging, could you temporarily deactivate it, clear the page cache, and check whether Dashicons and Thickbox still appear when viewing the shop while logged out?

    There’s no reason to edit those GeneratePress template files based on the information provided.

  • Hi Alvind

    Thanks for you reply.

    You are absolutely right! No Dashicons or Thickbox references when BeRocket’s Advanced AJAX Product Filters plugin is de-activated.

    What do you think I should do about it?

  • I assume the plugin is required for your site, so keeping it deactivated isn’t really an option.

    The remaining question is whether its frontend features actually need Thickbox. Loading it doesn’t necessarily mean there’s a bug, but it could be unnecessary overhead.

    If you rely on the product filters, I’d keep the plugin enabled and contact BeRocket support with your findings. Ask them:

    – Which frontend feature requires Thickbox?

    – If it’s only needed in the admin area, can they prevent it from loading for visitors?

    I wouldn’t remove Dashicons on its own, since Thickbox uses it for its close icon. If BeRocket confirms Thickbox isn’t needed on the frontend, they can provide a suitable fix or snippet to stop loading both Thickbox assets. Dashicons may then disappear automatically, provided nothing else requires it.

  • Will do.

    Much appreciated Alvind!

  • No problem! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.