-
Notifications
You must be signed in to change notification settings - Fork 1
/
woo2yml-yandex-market.php
75 lines (58 loc) · 2.62 KB
/
woo2yml-yandex-market.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
<?php
/**
* Plugin Name: WooCommerce items export to YML
* Plugin URI: https://github.com/mvandrew/woo2yml-yandex-market
* Version: 1.0.0
* Description: WordPress plugin for exporting WooCommerce items to the Yandex Market YML format.
* Author: Andrey Mishchenko
* Tested up to: 4.8
* Author URI: http://www.msav.ru/
* Text Domain: woo2yml-yandex-market
* Domain Path: /languages/
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
* @package woo2yml-yandex-market
* @author Andrey Mishchenko
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Check if WooCommerce is active
**/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
// ------------------------------------------
// Define Plugin Text Domain
// ------------------------------------------
define( 'WOO2YML_YM__TEXT_DOMAIN', 'woo2yml-yandex-market' );
// ------------------------------------------
// Determining the plugin version.
// ------------------------------------------
$plugin_data = get_plugin_data( __FILE__ );
define( 'WOO2YML_YM__VERSION', $plugin_data['Version']);
// ------------------------------------------
// Plugin Paths
// ------------------------------------------
define( 'WOO2YML_YM__PLUGIN_DIR', dirname( __FILE__ ) );
define( 'WOO2YML_YM__INCLUDES_DIR', WOO2YML_YM__PLUGIN_DIR . '/includes' );
define( 'WOO2YML_YM__ADMIN_DIR', WOO2YML_YM__INCLUDES_DIR . '/admin' );
define( 'WOO2YML_YM__COMMON_DIR', WOO2YML_YM__INCLUDES_DIR . '/common' );
define( 'WOO2YML_YM__HELPERS_DIR', WOO2YML_YM__INCLUDES_DIR . '/helpers' );
// ------------------------------------------
// Include library files
// ------------------------------------------
require_once ( WOO2YML_YM__INCLUDES_DIR . '/plugin-hooks.php' );
// ------------------------------------------
// Include helper classes
// ------------------------------------------
require_once ( WOO2YML_YM__HELPERS_DIR . '/class-woo2yml-yandex-market-i18n.php' );
// ------------------------------------------
// Include common classes
// ------------------------------------------
require_once ( WOO2YML_YM__COMMON_DIR . '/class-woo2yml-yandex-market-core.php' );
// ------------------------------------------
// Include admin classes
// ------------------------------------------
if ( is_admin() ) {
require_once ( WOO2YML_YM__ADMIN_DIR . '/class-woo2yml-yandex-market-admin.php' );
}
}