kontur / fontsampler-wordpress-plugin

A Wordpress plugin that let's users interactively preview and test webfonts
http://fontsampler.johannesneumeier.com
GNU General Public License v3.0
38 stars 8 forks source link

255 is the largest ID that can be used. #184

Open MalcolmWooden opened 2 years ago

MalcolmWooden commented 2 years ago

Could it be possible to increase this limit?

kontur commented 2 years ago

What's the context for this? Automatically extracting the name from the font file?

MalcolmWooden commented 2 years ago

I've got to id254 and I can't make any more fontsamplers.

kontur commented 2 years ago

Ah, I misunderstood and thought you are talking about font internal IDs.

Can you check your debug.log for errors when attempting to create a Fontsampler? I have a hunch it is related to a limit on WP input variables.

MalcolmWooden commented 2 years ago

Sorry, I should have been more concise in my last comment.

I can make Fontsamplers with ID's > 255. Everything looks good and fontsampler confirms that I can use the new shortcode (e.g. fontsampler id=260). However, when the code is placed on the page, the fontsampler is not displayed.

If I go back to edit the fontsampler, all the information regarding the chosen options (text, size, layout etc.) is missing as if it never got written to the database.

My sites PHP max input variables = 8000 No debug.log file is created when I turn on debugging.

MalcolmWooden commented 2 years ago

I have only about 50 Fontsamplers, but through making and deleting Fontsamplers, the shortcode id's have gone over 254 and now will not display anything above that number.

MalcolmWooden commented 2 years ago

This seems to be an issue in the fontsampler_settings table of the database.

The set_id value is defined as tinyinit which restricts the value to 256. Changing this to smallinit solves the limit problem I had been having.

kontur commented 2 years ago

D'oh, that sounds like a silly limit! Thanks for doing such excellent detective work!