-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwoo-taxonomy-report.php
73 lines (61 loc) · 2.81 KB
/
woo-taxonomy-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
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
<?php
/**
*
* @package Woocommerce_Taxonomy_Report
* @author WooThemes <[email protected]>
* @license GPL-2.0+
* @link http://codeat.it
* @copyright 2016 GPL
*
* @wordpress-plugin
* Plugin Name: Woo Taxonomy Report
* Plugin URI: @TODO
* Description: Add any custom taxonomy to your WooCommerce reports, fully compatible with brands and vendors.
* Version: 1.0.3
* Author: Codeat
* Author URI: http://codeat.co/
* Text Domain: woo-taxonomy-report
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Domain Path: /languages
* WordPress-Plugin-Boilerplate-Powered: v1.1.7
*/
// If this file is called directly, abort.
if ( !defined( 'WPINC' ) ) {
die;
}
if ( !function_exists( 'woo_is_plugin_active' ) ) {
function woo_is_plugin_active() {
return in_array( 'woocommerce/woocommerce.php', ( array ) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( 'woocommerce/woocommerce.php' );
}
}
/* Check if WooCommerce is active */
if ( woo_is_plugin_active() ) {
/*
* Load library for simple and fast creation of Taxonomy
*/
require_once( plugin_dir_path( __FILE__ ) . 'includes/Taxonomy_Core/Taxonomy_Core.php' );
require_once( plugin_dir_path( __FILE__ ) . 'includes/Widgets-Helper/wph-widget-class.php' );
require_once( plugin_dir_path( __FILE__ ) . 'includes/widgets/wc_tax.php' );
require_once( plugin_dir_path( __FILE__ ) . 'public/class-woo-taxonomy-report.php' );
/*
* - 9999 is used for load the plugin as last for resolve some
* problems when the plugin use API of other plugins, remove
* if you don' want this
*/
add_action( 'plugins_loaded', array( 'Woo_Taxonomy_Report', 'get_instance' ), 9999 );
/*
* -----------------------------------------------------------------------------
* Dashboard and Administrative Functionality
* -----------------------------------------------------------------------------
*/
if ( is_admin() ) {
require_once( plugin_dir_path( __FILE__ ) . 'admin/includes/WP-Dismissible-Notices-Handler/handler.php' );
require_once( plugin_dir_path( __FILE__ ) . 'admin/includes/WP_Review_Me.php' );
new WP_Review_Me( array( 'days_after' => 10, 'type' => 'plugin', 'slug' => 'woo-taxonomy-report', 'message' => __( 'Hey! It\'s been a little while that you\'ve been using WooCommerce Taxonomy Report. You might not realize it, but user reviews are such a great help to us. We would be so grateful if you could take a minute to leave a review on WordPress.org.<br>Many thanks in advance :)<br>', 'woo-taxonomy-report' ) ) );
if ( (!defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'admin/class-woo-taxonomy-report-admin.php' );
add_action( 'plugins_loaded', array( 'Woo_Taxonomy_Report_Admin', 'get_instance' ) );
}
}
}