Upon further inspection, you may notice that the icons haven’t disappeared, but instead are throwing an error “Unsafe attempt to load URL…” This error appears to be unique to users on the Chrome browser, although I haven’t tried all browsers on all OS so it could be more widespread.
In my case, this error occurred because the icons that the plugin uses were being served over a CDN. Since my host’s (WPEngine) CDN uses a unique URL for each site to serve content from. The “Unsafe attempt to load URL…” error comes up when the domains don’t match up.
So for example, if I’m using Simple Social Icons on this site (https://scottdeluzio.com), and the CDN is loading the icon file from the CDN’s domain (https://zonename-wpengine.netdna-ssl.com) the domains won’t match and we’ll end up with an error.
The solution to prevent this is to stop the icon file from being loaded off of the CDN’s domain. While this may lose the benefit of this one file loading over the CDN, it will enable the icons to load properly.
On WPEngine, the way to do this was not very obvious but the outstanding support agent I spoke with showed me exactly what to do.
- Visit your site where the icons are not showing up correctly, and press CTRL+Shift+I.
- Find the error that begins with “Unsafe attempt to load URL”
- Copy the first URL that should be pointing to the /wp-content/plugins/simple-social-icons/symbol-defs.svg file
- Login to your site’s wp-admin
- Click the WP Engine > General Settings menu
- Scroll to the bottom in the Advanced Configuration section and find the HTML Post-Processing box
- Enter the following expression in the box:
#https://zonename-wpengine\.netdna-ssl\.com/wp-content/plugins/simple-social-icons/# => https://yoursite.com/wp-content/plugins/simple-social-icons/
- Replace the zonename portion of the first URL with the equivalent portion of the CDN URL from your site – yours will be different.
- Replace yoursite.com with your actual domain name
If you have several sites on a multisite you can enter the expressions for each site in the same section (i.e. no need to login to each site’s admin), although you will need to copy the CDN URL from each site’s error and replace with the relevant site URL.