elementor / static-html-output

Static HTML Output Plugin for WordPress

Home Page:https://statichtmloutput.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local hosted fonts are not exported

thomasfrobieter opened this issue · comments

We are using this great plugin to make all fonts local: https://wordpress.org/plugins/embed-google-fonts/

But not a single font file is exportet, even if i add them manually to the "Include additional URLs"-List, like so:

/wp-content/cache/embed-google-fonts/tangerine/tangerine-v12-latin-700.woff
/wp-content/cache/embed-google-fonts/ubuntu/ubuntu-v15-latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic-700.woff
/wp-content/cache/embed-google-fonts/ubuntu/ubuntu-v15-latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic-300.woff
/wp-content/cache/embed-google-fonts/ubuntu/ubuntu-v15-latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic-500.woff
/wp-content/cache/embed-google-fonts/ubuntu/ubuntu-v15-latin-ext_latin_greek-ext_greek_cyrillic-ext_cyrillic-300italic.woff

The only file in those exported font folders still is the *.css file.

Just a note to say I'm also having the same issue.

My original assumption was that my CSS file was not being parsed for further URLs to crawl @font-face.

So then I also added my font files to "Include additional URLs" too, and they are being ignored. It may be that the plugin doesn't attempt to crawl certain extensions?

Thanks for reporting, @lukearmstrong, @lukearmstrong. Leaving this issue open, as I think the Include Additional URLs function has some issues I need to resolve.

For a workaround, the Autoptimize plugin usually helps catch any missing fonts/styles, etc. I'm not sure if it will play nicely with the Embed Google Fonts plugin, but it should be able to replace it and provide the same functionality, plus more nice features.

Just to +1 on this - theme icons aren't being exported even if explicitly listed in additional URLs.

I'm afraid, the same applies for CSS files and PDF files, though explicitly listed in additional URLs.

For example (names slightly adapted):

/wp-content/uploads/2021/02/XYZ_someDocument_210229.pdf
/wp-content/themes/theme-name/legacy.css
/wp-content/themes/theme-name/svgcache/base.svg

Same issue here, besides fonts reported earlier, I'm also having issues with svg, txt, etc... I tested a bunch of files and basically 'Include additional URLs' feature doesn't work at all.

I started to test back version by version and noticed that it breaks from v6.6.19 (when this was introduced: "no more txt files polluting uploads dir, slowing things down").

I also noticed that by default, v6.6.18 generates/discovers much more files than v6.6.19.

Another thing: from v6.6.19 the ability to select 'Target directory' is removed and always defaults to /wp-content/uploads/static-html-output, which to me is an important feature to have... not sure why it was removed.

In summary, I like how the latest version is faster... but unfortunately is too unreliable, so for now I think is better just to use v6.6.18 and hopefully @leonstafford can fix it some day :)

This is such a useful and unique plugin... I really hope it can get more love as it is the only (open source) tool around.

Thanks @diegoteliz.

Most love is shifting to WP2Static in https://github.com/leonstafford/wp2static, but I want to bring in the good bits from this plugin to there.

It's a hard compromise between detecting too little and too much. I prefer to detect the minimum best-guess URLs by default, but allow the user to control adding more/less to this. Finally, allowing a crawler to discover new URLs as it crawls the initial list.

Hopefully, the best of all these processes will be merged into WP2Static upcoming versions. I've also started a new specific library for WordPress URL detection.

There is also the Simply Static plugin on GitHub (not sure if Pro features are included in that) and a few new entrants in the wp.org plugin repository.

I expect WP2Static to solidify it's spot as best open source tool for this, you can find my recent roadmap/plans: elementor/wp2static#795

For short term workaround, if your missing assets are part of WP site, you can try the Autoptimize plugin, which often makes it much easier for the plugin to crawl everything in the site.

(also, bit slowed down in development past few months, as I've taken on a fulltime role with Strattic. As I get more comfortable in that role, I'll be putting more time into my open source projects, such as WP2Static and Lokl