forked from liquidweb/woo-cart-expiration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
woo-cart-expiration.php
71 lines (55 loc) · 2.07 KB
/
woo-cart-expiration.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
<?php
/**
* Plugin Name: WooCommerce Cart Expiration
* Plugin URI: https://github.com/liquidweb/woo-cart-expiration
* Description: Set a time limit on a customer checking out.
* Version: 0.2.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: woo-cart-expiration
* Domain Path: /languages
* License: MIT
* License URI: https://opensource.org/licenses/MIT
*
* @package WooCartExpiration
*/
// Declare our namespace.
namespace LiquidWeb\WooCartExpiration;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
// Define our plugin version.
define( __NAMESPACE__ . '\VERS', '0.2.0' );
// Plugin root file.
define( __NAMESPACE__ . '\FILE', __FILE__ );
// Define our file base.
define( __NAMESPACE__ . '\BASE', plugin_basename( __FILE__ ) );
// Plugin Folder URL.
define( __NAMESPACE__ . '\URL', plugin_dir_url( __FILE__ ) );
// Set our assets directory constant.
define( __NAMESPACE__ . '\ASSETS_URL', URL . 'assets' );
// Set the prefix for our actions and filters.
define( __NAMESPACE__ . '\HOOK_PREFIX', 'woo_cart_expiration_' );
// Set the prefix for our options.
define( __NAMESPACE__ . '\OPTIONS_PREFIX', 'woo_cart_expiration_opt_' );
// Set the prefix for our cookie.
define( __NAMESPACE__ . '\COOKIE_NAME', 'woo_cart_expiration' );
// Set the name for our settings anchor.
define( __NAMESPACE__ . '\SETTINGS_ANCHOR', 'woo-cart-expiration-settings' );
// Load our multi-use files.
require_once __DIR__ . '/includes/cookies.php';
require_once __DIR__ . '/includes/utilities.php';
require_once __DIR__ . '/includes/markup.php';
require_once __DIR__ . '/includes/display.php';
require_once __DIR__ . '/includes/ajax-actions.php';
// Load the triggered file loads.
require_once __DIR__ . '/includes/activate.php';
require_once __DIR__ . '/includes/deactivate.php';
require_once __DIR__ . '/includes/uninstall.php';
// Load our admin side function files.
if ( is_admin() ) {
require_once __DIR__ . '/includes/settings-tab.php';
}
// Load our front-end actions.
if ( ! is_admin() ) {
require_once __DIR__ . '/includes/cart-actions.php';
}