PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.4.0
ShopBuilder – WooCommerce Builder For Elementor v2.4.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Modules / Compare / Compare.php

Compare.php in ShopBuilder – WooCommerce Builder For Elementor 2.4.0, at app/Modules/Compare/Compare.php

58 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\Modules\Compare;
4
5 // Do not allow directly accessing this file.
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit( 'This script cannot be accessed directly.' );
8 }
9
10
11 use RadiusTheme\SB\Models\ExtraSettings;
12 use RadiusTheme\SB\Traits\SingletonTrait;
13
14 final class Compare {
15
16 /**
17 * @var array
18 */
19 public $settings = [];
20
21 private $compare_db_key = 'rtsb_compare_db_version';
22 private $compare_db_version = '1.0.0';
23
24 use SingletonTrait;
25
26 function __construct() {
27
28 if( ! ExtraSettings::instance()->get_option( $this->compare_db_key, get_option( $this->compare_db_key, false ) ) ){
29 add_action( 'wp_loaded', [ $this, 'activate' ] );
30 ExtraSettings::instance()->set_option( $this->compare_db_key, $this->compare_db_version );
31 }
32
33 //if ( ! get_option( $this->compare_db_key, '' ) ) {
34 // add_action( 'wp_loaded', [ $this, 'activate' ] );
35 // update_option( $this->compare_db_key, $this->compare_db_version );
36 //}
37
38 CompareFrontEnd::instance();
39
40 new CompareRouteV1();
41
42 if ( is_admin() ) {
43 CompareAdmin::instance();
44 }
45
46 do_action( 'rtsb/module/compare/loaded' );
47 }
48
49 /**
50 * Do stuff upon plugin activation
51 *
52 * @return void
53 */
54 public function activate() {
55 ( new CompareInstaller() )->run();
56 }
57
58 }