woocommerce/plugins/woocommerce-admin/woocommerce-admin.php

70 lines
2.0 KiB
PHP
Executable File

<?php
/**
* Plugin Name: WooCommerce Admin
* Plugin URI: https://github.com/woocommerce/woocommerce-admin
* 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
* Author URI: https://woocommerce.com/
* Text Domain: woocommerce-admin
* Domain Path: /languages
* Version: 1.2.3
* Requires at least: 5.3.0
* Requires PHP: 5.6.20
*
* WC requires at least: 3.6.0
* WC tested up to: 4.0.0
*
* @package WC_Admin
*/
defined( 'ABSPATH' ) || exit;
use \Automattic\WooCommerce\Admin\FeaturePlugin;
/**
* 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;
}
FeaturePlugin::instance()->init();