importer = $importer; switch ( $action ) { case 'cleanup': $this->status = $this->importer->run_cleanup(); break; case 'import': $this->status = $this->importer->run_import(); break; case 'detect': default: $this->status = $this->importer->run_detect(); } $this->status->set_msg( $this->complete_msg( $this->status->get_msg() ) ); } /** * Convenience function to replace %s with plugin name in import message. * * @param string $msg Message string. * * @return string Returns message with plugin name instead of replacement variables. */ protected function complete_msg( $msg ) { return sprintf( $msg, $this->importer->get_plugin_name() ); } }