| 1 |
<?php |
| 2 |
/** |
| 3 |
* @link https://makecommerce.net/ |
| 4 |
* @since 4.0.0 |
| 5 |
* @package Makecommerce |
| 6 |
* |
| 7 |
* @wordpress-plugin |
| 8 |
* Plugin Name: MakeCommerce |
| 9 |
* Plugin URI: https://makecommerce.net/ |
| 10 |
* Description: Adds MakeCommerce payment gateway and shipping methods to WooCommerce checkout |
| 11 |
* Version: 4.0.0 |
| 12 |
* Author: Maksekeskus AS |
| 13 |
* Author URI: https://makecommerce.net/ |
| 14 |
* License: GPL-2.0+ |
| 15 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 16 |
* Text Domain: makecommerce |
| 17 |
* Domain Path: /languages |
| 18 |
* Requires Plugins: woocommerce |
| 19 |
* Requires at least: 6.8.1 |
| 20 |
* Requires PHP: 8.1 |
| 21 |
* WC requires at least: 9.9.3 |
| 22 |
* WC tested up to: 9.9.3 |
| 23 |
* WC HPOS compatibility: yes |
| 24 |
* WC Legacy Order Table Compatibility: yes |
| 25 |
*/ |
| 26 |
|
| 27 |
function mc_table_exists(string $table): bool { |
| 28 |
global $wpdb; |
| 29 |
$table_name = $wpdb->prefix . $table; |
| 30 |
return $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table_name)) === $table_name; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
if ( |
| 35 |
( |
| 36 |
get_option('mc_version') !== false || |
| 37 |
get_option('wc_mc_version') !== false || |
| 38 |
mc_table_exists('mc_banklinks') |
| 39 |
) && |
| 40 |
!filter_var(get_option('mc_shipping_plus'), FILTER_VALIDATE_BOOLEAN) |
| 41 |
) { |
| 42 |
require_once plugin_dir_path(__FILE__) . 'config.php'; |
| 43 |
} else { |
| 44 |
require_once plugin_dir_path(__FILE__) . 'makecommerce/makecommerce.php'; |
| 45 |
} |
| 46 |
|
| 47 |
|