Performance: register_uninstall_hook calling different functions
-
The plugin is calling two separate callback functions for register_uninstall_hook:
onUninstallPluginListener
sfsi_Unistall_plugin
This results in WordPress performing two database writes and a show full columns query for the options tab as it switches between the two callbacks in the “uninstall_plugin” data in the database for the plugin.
I.e WordPress checks if the saved uninstall hook in the database (sfsi_Unistall_plugin) is onUninstallPluginListener. As it’s not it then changes it to onUninstallPluginListener and then back to sfsi_Unistall_plugin when the second register hook is called later within the plugin. The process then repeats on the next page view.
Would it be possible to remove the unused register_uninstall_hook callback (onUninstallPluginListener) as it’s being overwritten by the second callback. This will fix the heavy database writes on each page view and improves performance.
- The topic ‘Performance: register_uninstall_hook calling different functions’ is closed to new replies.