-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstoregrowth-sales-booster.php
More file actions
161 lines (136 loc) · 4.31 KB
/
Copy pathstoregrowth-sales-booster.php
File metadata and controls
161 lines (136 loc) · 4.31 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/**
* Plugin Name: StoreGrowth
* 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: 2.2.0
* 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
* Requires Plugins: woocommerce
* Requires at least: 6.2
* Requires PHP: 7.4
* WC requires at least: 8.0
*
* @package SPSG
*/
use StorePulse\StoreGrowth\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_VERSION' ) ) {
define( 'STOREGROWTH_VERSION', '2.2.0' );
}
/**
* Define plugin __FILE__
*/
if ( ! defined( 'STOREGROWTH_FILE' ) ) {
define( 'STOREGROWTH_FILE', __FILE__ );
}
/**
* Define plugin directory URL.
*/
if ( ! defined( 'STOREGROWTH_DIR_URL' ) ) {
define( 'STOREGROWTH_DIR_URL', plugin_dir_url( STOREGROWTH_FILE ) );
}
/**
* Define plugin directory path.
*/
if ( ! defined( 'STOREGROWTH_DIR_PATH' ) ) {
define( 'STOREGROWTH_DIR_PATH', plugin_dir_path( STOREGROWTH_FILE ) );
}
/**
* Define module directory.
*/
if ( ! defined( 'STOREGROWTH_MODULE_DIR' ) ) {
define( 'STOREGROWTH_MODULE_DIR', __DIR__ . '/modules' );
}
/**
* Define plugin basename.
*/
if ( ! defined( 'STOREGROWTH_BASENAME' ) ) {
define( 'STOREGROWTH_BASENAME', plugin_basename( STOREGROWTH_FILE ) );
}
/**
* Add option when plugin is activated.
*/
register_activation_hook(
__FILE__,
function () {
add_option( 'storegrowth_activation_redirect', true );
// A fresh install has nothing to migrate, so it starts at the current
// database version and never sees the upgrade notice.
\StorePulse\StoreGrowth\Upgrader::maybe_stamp_fresh_install();
}
);
/**
* Declare compatibility with WooCommerce High-Performance Order Storage (HPOS).
*
* The plugin writes no order or order-item meta and reads orders only through
* the WooCommerce CRUD API, so it is HPOS-safe. Any future code that stores
* order data must use the CRUD API (never update_post_meta) to keep this true.
*
* @since 2.1.2
*/
add_action(
'before_woocommerce_init',
function () {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', STOREGROWTH_FILE, true );
}
}
);
// Use the necessary namespace.
use StorePulse\StoreGrowth\DependencyManagement\Container;
// Declare the $dokan_container as global to access from the inside of the function.
global $storegrowth_container;
// Instantiate the container.
$storegrowth_container = new Container();
// Register the service providers.
$storegrowth_container->addServiceProvider( new \StorePulse\StoreGrowth\DependencyManagement\Providers\ServiceProvider() );
/**
* Get the container.
*
* @since 2.0.0
*
* @return Container The global container instance.
*/
function storegrowth_get_container(): Container {
global $storegrowth_container;
return $storegrowth_container;
}
/**
* Initialize the plugin functionality.
*
* @since 1.0.0
*
* @return Bootstrap
*/
function sp_store_growth(): Bootstrap {
return Bootstrap::instance();
}
// Load modules bootstrap files.
require_once STOREGROWTH_MODULE_DIR . '/bogo/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/countdown-timer/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/direct-checkout/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/floating-notification-bar/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/fly-cart/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/progressive-discount-banner/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/quick-view/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/sales-pop/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/stock-bar/bootstrap.php';
require_once STOREGROWTH_MODULE_DIR . '/upsell-order-bump/bootstrap.php';
// Load integrations bootstrap files.
require_once STOREGROWTH_DIR_PATH . '/integrations/bootstrap.php';
// Call initialization function.
sp_store_growth();