PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.5.4
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.5.4
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / core / update / db-updater.php

db-updater.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.5.4, at includes/core/update/db-updater.php

70 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Core\Update;
4
5 use Sellkit\Database;
6
7 defined( 'ABSPATH' ) || die();
8
9 /**
10 * Class Data base Updater.
11 *
12 * @package Sellkit\Contact_Segmentation
13 * @SuppressWarnings(ExcessiveClassComplexity)
14 * @since 1.1.0
15 */
16 class Db_Updater extends \WP_Background_Process {
17
18 /**
19 * SellKit db version.
20 *
21 * @since 1.1.0
22 * @var $db_version
23 */
24 public $db_version;
25
26 /**
27 * Queue Action.
28 *
29 * @since 1.1.0
30 * @var string
31 */
32 protected $action = 'sellkit-database-updater';
33
34 /**
35 * Override this method to perform any actions required on each
36 * queue item. Return the modified item for further processing
37 * in the next pass through. Or, return false to remove the
38 * item from the queue.
39 *
40 * @since 1.1.0
41 * @param mixed $data Queue item to iterate over.
42 */
43 protected function task( $data ) {
44 if ( empty( $data['callback_function'] ) || empty( $data['db_version'] ) ) {
45 return false;
46 }
47
48 $this->db_version = $data['db_version'];
49 $updater_functions = new Updater_Functions();
50
51 call_user_func( [ $updater_functions, $data['callback_function'] ] );
52
53 return false;
54 }
55
56 /**
57 * Complete
58 *
59 * Override if applicable, but ensure that the below actions are
60 * performed, or, call parent::complete().
61 *
62 * @since 1.1.0
63 */
64 protected function complete() {
65 parent::complete();
66
67 sellkit_update_option( 'current_db_version', $this->db_version );
68 }
69 }
70