-
Notifications
You must be signed in to change notification settings - Fork 1
/
woo-sales-report.php
44 lines (37 loc) · 1.14 KB
/
woo-sales-report.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
<?php
/***
* Plugin Name: Sales Report Woo
* Plugin URI: https://github.com/kreelabs/woo-sales-report
* Description: All in one reporting plugin for WooCommerce.
* Version: 0.0.0
* Requires at least: 4.3
* Tested up to: 5.4
* WC requires at least: 3.6
* WC tested up to: 4.0
* Requires PHP: 5.6
* Stable tag: 0.0.0
* Author: KreeLabs
* Author URI: https://kreelabs.com
* Text Domain: woo-sales-report
* Domain Path: /languages
*
* Copyright (c) 2020 KreeLabs <[email protected]>.
*/
// Avoid direct calls to this file.
if ( ! defined('ABSPATH')) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
die('Access Forbidden');
}
define('WSR_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('WSR_EXPORT_LIMIT', 100);
require __DIR__ . '/vendor/autoload.php';
$wcReport = new \KreeLabs\WSR\Reports();
// Initialize admin section.
add_action('init', [$wcReport, 'initAdmin']);
// Check if required plugins are installed and activated.
add_action('plugins_loaded', function () use ($wcReport) {
if ( ! class_exists(WooCommerce::class)) {
add_action('admin_notices', [$wcReport, 'requirementsCheck']);
}
});