check_db_version(); } public function check_db_version() { $installed_version = get_option( $this->db_version_key ); if ( $installed_version !== $this->db_version ) { $this->upgrade_database( $installed_version ); update_option( $this->db_version_key, $this->db_version ); } } private function upgrade_database( $installed_version ) { if ( version_compare( $installed_version, '1.0', '<' ) || ! $installed_version ) { $this->create_initial_table(); } } private function create_initial_table() { Transaction_Query::remove_table(); Transaction_Query::create_table(); } } new Database_Updater();