Yes it is possible. You can register the plug-in activation hook, which is launched only after the plug-in is activated. I dug up an old plugin that I wrote for some sample code:
class MyPlugin { //constructor for MyPlugin object function MyPlugin() { register_activation_hook(__FILE__,array(&$this, 'activate')); } function activate() { //initialize some stored plugin stuff if (get_option('myplugin_data_1') == '') { update_option('myplugin_data_1',array()); } update_option('myplugin_activated',time()); //etc } }
zombat
source share