So I have a question regarding creating a new database table for my plugin, the Easing Slider, which is getting a major overhaul.
Up until now, I've relied on
get_option, and those various functions to save, edit and get plugin settings. It has worked well, but I've hit a slight snag.
So the plugins bigger, "premium" brother allows you to have more than one slideshow. This is done through saving a multi-dimensional array in a single option. I then have a function that select a specific array by the ID specified, which acts as the focal point for getting a specific slideshows settings.
The problem is, this plugin allows unlimited slideshows, each with unlimited images. Many users have been creating hundreds of slideshows, and the odd few are having problems at this point. As you can imagine, (for example) a 100 slideshows, each with 20 images, and each image with about 20 different settings, the one database option can get very large. As a result, for unknowns reasons, the odd user experiences issues and suddenly cannot create new slideshows or images, even though
'update_option' is reporting back true, letting us know that it has succeeded. One can only assume this is because the database option has hit its limit (possibly wrong, I've no idea why).
So I am looking into changing the way things work and using a custom database table. However, the one thing I can't get my head around is actually creating the table dynamically. The nature of the plugin is such that new features are added often, as well as removed. Filter hooks also allow users to add their own new features/settings easily. Each setting would ideally have its own column.
As a basic example, I could easily compile the ID's of the various settings into a single array. But could the database table be created from an array as simple as this?
$array = array( 'option_one', 'option_two', 'option_three' );