Vigiar
1
0
Derivar
Você já tinha feito uma derivação do repositório woocommerce-reseller-plugin, anteriormente
0
woocommerce-reseller-plugin/mozout-reseller/mozout-reseller.php

75 linhas
3,3 KiB
PHP

<?php
/**
* Plugin Name: MozOut Reseller for WooCommerce
* Description: Sell domains, hosting, servers and SMS credits with WooCommerce. When an order is paid, the plugin registers, transfers or creates the service through the API, follows its state, handles renewals and emails your customer. Uses only the public API, with your key.
* Version: 1.0.1
* Requires at least: 6.0
* Requires PHP: 7.4
* Plugin URI: https://git.mozout.com/mozout-com/woocommerce-reseller-plugin
* Author: MozOut
* Author URI: https://www.mozout.com
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: mozout-reseller
* Domain Path: /languages
* Requires Plugins: woocommerce
* WC requires at least: 7.0
* WC tested up to: 11.3
*/
if (!defined('ABSPATH')) {
exit;
}
define('MOZOUT_RESELLER_VERSION', '1.0.1');
define('MOZOUT_RESELLER_FILE', __FILE__);
define('MOZOUT_RESELLER_DIR', plugin_dir_path(__FILE__));
define('MOZOUT_RESELLER_URL', plugin_dir_url(__FILE__));
define('MOZOUT_RESELLER_SLUG', 'mozout-reseller');
require_once MOZOUT_RESELLER_DIR . 'includes/class-i18n.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-brands.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-crypto.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-settings.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-api.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-log.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-admin-base.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-admin.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-catalog.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-product.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-emails.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-fulfil.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-renew.php';
require_once MOZOUT_RESELLER_DIR . 'includes/class-account.php';
// WooCommerce: this plugin works with the order tables (HPOS) and with the cart and checkout blocks.
add_action('before_woocommerce_init', function () {
if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', MOZOUT_RESELLER_FILE, true);
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', MOZOUT_RESELLER_FILE, true);
}
});
register_activation_hook(__FILE__, array('MOZOUT_RESELLER_Fulfil', 'activate'));
register_deactivation_hook(__FILE__, array('MOZOUT_RESELLER_Fulfil', 'deactivate'));
MOZOUT_RESELLER_I18n::init();
add_action('plugins_loaded', function () {
if (!class_exists('WooCommerce')) {
if (is_admin()) {
add_action('admin_notices', function () {
if (current_user_can('activate_plugins')) {
echo '<div class="notice notice-warning"><p>' . esc_html__('MozOut Reseller for WooCommerce needs WooCommerce to be active.', 'mozout-reseller') . '</p></div>';
}
});
}
return;
}
MOZOUT_RESELLER_Product::init();
MOZOUT_RESELLER_Fulfil::init();
MOZOUT_RESELLER_Renew::init();
MOZOUT_RESELLER_Account::init();
if (is_admin()) {
MOZOUT_RESELLER_Admin::init();
}
}, 20);