-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstoregrowth-sales-booster.php
129 lines (109 loc) · 3.29 KB
/
storegrowth-sales-booster.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
/**
* Plugin Name: StoreGrowth - Sales Booster For WooCommerce Lite
* Description: Best WooCommerce Direct Checkout, Fly Cart, BOGO, Quick View, Live Sales Notifications, Floating Notification Bar and More Essential Features for Every WooCommerce Site!
* Version: 1.28.13
* Author: Dokan Inc.
* Author URI: https://storegrowth.io
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: storegrowth-sales-booster
* Domain Path: /languages
*
* @package SGSB
*/
use STOREGROWTH\SPSB\Bootstrap;
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
return;
}
require_once __DIR__ . '/vendor/autoload.php';
/**
* Define plugin __FILE__
*/
if ( ! defined( 'STOREGROWTH_PLUGIN_FILE' ) ) {
define( 'STOREGROWTH_PLUGIN_FILE', __FILE__ );
}
/**
* Define plugin directory URL.
*/
if ( ! defined( 'STOREGROWTH_PLUGIN_DIR_URL' ) ) {
define( 'STOREGROWTH_PLUGIN_DIR_URL', plugin_dir_url( STOREGROWTH_PLUGIN_FILE ) );
}
/**
* Define plugin directory path.
*/
if ( ! defined( 'STOREGROWTH_PLUGIN_DIR_PATH' ) ) {
define( 'STOREGROWTH_PLUGIN_DIR_PATH', plugin_dir_path( STOREGROWTH_PLUGIN_FILE ) );
}
/**
* Define The Template's Folder Constant
*/
if ( ! defined( 'STOREGROWTH_PLUGIN_TEMPLATES_PATH_LITE' ) ) {
define( 'STOREGROWTH_PLUGIN_TEMPLATES_PATH_LITE', plugin_dir_path( STOREGROWTH_PLUGIN_FILE ) . 'Includes/Modules/' );
}
/**
* Define The Stock Count Down Template Constant
*/
if ( ! defined( 'STOREGROWTH_STOCK_COUNTDOWN_TEMPLATES_PATH' ) ) {
define( 'STOREGROWTH_STOCK_COUNTDOWN_TEMPLATES_PATH', STOREGROWTH_PLUGIN_TEMPLATES_PATH_LITE . 'CountdownTimer/templates/' );
}
/**
* Define The Free Shipping Bar Template Constant
*/
if ( ! defined( 'FREE_SHIPPING_BAR_TEMPLATES_PATH' ) ) {
define( 'FREE_SHIPPING_BAR_TEMPLATES_PATH', STOREGROWTH_PLUGIN_TEMPLATES_PATH_LITE . 'ProgressiveDiscountBanner/templates/' );
}
/**
* Define plugin basename.
*/
if ( ! defined( 'STOREGROWTH_PLUGIN_BASENAME' ) ) {
define( 'STOREGROWTH_PLUGIN_BASENAME', plugin_basename( STOREGROWTH_PLUGIN_FILE ) );
}
/**
* Check free plugin is active or not.
*/
require_once ABSPATH . 'wp-admin/includes/plugin.php';
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
add_action(
'admin_notices',
function () {
$message = sprintf(
// translators: %s is a placeholder for the WooCommerce plugin link.
__( 'StoreGrowth - Sales Booster requires %s to be installed and active.', 'storegrowth_sales_booster' ),
'<a href="https://wordpress.org/plugins/woocommerce/">WooCommerce</a>'
);
printf( '<div class="%1$s"><p><strong>%2$s</strong></p></div>', esc_attr( 'notice notice-error' ), wp_kses_post( $message ) );
}
);
return;
}
if ( is_plugin_active( 'storegrowth-sales-booster-pro/storegrowth-sales-booster-pro.php' ) ) {
define( 'SGSB_PRO_ACTIVE', true );
} else {
define( 'SGSB_PRO_ACTIVE', false );
}
/**
* add option when plugin is activated.
*/
register_activation_hook(
__FILE__,
function () {
add_option( 'storegrowth_activation_redirect', true );
}
);
/**
* Initialize the plugin functionality.
*
* @since 1.0.0
*
* @return Bootstrap
*/
function sgsb_plugin(): Bootstrap {
return Bootstrap::instance();
}
// Call initialization function.
sgsb_plugin();