# learnpress/4.4.9/inc/handle-steps/class-lp-handle-upgrade-db-steps.php

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.4.9. 49 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.4.9/code/inc/handle-steps/class-lp-handle-upgrade-db-steps.php
- Raw: https://pluginprobe.com/plugins/learnpress/4.4.9/raw/inc/handle-steps/class-lp-handle-upgrade-db-steps.php
- Modified: 2026-09-27T10:32:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.4.9/code/inc/handle-steps/class-lp-handle-upgrade-db-steps.php#L10-L20`.

```php
<?php

/**
 * Handle upgrade lp request(ajax|api) call step by step
 *
 * Class LP_Handle_Upgrade_Steps
 * @author tungnx
 * @version 1.0.0
 */
class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
	/**
	 * Version.
	 *
	 * @var string
	 */
	public $version = '';

	/**
	 * Finish Step.
	 *
	 * @param LP_Step $step .
	 * @param string  $message .
	 *
	 * @return LP_Step
	 */
	public function finish_step( LP_Step $step, string $message ): LP_Step {
		$lp_db = LP_Database::getInstance();
		$lp_db->set_step_complete( $step->name, 'completed' );

		$step->status  = 'finished';
		$step->percent = 100;
		$step->message = $message . '" success - Handles success';

		return $step;
	}

	/**
	 * Return error message of a step
	 *
	 * @param string $step
	 * @param string $message
	 *
	 * @return string
	 */
	public function error_step( string $step, string $message ): string {
		return sprintf( 'Step %s: %s', $step, $message );
	}
}

```
