BibleGet-I-O / bibleget-wordpress

Plugin for WordPress that let's you insert Bible quotes into your posts or pages from a variety of Bible versions in different languages. This is a mirror of the SVN repo where the plugin gets published to the WordPress plugins store. Kudos to @kas-catholic for helping import the repo from SVN.
https://www.bibleget.io
Apache License 2.0
0 stars 2 forks source link

`gfontsWeblist.json` not always correctly populated #17

Open JohnRDOrazio opened 6 months ago

JohnRDOrazio commented 6 months ago

In recent tests I came across a situation where the font picker in the Block editor was not showing Google Fonts, and since the last chosen font had been a Google Font, the font picker was not able to find the current value in the list and the picker was showing as empty.

Upon inspecting network requests, I saw that there was an error when loading the gfonts_preview/gfontsWeblist.json file.

Upon inspecting such file, I found it to contain an empty object: {}.

Upon force refreshing the Google Fonts previews from the BibleGet admin settings page, it was correctly populated. The strange thing is, I had just recently force refreshed the Google Fonts previews.

In conclusion, we need further investigation as to why the contents of this file are not always getting correctly written...

JohnRDOrazio commented 6 months ago

there should probably also be a default fallback list of Google Fonts for when the API key is not provided, like we do for the Customizer component...

JohnRDOrazio commented 6 months ago

I'm seeing that when a key that was previously added is removed and then re-added, the the Google Fonts previews have been removed but are not re-created when key is re-added.

JohnRDOrazio commented 6 months ago

there should probably also be a default fallback list of Google Fonts for when the API key is not provided, like we do for the Customizer component...

fixed in commit e7a8c11

JohnRDOrazio commented 6 months ago

I'm wondering if maybe the gfonts_preview folder is overwritten during plugin update? But if that were the case, wouldn't it just disappear completely rather than contain gfontsWeblist.json with an empty object {}?

JohnRDOrazio commented 6 months ago

I'm wondering if maybe the gfonts_preview folder is overwritten during plugin update? But if that were the case, wouldn't it just disappear completely rather than contain gfontsWeblist.json with an empty object {}?

I can confirm that the folders to disappear completely when the plugin is updated. Perhaps we need a background worker to populate them again?