Performance: register_uninstall_hook calling different functions

[ad_1]

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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer