Join GitHub today
register_uninstall_hook called twice on each page #56
The wordpress function
This function should only be called once from the function you define as an activation hook using
Indeed, this WordPress function stores your uninstall function in an
Indeed, it actually executes 2 UPDATE queries on each page of my site. It's a problem if you use a caching plugin (like W3 Total Cache) because when an UPDATE query is done on a table, the caching plugin needs to discard the cached queries who use this table. So, on each page, my cache clears the cache for the wp_options table killing any caching effect.
Actually, I also discovered that calling this function twice doesn't do what I think you expect: uninstall hooks are not combined. Indeed, the last one replace the previous one.
Here are the 2 queries executed by the