New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the number of options in the database #618
Comments
That would make WP-CLI's |
Also it will cause potential plugin upgrade issue. Won't consider this feature. |
I’m sorry but those are both nonsensical arguments. WP CLI has a pluck option for this: and upgrade you can just write an upgrade function for. |
Disappointed to see this closed so quickly and seemingly without much consideration (LSCache has included upgrade functions that alter the db structure in the past). From an extender POV, the settings storage impact performance and hurt DX (although WP's new The options also don't necessarily need to be collapsed into a single setting; a handful of hinted arrays to track would still be a huge DX improvements over the hundred+ that we have currently. |
Sorry for the quick answer previously. I apologize if the wording made you feel offended. I didn't intend to be like that. Thanks for the feedback. We are always open to suggestions and want to keep improving our plugin. There is a long and complex history behind our choice to use separate entries per option (WooCommerce and some other plugins do the same way), and it would not be trivial to change it now. If the issue is performance concerns, I think improving business logic has a better chance of speeding up WP than changing the way we deal with options. We purposely leave the options behind when the plugin is disabled, in case the user is disabling it temporarily. Otherwise, their fine-tuned options will be lost. If the issue is database cleanup, would it help if we provided an option to remove this information from the database upon uninstallation of the plugin? Sincerely, |
It isn't only an issue to remove the option when the plugin is removed. Also I didn't checked but those options are in autoload in wp_options? Otherwise they are loaded in every single page including admin... |
This an example why the ticket not autoload options by default is way to go |
Keeping the options when the plugin is simply disabled is fine, but there definitely should be a user setting to delete this information from the database upon uninstallation. Adding this setting would help. Even if it isn't trivial to change how the options are stored currently, perhaps it's still something you could work towards changing in the future, as a longer-term goal? And hopefully the options are not all loaded with every single page, including admin, as @Mte90 mentioned... |
Good to know. Thanks for your feedback. Will take into consideration. |
I want to suggest using 1 option for the plugin with a keyed array in it, instead of the gigantic number of options that you're adding to a site now. I recently had to clean up a site that had use this plugin and I was a tad bit annoyed by the sheer number of options in the database.
The text was updated successfully, but these errors were encountered: