2018-04-17 21:03:14 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2018-07-10 12:48:06 +00:00
|
|
|
* Plugin Name: WooCommerce Admin
|
2019-03-13 17:14:02 +00:00
|
|
|
* Plugin URI: https://github.com/woocommerce/woocommerce-admin
|
2019-03-08 16:20:42 +00:00
|
|
|
* Description: A new JavaScript-driven interface for managing your store. The plugin includes new and improved reports, and a dashboard to monitor all the important key metrics of your site.
|
|
|
|
* Author: WooCommerce
|
2018-04-17 23:51:48 +00:00
|
|
|
* Author URI: https://woocommerce.com/
|
2019-03-13 17:14:02 +00:00
|
|
|
* Text Domain: woocommerce-admin
|
2018-04-17 23:51:48 +00:00
|
|
|
* Domain Path: /languages
|
2020-06-10 13:22:28 +00:00
|
|
|
* Version: 1.2.3
|
2019-12-13 15:05:41 +00:00
|
|
|
* Requires at least: 5.3.0
|
2019-07-23 03:26:46 +00:00
|
|
|
* Requires PHP: 5.6.20
|
2018-04-17 21:03:14 +00:00
|
|
|
*
|
2019-04-26 18:39:37 +00:00
|
|
|
* WC requires at least: 3.6.0
|
2020-03-12 14:38:03 +00:00
|
|
|
* WC tested up to: 4.0.0
|
2019-04-01 16:16:13 +00:00
|
|
|
*
|
2018-07-10 12:48:06 +00:00
|
|
|
* @package WC_Admin
|
2018-04-17 21:03:14 +00:00
|
|
|
*/
|
|
|
|
|
2019-05-14 14:34:16 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
2019-03-25 06:43:26 +00:00
|
|
|
|
2019-08-12 21:52:09 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\FeaturePlugin;
|
2019-07-31 19:47:32 +00:00
|
|
|
|
2019-07-29 18:04:17 +00:00
|
|
|
/**
|
|
|
|
* Autoload packages.
|
|
|
|
*
|
|
|
|
* We want to fail gracefully if `composer install` has not been executed yet, so we are checking for the autoloader.
|
|
|
|
* If the autoloader is not present, let's log the failure and display a nice admin notice.
|
|
|
|
*/
|
|
|
|
$autoloader = __DIR__ . '/vendor/autoload.php';
|
|
|
|
if ( is_readable( $autoloader ) ) {
|
|
|
|
require $autoloader;
|
|
|
|
} else {
|
|
|
|
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
|
|
|
error_log( // phpcs:ignore
|
|
|
|
sprintf(
|
|
|
|
/* translators: 1: composer command. 2: plugin directory */
|
|
|
|
esc_html__( 'Your installation of the WooCommerce Admin feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce-admin' ),
|
|
|
|
'`composer install`',
|
|
|
|
'`' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '`'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Outputs an admin notice if composer install has not been ran.
|
|
|
|
*/
|
|
|
|
add_action(
|
|
|
|
'admin_notices',
|
|
|
|
function() {
|
|
|
|
?>
|
|
|
|
<div class="notice notice-error">
|
|
|
|
<p>
|
|
|
|
<?php
|
|
|
|
printf(
|
|
|
|
/* translators: 1: composer command. 2: plugin directory */
|
|
|
|
esc_html__( 'Your installation of the WooCommerce Admin feature plugin is incomplete. Please run %1$s within the %2$s directory.', 'woocommerce-admin' ),
|
|
|
|
'<code>composer install</code>',
|
|
|
|
'<code>' . esc_html( str_replace( ABSPATH, '', __DIR__ ) ) . '</code>'
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-08-12 21:52:09 +00:00
|
|
|
FeaturePlugin::instance()->init();
|