PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / handle-steps / class-lp-handle-upgrade-db-steps.php

class-lp-handle-upgrade-db-steps.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at inc/handle-steps/class-lp-handle-upgrade-db-steps.php

49 lines 938 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Handle upgrade lp request(ajax|api) call step by step
5 *
6 * Class LP_Handle_Upgrade_Steps
7 * @author tungnx
8 * @version 1.0.0
9 */
10 class LP_Handle_Upgrade_Steps extends LP_Handle_Steps {
11 /**
12 * Version.
13 *
14 * @var string
15 */
16 public $version = '';
17
18 /**
19 * Finish Step.
20 *
21 * @param LP_Step $step .
22 * @param string $message .
23 *
24 * @return LP_Step
25 */
26 public function finish_step( LP_Step $step, string $message ): LP_Step {
27 $lp_db = LP_Database::getInstance();
28 $lp_db->set_step_complete( $step->name, 'completed' );
29
30 $step->status = 'finished';
31 $step->percent = 100;
32 $step->message = $message . '" success - Handles success';
33
34 return $step;
35 }
36
37 /**
38 * Return error message of a step
39 *
40 * @param string $step
41 * @param string $message
42 *
43 * @return string
44 */
45 public function error_step( string $step, string $message ): string {
46 return sprintf( 'Step %s: %s', $step, $message );
47 }
48 }
49