49 linhas
2 KiB
PHP
49 linhas
2 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Interweb Angola All in One AI
|
|
* Description: All in One AI for WordPress and WooCommerce: a chat assistant on the site, a "Write with AI" box for product descriptions, pages and posts, and new drafts from a few words. Uses only the public API, with your key.
|
|
* Version: 1.0.0
|
|
* Requires at least: 6.0
|
|
* Requires PHP: 7.4
|
|
* Author: API Center
|
|
* License: MIT
|
|
* Text Domain: interweb-ao-ai
|
|
* Domain Path: /languages
|
|
* WC requires at least: 7.0
|
|
* WC tested up to: 11.3
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
define('INTERWEB_AO_AI_VERSION', '1.0.0');
|
|
define('INTERWEB_AO_AI_FILE', __FILE__);
|
|
define('INTERWEB_AO_AI_DIR', plugin_dir_path(__FILE__));
|
|
define('INTERWEB_AO_AI_URL', plugin_dir_url(__FILE__));
|
|
define('INTERWEB_AO_AI_SLUG', 'interweb-ao-ai');
|
|
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-i18n.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-brands.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-crypto.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-settings.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-api.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-log.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-assistant.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-writer.php';
|
|
require_once INTERWEB_AO_AI_DIR . 'includes/class-admin.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', INTERWEB_AO_AI_FILE, true);
|
|
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', INTERWEB_AO_AI_FILE, true);
|
|
}
|
|
});
|
|
|
|
INTERWEB_AO_AI_I18n::init();
|
|
INTERWEB_AO_AI_Assistant::init();
|
|
INTERWEB_AO_AI_Writer::init();
|
|
if (is_admin()) {
|
|
INTERWEB_AO_AI_Admin::init();
|
|
}
|