Helper function that returns the final steps for the upgrade completion.

If the module is already running the premium code, returns an empty string.

@author Vova Feldman (@svovaf)
@since  1.2.1

@param string $plan_title

@return string
196028
private function get_complete_upgrade_instructions( $plan_title = '' ) {
            $this->_logger->entrance();

            $activate_license_string = $this->get_license_network_activation_notice();

            if ( ! $this->has_premium_version() || $this->is_premium() ) {
                return '' . $activate_license_string;
            }

            if ( empty( $plan_title ) ) {
                $plan_title = $this->get_plan_title();
            }

            if ( $this->is_premium_version_installed() ) {
                /**
                 * If the premium version is already installed, instead of showing the installation instructions,
                 * tell the current user to activate it.
                 *
                 * @author Leo Fajardo (@leorw)
                 * @since 2.2.1
                 */
                $premium_plugin_basename = $this->premium_plugin_basename();

                return sprintf(
                /* translators: %1s: Product title; %2s: Plan title */
                    $this->get_text_inline( ' The paid version of %1s is already installed. Please activate it to start benefiting the %2s features. %3s', 'activate-premium-version' ),
                    sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
                    $plan_title,
                    sprintf(
                        '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
                        wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_plugin_basename, 'activate-plugin_' . $premium_plugin_basename ),
                        esc_html( sprintf(
                        /* translators: %s: Plan title */
                            $this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
                            $plan_title
                        ) )
                    )
                );
            } else {
                // @since 1.2.1.5 The free version is auto deactivated.
                $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
                    ( '<li>' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.</li>' ) :
                    '';

                return sprintf(
                    ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
                    $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
                    ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
                    $this->get_latest_download_link( sprintf(
                    /* translators: %s: Plan title */
                        $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ),
                        $plan_title
                    ) ),
                    $deactivation_step,
                    $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ),
                    '//bit.ly/upload-wp-' . $this->_module_type . 's',
                    $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' )
                );
            }
        }
450760
protected function getViewTrackTitle()
    {
        $trackEngine = $this->getTrackEngine();

        if ($this->isMultiTracks()) {
            $respondent = $this->getRespondent();

            // Set params
            return sprintf(
                    $this->_('%s track assignments for respondent nr %s: %s'),
                    $trackEngine->getTrackName(),
                    $this->_getParam(\MUtil_Model::REQUEST_ID1),
                    $this->getRespondent()->getFullName()
                    );
        } else {
            return sprintf(
                    $this->_('%s track overview'),
                    $trackEngine->getTrackName()
                    );
        }
    }
1207861
public function getTitle()
    {
        $title = ($this->Title) ? $this->Title : sprintf('Delete %s %s', count($this->ids), $this->dataClass);
        
        if ($this->User) {
            return $title .= sprintf(' (Initiated by %s)', $this->User->getTitle());
        }

        return $title;
    }
1330478
public function getTitle()
    {
        return isset($this->options['title']) ? trim($this->options['title']) : (isset($this->options['name']) ? trim($this->options['name']) : 'token');
    }
786224
public function whereTitle($title, callable $callback = null)
    {
        $item = $this->findBy('title', $title);

        if (is_callable($callback)) {
            return call_user_func($callback, $item);
        }

        return $item;
    }
1044193
public function getDescription() {
		$parts = array();
		foreach($this->getTicketQuantities() as $ticketid => $quantity){
			if($ticket = EventTicket::get()->byID($ticketid)){
				$parts[] = $quantity."x".$ticket->Title;
			}
		}
		return $this->Event()->Title.": ".implode(",", $parts);
	}
636457
public function get_title() {
        global $DB;
        $role = $DB->get_record('role', array('id' => $this->role));
        if (!$role) {
            return '['.get_string('roleidnotfound', 'completion', $this->role).']';
        }
        return role_get_name($role, context_course::instance($this->course));
    }
323243
public function getTitles(){
		if(is_null($this->titles) && $module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME)){
			$pattern = '/(.*) (('.$module->getSetting('MAJ_TITLE_PREFIX', '').')(.*))/';
			$this->titles=array();
			$titlefacts = $this->gedcomrecord->getFacts('TITL');
			foreach($titlefacts as $titlefact){
				$ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2);
				if($ct2>0){
					$this->titles[$match2[1][0]][]= trim($match2[2][0]);
				}
				else{
					$this->titles[$titlefact->getValue()][]='';
				}
			}
		}
		return $this->titles;
	}
906650
public function gameName() : ?string
    {
        if ($this->titleType() & SessionType::Unknown) return null; 

        return $this->session->npTitleDetail->npTitleName;
    }
678517
public function getIndexTitle()
    {
        $respondent = $this->getRespondent();

        return sprintf(
                $this->_('Tracks assigned to %s: %s'),
                $respondent->getPatientNumber(),
                $respondent->getFullName()
                );
    }
805327
private function fetch_plan_by_id( $plan_id ) {
            $this->_logger->entrance();
            $api = $this->get_current_or_network_user_api_scope();

            $result = $api->get( "/plugins/{$this->_module_id}/plans/{$plan_id}.json", true );

            return $this->is_api_result_entity( $result ) ?
                new FS_Plugin_Plan( $result ) :
                $result;
        }
473782
public function title() {
		if ( $rd = $this->get_revised_data_from_method('title') ) {
			return $rd;
		}
		return apply_filters('the_title', $this->post_title, $this->ID);
	}
346972
public function getAdminListTitle()
    {
        $prefix = '';
        $lvl    = $this->getLvl();
        for ($i = 0; $i < $lvl; $i++) {
            $prefix .= '&nbsp;&nbsp;&nbsp;&nbsp;';
        }

        return $prefix.$this->getTitle();
    }
593549
public function title()
	{
		// Try to load title from model
		$model_name = $this->model_name;

		if (isset($this->$model_name->title))
		{
			return $this->$model_name->title;
		}

		// Instead use global config
		return Arr::path($this->tanuki(), 'title');
	}
46359
public function editingTitle()
    {
        $editingTitle = $this->admin()->editingTitle;

        // Check for the custom option first and
        // return it if it exists
        if ($this->columnExists($editingTitle)) return $this->{$editingTitle};

        // As a last-ditch effort, see if there's a title option
        // we can use so the user doesn't have to ask for it
        if ($this->columnExists('title')) return $this->title;

        return;
    }
850974
public function finishDeliveryExecution()
    {
        $deliveryExecution = null;
        if ($this->hasRequestParameter('deliveryExecution')) {
            $deliveryExecution = ServiceProxy::singleton()->getDeliveryExecution(
                $this->getRequestParameter('deliveryExecution')
            );
            if ($deliveryExecution->getState() !== DeliveryExecution::STATE_FINISHIED) {
                $stateService = $this->getServiceManager()->get(StateServiceInterface::SERVICE_ID);
                $stateService->finish($deliveryExecution);
            }
        }
        $redirectUrl = LTIDeliveryTool::singleton()->getFinishUrl($this->getLtiMessage($deliveryExecution), $deliveryExecution);
        $this->redirect($redirectUrl);
    }
307271
public function getContentTitle()
    {
        $patientId = $this->_getParam(\MUtil_Model::REQUEST_ID1);
        if ($patientId) {
            if ($this->currentUser->areAllFieldsMaskedWhole('grs_first_name', 'grs_surname_prefix', 'grs_last_name')) {
                return sprintf($this->_('Appointments for respondent number %s'), $patientId);
            }
            $respondent = $this->loader->getRespondent(
                    $patientId,
                    $this->getRequest()->getParam(\MUtil_Model::REQUEST_ID2)
                );
            return sprintf($this->_('Appointments for respondent number %s: %s'), $patientId, $respondent->getName());
        }
        return $this->getIndexTitle();
    }