-
Notifications
You must be signed in to change notification settings - Fork 19
/
class-clerk.php
92 lines (82 loc) · 2.33 KB
/
class-clerk.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
<?php
/**
* Plugin Name: Clerk
* Plugin URI: https://clerk.io/
* Description: Clerk.io Turns More Browsers Into Buyers
* Version: 4.1.9
* Author: Clerk.io
* Author URI: https://clerk.io
*
* Text Domain: clerk
* Domain Path: /i18n/languages/
* License: MIT
*
* @package clerkio/clerk-woocommerce
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Clerk' ) ) {
/**
* Clerk Class
*
* Clerk Module Core Class
*
* @since 1.0.0
*/
class Clerk {
/**
* Clerk class constructor.
*/
public function __construct() {
$this->includes();
$this->init_hooks();
if ( ! defined( 'CLERK_PLUGIN_FILE' ) ) {
define( 'CLERK_PLUGIN_FILE', __FILE__ );
}
}
/**
* Include front end controllers
*/
private function includes() {
// Backend.
include_once __DIR__ . '/includes/class-clerk-admin-settings.php';
include_once __DIR__ . '/includes/class-clerk-realtime-updates.php';
include_once __DIR__ . '/includes/class-clerk-rest-api.php';
include_once __DIR__ . '/includes/clerk-legacy-helpers.php';
include_once __DIR__ . '/includes/class-clerk-logger.php';
include_once __DIR__ . '/includes/clerk-multi-lang-helpers.php';
// Frontend.
include_once __DIR__ . '/includes/clerk-template-functions.php';
include_once __DIR__ . '/includes/class-clerk-visitor-tracking.php';
include_once __DIR__ . '/includes/class-clerk-sales-tracking.php';
include_once __DIR__ . '/includes/class-clerk-search.php';
include_once __DIR__ . '/includes/widgets/class-clerk-widget-search.php';
include_once __DIR__ . '/includes/widgets/class-clerk-widget-content.php';
include_once __DIR__ . '/includes/class-clerk-powerstep.php';
include_once __DIR__ . '/includes/class-clerk-basket.php';
include_once __DIR__ . '/includes/class-clerk-exit-intent.php';
include_once __DIR__ . '/includes/class-clerk-content.php';
}
/**
* Set up hooks
*/
private function init_hooks() {
// Register widgets.
add_action(
'widgets_init',
function () {
register_widget( 'Clerk_Widget_Search' );
register_widget( 'Clerk_Widget_Content' );
}
);
add_action(
'plugins_loaded',
function () {
load_plugin_textdomain( 'clerk', false, plugin_basename( dirname( __FILE__ ) ) . '/i18n/languages' );
}
);
}
}
}
new Clerk();