/** * Install method is called once install this plugin. * create tables, default option ... */ static function activate() { SIB_Model_Contact::create_table(); // Get the country code data SIB_Model_Country::create_table(); $file = fopen(plugin_dir_path(__FILE__) . "/model/country_code.csv", "r"); $country_code = array(); while (!feof($file)) { $code = fgetcsv($file); $country_code[$code[0]] = $code[1]; } fclose($file); SIB_Model_Country::Initialize($country_code); // redirect option update_option('ws_do_activation_redirect', true); }