42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Plugin Name: WooCow
|
||
|
|
* Description: Mailcow email hosting management for WooCommerce customers.
|
||
|
|
* Version: 1.0.0
|
||
|
|
* Author: WooCow
|
||
|
|
* Text Domain: woocow
|
||
|
|
* Requires at least: 6.2
|
||
|
|
* Requires PHP: 8.1
|
||
|
|
* WC requires at least: 7.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
defined( 'ABSPATH' ) || exit;
|
||
|
|
|
||
|
|
define( 'WOOCOW_VERSION', '1.0.0' );
|
||
|
|
define( 'WOOCOW_PLUGIN_FILE', __FILE__ );
|
||
|
|
define( 'WOOCOW_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||
|
|
define( 'WOOCOW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||
|
|
|
||
|
|
require_once WOOCOW_PLUGIN_DIR . 'includes/class-woocow-installer.php';
|
||
|
|
require_once WOOCOW_PLUGIN_DIR . 'includes/class-woocow-api.php';
|
||
|
|
require_once WOOCOW_PLUGIN_DIR . 'includes/class-woocow-admin.php';
|
||
|
|
require_once WOOCOW_PLUGIN_DIR . 'includes/class-woocow-account.php';
|
||
|
|
require_once WOOCOW_PLUGIN_DIR . 'includes/class-woocow-pw-sync.php';
|
||
|
|
|
||
|
|
register_activation_hook( __FILE__, [ 'WooCow_Installer', 'install' ] );
|
||
|
|
|
||
|
|
add_action( 'plugins_loaded', function () {
|
||
|
|
if ( ! class_exists( 'WooCommerce' ) ) {
|
||
|
|
add_action( 'admin_notices', function () {
|
||
|
|
printf(
|
||
|
|
'<div class="notice notice-error"><p>%s</p></div>',
|
||
|
|
esc_html__( 'WooCow requires WooCommerce to be installed and active.', 'woocow' )
|
||
|
|
);
|
||
|
|
} );
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
new WooCow_Admin();
|
||
|
|
new WooCow_Account();
|
||
|
|
new WooCow_PW_Sync();
|
||
|
|
} );
|