version; } protected function getIsCompletedUpdatingKey() { return 'tiered_price_table_completed_updating_' . $this->getVersion(); } protected function getIsUpdatingKey() { return 'tiered_price_table_updating_' . $this->getVersion(); } protected function isUpdating() { return get_option( $this->getIsUpdatingKey() ) == 'yes'; } protected function isCompleted() { return get_option( $this->getIsCompletedUpdatingKey() ) == 'yes'; } protected function begin() { if ( ! $this->isUpdating() && ! $this->isCompleted() ) { $this->push_to_queue( 'update_to_' . $this->getVersion() ); update_option( $this->getIsUpdatingKey(), 'yes' ); $this->save()->dispatch(); } } protected function complete() { update_option( $this->getIsUpdatingKey(), 'no' ); update_option( $this->getIsCompletedUpdatingKey(), 'yes' ); $this->setCurrentDBVersion(); $this->showCompleteUpdatingMessage(); parent::complete(); } protected function setCurrentDBVersion() { update_option( Updater::DB_OPTION, $this->getVersion() ); } protected function showUpdatingMessage() { add_action( 'admin_notices', function () { ?>