-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshoppingfeed.php
69 lines (58 loc) · 2.47 KB
/
shoppingfeed.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
<?php
/**
* Plugin Name: ShoppingFeed
* Plugin URI: https://wordpress.org/plugins/shopping-feed/
* Description: WordPress connection Controller Plugin for ShoppingFeed - Sell on Amazon, Ebay, Google, and 1000's of international marketplaces
* Author: Shopping-Feed
* Author URI: https://www.shopping-feed.com/
* Text Domain: shopping-feed
* Domain Path: /languages
* Version: 6.10.0
* Requires at least: 5.7
* Requires PHP: 7.3
* WC requires at least: 5.1.0
* WC tested up to: 9.6.0
* License: GPLv3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
namespace ShoppingFeed\ShoppingFeedWC;
// Exit on direct access
defined( 'ABSPATH' ) || exit;
// Load composer autoload
if ( file_exists( plugin_dir_path( __FILE__ ) . '/vendor/autoload.php' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';
}
define( 'SF_VERSION', '6.10.0' );
define( 'SF_DB_VERSION_SLUG', 'SF_DB_VERSION' );
define( 'SF_DB_VERSION', '1.0.0' );
define( 'SF_UPGRADE_RUNNING', 'SF_UPGRADE_RUNNING' );
define( 'SF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'SF_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( 'SF_FEED_DIR', wp_upload_dir()['basedir'] . '/shopping-feed' );
define( 'SF_FEED_PARTS_DIR', SF_FEED_DIR . '/parts' );
// Plugin activate/deactivate hooks
register_activation_hook( __FILE__, array( '\\ShoppingFeed\ShoppingFeedWC\ShoppingFeed', 'activate' ) );
register_deactivation_hook( __FILE__, array( '\\ShoppingFeed\ShoppingFeedWC\ShoppingFeed', 'deactivate' ) );
/**
* Plugin bootstrap function.shopping-feed/src/ShoppingFeed.php
*/
function init() {
load_plugin_textdomain( 'shopping-feed', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
ShoppingFeed::get_instance();
if ( ! defined( 'WP_CLI' ) ) {
return;
}
//Add CLI command for Feed Generation
\WP_CLI::add_command( 'shopping-feed feed-generation', '\\ShoppingFeed\ShoppingFeedWC\Cli\FeedGeneration' );
}
\add_action( 'plugins_loaded', __NAMESPACE__ . '\\init', 100 );
// Declare the plugin compatibility with High Performance Order Storage
\add_action(
'before_woocommerce_init',
function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
}
);