/** * * When installing the new wordpress plugin, make sure to move the old data * */ public function install(&$message = null) { global $wpdb; $old_table_name = $this->getTableName('shareyourcart_settings'); if ($wpdb->get_var("show tables like '{$old_table_name}'") == $old_table_name) { //get the old app_key and client_id $settings = $wpdb->get_row("SELECT app_key, client_id FROM " . $wpdb->base_prefix . "shareyourcart_settings LIMIT 1"); if ($settings) { $this->setConfigValue('appKey', $settings->app_key); $this->setConfigValue('clientId', $settings->client_id); } //remove the old table $wpdb->query("DROP TABLE {$old_table_name}"); } parent::install($message); }