forked from xaviranik/boostimer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boostimer.php
87 lines (75 loc) · 2.08 KB
/
boostimer.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
<?php
/**
* Plugin Name: Boostimer - Product Availability Countdown And Scheduler For WooCommerce
* Description: From sale to stock, Store-wise availability management in a breeze.
* URI: https://zabiranik.com
* Author: Zabir Anik
* Author URI: https://zabiranik.com
* Version: 1.0.0
* License: GPL2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: boostimer
*/
defined( 'ABSPATH' ) || exit;
require __DIR__ . '/vendor/autoload.php';
/**
* Boostimer Class.
*/
final class Boostimer {
/**
* Plugin version.
*
* @var string
*/
private $version = '1.0.0';
/**
* Boostimer Constructor.
*/
public function __construct() {
// Defines constants.
$this->define_constants();
// Set up plugin.
new \Boostimer\Setup();
}
/**
* Define plugin constants.
*
* @return void
*/
public function define_constants() {
define( 'BOOSTIMER_VERSION', $this->version );
define( 'BOOSTIMER_PLUGIN_FILE', __FILE__ );
define( 'BOOSTIMER_DIR', __DIR__ );
define( 'BOOSTIMER_PLUGIN_BASENAME', plugin_basename( BOOSTIMER_PLUGIN_FILE ) );
define( 'BOOSTIMER_TEXT_DOMAIN_DIR', dirname( plugin_basename( __FILE__ ) ) . '/languages' );
define( 'BOOSTIMER_URL', plugins_url( '', BOOSTIMER_PLUGIN_FILE ) );
define( 'BOOSTIMER_TEMPLATES', BOOSTIMER_DIR . '/templates' );
define( 'BOOSTIMER_ASSET', BOOSTIMER_URL . '/assets' );
define( 'BOOSTIMER_DIST', plugins_url( 'dist', BOOSTIMER_PLUGIN_FILE ) );
}
/**
* Initializes the Boostimer class.
*
* Checks for an existing Boostimer instance
* and if it doesn't find one, creates it.
*
* @return Boostimer
*/
public static function instance() {
static $instance = false;
if ( ! $instance ) {
$instance = new self();
}
return $instance;
}
}
/**
* Return the instance.
*
* @return Boostimer
*/
function boostimer() {
return Boostimer::instance();
}
// let's get started
boostimer();