Full WooCommerce plugin for aaPanel hosting management: - aaPanel API client (all website + database endpoints) - Admin: server management, site/DB assignments, full site/DB management panels - Customer My Account: web hosting tab with sites and databases - WooDomains PowerDNS integration for DNS management - WooCommerce order auto-provisioning (product → server linking) - Permission model: admin has all actions, customers have scoped access Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
46 lines
1.6 KiB
PHP
46 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: WooAApanel
|
|
* Description: aaPanel web hosting management for WooCommerce customers. Manage sites, databases and DNS records.
|
|
* Version: 1.0.0
|
|
* Author: WooAApanel
|
|
* Text Domain: wooaapanel
|
|
* Requires at least: 6.2
|
|
* Requires PHP: 8.1
|
|
* WC requires at least: 7.0
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
define( 'WOOAAPANEL_VERSION', '1.0.0' );
|
|
define( 'WOOAAPANEL_PLUGIN_FILE', __FILE__ );
|
|
define( 'WOOAAPANEL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'WOOAAPANEL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
|
|
require_once WOOAAPANEL_PLUGIN_DIR . 'includes/class-wooaapanel-installer.php';
|
|
require_once WOOAAPANEL_PLUGIN_DIR . 'includes/class-wooaapanel-api.php';
|
|
require_once WOOAAPANEL_PLUGIN_DIR . 'includes/class-wooaapanel-admin.php';
|
|
require_once WOOAAPANEL_PLUGIN_DIR . 'includes/class-wooaapanel-account.php';
|
|
require_once WOOAAPANEL_PLUGIN_DIR . 'includes/class-wooaapanel-orders.php';
|
|
|
|
register_activation_hook( __FILE__, [ 'WooAApanel_Installer', 'install' ] );
|
|
|
|
add_action( 'init', function () {
|
|
load_plugin_textdomain( 'wooaapanel', false, dirname( plugin_basename( WOOAAPANEL_PLUGIN_FILE ) ) . '/languages' );
|
|
} );
|
|
|
|
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__( 'WooAApanel requires WooCommerce to be installed and active.', 'wooaapanel' )
|
|
);
|
|
} );
|
|
return;
|
|
}
|
|
new WooAApanel_Admin();
|
|
new WooAApanel_Account();
|
|
new WooAApanel_Orders();
|
|
} );
|