| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: SuperFrete |
| 4 |
Description: Plugin that provides integration with the SuperFrete platform. |
| 5 |
Version: 3.3.4 |
| 6 |
Author: Super Frete |
| 7 |
Author URI: https://superfrete.com/ |
| 8 |
Text Domain: superfrete |
| 9 |
License: GPLv2 or later |
| 10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 |
Requires at least: 5.0 |
| 12 |
Tested up to: 6.8.1 |
| 13 |
Requires PHP: 7.4 |
| 14 |
WC requires at least: 3.0 |
| 15 |
WC tested up to: 9.4 |
| 16 |
*/ |
| 17 |
if (!defined('ABSPATH')) { |
| 18 |
exit; // Segurança para evitar acesso direto |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
// Inclui a classe principal do plugin |
| 23 |
include_once __DIR__ . '/app/App.php'; |
| 24 |
|
| 25 |
// Inicializa o plugin |
| 26 |
new SuperFrete_API\App(); |
| 27 |
|
| 28 |
|
| 29 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), ['SuperFrete_API\App', 'superfrete_add_settings_link']); |
| 30 |
|
| 31 |
// Declare compatibility with WooCommerce High-Performance Order Storage (HPOS) |
| 32 |
// Only declare HPOS compatibility if WooCommerce version supports it (8.2+) |
| 33 |
add_action('before_woocommerce_init', function() { |
| 34 |
if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) { |
| 35 |
// Check if WooCommerce version supports HPOS (8.2+) |
| 36 |
if (defined('WC_VERSION') && version_compare(WC_VERSION, '8.2', '>=')) { |
| 37 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); |
| 38 |
} |
| 39 |
} |
| 40 |
}); |
| 41 |
|