PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 1.1.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v1.1.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / classes / class-cartflows-update.php

class-cartflows-update.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 1.1.0, at classes/class-cartflows-update.php

78 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Update Compatibility
4 *
5 * @package CartFlows
6 */
7
8 if ( ! class_exists( 'Cartflows_Update' ) ) :
9
10 /**
11 * CartFlows Update initial setup
12 *
13 * @since 1.0.0
14 */
15 class Cartflows_Update {
16
17 /**
18 * Class instance.
19 *
20 * @access private
21 * @var $instance Class instance.
22 */
23 private static $instance;
24
25 /**
26 * Initiator
27 */
28 public static function get_instance() {
29 if ( ! isset( self::$instance ) ) {
30 self::$instance = new self();
31 }
32 return self::$instance;
33 }
34
35 /**
36 * Constructor
37 */
38 public function __construct() {
39 add_action( 'admin_init', __CLASS__ . '::init' );
40 }
41
42 /**
43 * Init
44 *
45 * @since 1.0.0
46 * @return void
47 */
48 static public function init() {
49
50 do_action( 'cartflows_update_before' );
51
52 // Get auto saved version number.
53 $saved_version = get_option( 'cartflows-version', false );
54
55 // Update auto saved version number.
56 if ( ! $saved_version ) {
57 update_option( 'cartflows-version', CARTFLOWS_VER );
58 }
59
60 // If equals then return.
61 if ( version_compare( $saved_version, CARTFLOWS_VER, '=' ) ) {
62 return;
63 }
64
65 // Update auto saved version number.
66 update_option( 'cartflows-version', CARTFLOWS_VER );
67
68 do_action( 'cartflows_update_after' );
69 }
70 }
71
72 /**
73 * Kicking this off by calling 'get_instance()' method
74 */
75 Cartflows_Update::get_instance();
76
77 endif;
78