Seems register_activation_hook not support closure but not throwing out error? e.g. register_activation_hook(__FILE__, function() { update_option('myplugin_activated', 1); }); However, register_uninstall_hook do throw out that closure cannot be serialized error if I use closure.