<?php defined( 'ABSPATH' ) or die( 'No fankari bachay!' );
/*
Plugin Name: Export Import For WooCommerce
Plugin URI: http://androidbubble.com/blog/export-import-for-woocommerce
Description: Woo Commerce Import Export Tool
Author: Fahad Mahmood
Version: 1.2.7
Text Domain: woo-ie
Domain Path: /languages
Author URI: https://profiles.wordpress.org/fahadmahmood/
License: GPL2
	
This WordPress Plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version. This free software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this software. If not, see http://www.gnu.org/licenses/gpl-2.0.html.	
*/

	require_once(ABSPATH . 'wp-admin/includes/upgrade.php');

	if(!function_exists('pre')){
		function pre($data){
			if(isset($_GET['debug'])){
				pree($data);
			}
		}	 
	} 	
	if(!function_exists('pree')){
		function pree($data){
			echo '<pre>';
			print_r($data);
			echo '</pre>';			
		}	 
	}



	
	global $woie_data, $woie_pro, $woie_premium_link, $woie_dir, $woie_levels, $woie_versions_type, $woie_url, $icon_sub_path, $woie_options, $woie_settings_url, $woie_orders_data_file, $woie_filter_meta_keys;
	
	$woie_data = get_plugin_data(__FILE__, true, false);
	$woie_dir = plugin_dir_path( __FILE__ );
    $woie_url = plugin_dir_url( __FILE__ );
	$woie_settings_url = admin_url('admin.php?page=woie-settings');
	$woie_versions_type = get_option('woie_versions_type', 'old');
    $icon_sub_path = 'img/filetype-icons/';
    $woie_options = get_option('woie_options', array());
	
	$upload_dir   = wp_upload_dir();
	
	$filename = 'orders_data.xlsx';
	$woie_orders_data_file_url = $upload_dir['baseurl'].'/'.$filename;
	$woie_orders_data_file = $upload_dir['basedir'].'/'.$filename;
	
	$woie_filter_meta_keys = get_option('woie_filter_meta_keys', array());
	$woie_filter_meta_keys = (is_array($woie_filter_meta_keys)?$woie_filter_meta_keys:array());


    $woie_premium_link = 'https://shop.androidbubbles.com/product/export-import-for-wc';//https://shop.androidbubble.com/products/wordpress-plugin?variant=36439507796123';//

    if(!class_exists('Woo_Import_Export')){
        include_once 'inc/Woo_Import_Export.php';
    }

    $woo_ie_object = new Woo_Import_Export();
	
	$woie_pro_file = $woie_dir.'pro/woie-pro.php';


	
    $woie_pro = file_exists($woie_pro_file);
    if($woie_pro){
        include($woie_pro_file);
    }	
	
	include_once('inc/functions.php');

	if(is_admin()){
		$plugin = plugin_basename(__FILE__); 
		add_filter("plugin_action_links_$plugin", 'woie_plugin_links' );
	}
	