forked from clerkio/clerk-woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clerk.php
70 lines (61 loc) · 2.07 KB
/
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
<?php
/**
* Plugin Name: Clerk
* Plugin URI: https://clerk.io/
* Description: Clerk.io Turns More Browsers Into Buyers
* Version: 3.5.2
* Author: Clerk.io
* Author URI: https://clerk.io
*
* Text Domain: clerk
* Domain Path: /i18n/languages/
* License: MIT
*
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Clerk' ) ) {
class Clerk {
public function __construct() {
$this->includes();
$this->initHooks();
if ( ! defined( 'CLERK_PLUGIN_FILE' ) ) {
define( 'CLERK_PLUGIN_FILE', __FILE__ );
}
}
private function includes() {
//Backend
require_once( __DIR__ . '/includes/class-clerk-admin-settings.php' );
require_once( __DIR__ . '/includes/class-clerk-product-sync.php' );
require_once( __DIR__ . '/includes/class-clerk-rest-api.php' );
require_once( __DIR__ . '/includes/clerk-legacy-helpers.php' );
require_once( __DIR__ . '/includes/class-clerk-logger.php' );
//Frontend
require_once( __DIR__ . '/includes/clerk-template-functions.php' );
require_once( __DIR__ . '/includes/class-clerk-visitor-tracking.php' );
require_once( __DIR__ . '/includes/class-clerk-sales-tracking.php' );
require_once( __DIR__ . '/includes/class-clerk-search.php' );
require_once( __DIR__ . '/includes/widgets/class-clerk-widget-search.php' );
require_once( __DIR__ . '/includes/widgets/class-clerk-widget-content.php' );
require_once( __DIR__ . '/includes/class-clerk-powerstep.php' );
require_once( __DIR__ . '/includes/class-clerk-basket.php' );
require_once( __DIR__ . '/includes/class-clerk-exit-intent.php' );
require_once( __DIR__ . '/includes/class-clerk-content.php' );
}
/**
* Set up hooks
*/
private function initHooks() {
//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();