-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuel-savings-calculator-slider.plugin.php
108 lines (89 loc) · 2.72 KB
/
fuel-savings-calculator-slider.plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
require_once 'autoloader.php';
class Fuel_Savings_Calculator_Slider
{
/*
|------------------------------------------------------------------------------------------------------------------
| Class Members
|------------------------------------------------------------------------------------------------------------------
*/
private static $_instance;
public $scripts;
public $slider_shortcode;
public $pdf_report_shortcode;
public $generate_pdf_report;
public $settings;
public $data_store;
public $email;
public $recaptcha;
public $hubspot_users;
public $blocks;
const VERSION = '1.0';
/*
|------------------------------------------------------------------------------------------------------------------
| Mesc Functions
|------------------------------------------------------------------------------------------------------------------
*/
/**
* Class constructor.
*
* @since 1.0.0
*/
public function __construct()
{
$this->scripts = FSCS\Plugin\Scripts::instance();
$this->slider_shortcode = FSCS\Plugin\Slider_Shortcode::instance();
$this->pdf_report_shortcode = FSCS\Plugin\PDF_Report_Shortcode::instance();
$this->generate_pdf_report = FSCS\Plugin\Generate_PDF_Report::instance();
$this->settings = FSCS\Plugin\Settings::instance();
$this->data_store = FSCS\Plugin\Data_Store::instance();
$this->email = FSCS\Plugin\Email::instance();
$this->recaptcha = FSCS\Plugin\Recaptcha::instance();
$this->hubspot_users = FSCS\Plugin\Hubspot_Users::instance();
$this->blocks = FSCS\Plugin\Blocks::instance();
// Register Activation Hook
register_activation_hook(FSCS_PLUGIN_DIR . 'fuel-savings-calculator-slider.php', array($this, 'activate'));
// Register Deactivation Hook
register_deactivation_hook(FSCS_PLUGIN_DIR . 'fuel-savings-calculator-slider.php', array($this, 'deactivate'));
}
/**
* Singleton Pattern.
*
* @since 1.0.0
*
* @return Fuel_Savings_Calculator_Slider
*/
public static function instance()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self;
}
return self::$_instance;
}
/**
* Trigger on activation
*
* @since 1.0.0
*/
public function activate()
{
if (get_option('fscs_email_subject') == "") {
update_option('fscs_email_subject', FSCS_EMAIL_SUBJECT);
}
if (get_option('fscs_email_body') == "") {
update_option('fscs_email_body', FSCS_EMAIL_BODY);
}
// Create custom table
$this->data_store->create_custom_db_table();
}
/**
* Trigger on deactivation
*
* @since 1.0.0
*/
public function deactivate() {}
}