| @@ -1,62 +1,42 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Plugin Name: seQura | |
| 4 | - * Plugin URI: https://sequra.es/ | |
| 5 | - * Description: Ofrece las opciones de pago con seQura | |
| 6 | - * Version: 2.0.5 | |
| 7 | - * Author: "seQura Tech" <dev+wordpress@sequra.es> | |
| 8 | - * Author URI: https://engineering.sequra.es/ | |
| 9 | - * WC requires at least: 4.0 | |
| 10 | - * WC tested up to: 8.2 | |
| 11 | - * Text Domain: sequra | |
| 12 | - * Domain Path: /i18n/languages/ | |
| 13 | - * Requires at least: 5.9 | |
| 14 | - * Requires PHP: 7.3 | |
| 3 | + * The plugin bootstrap file | |
| 15 | 4 | * |
| 16 | - * Copyright (C) 2023 seQura Tech | |
| 5 | + * @package SeQura/WC | |
| 17 | 6 | * |
| 18 | - * License: GPL v3 | |
| 19 | - * | |
| 20 | - * This program is free software: you can redistribute it and/or modify | |
| 21 | - * it under the terms of the GNU General Public License as published by | |
| 22 | - * the Free Software Foundation, either version 3 of the License, or | |
| 23 | - * (at your option) any later version. | |
| 24 | - * | |
| 25 | - * This program is distributed in the hope that it will be useful, | |
| 26 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 27 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 28 | - * GNU General Public License for more details. | |
| 29 | - * | |
| 30 | - * You should have received a copy of the GNU General Public License | |
| 31 | - * along with this program. If not, see <http://www.gnu.org/licenses/> | |
| 32 | - * | |
| 33 | - * @package sequra | |
| 7 | + * @wordpress-plugin | |
| 8 | + * Plugin Name: seQura | |
| 9 | + * Plugin URI: https://sequra.es/ | |
| 10 | + * Description: seQura payment gateway for WooCommerce | |
| 11 | + * Version: 4.3.0 | |
| 12 | + * Author: "seQura Tech" <wordpress@sequra.com> | |
| 13 | + * Author URI: https://sequra.com/ | |
| 14 | + * License: GPL-3.0+ | |
| 15 | + * License URI: https://www.gnu.org/licenses/gpl-3.0.txt | |
| 16 | + * Text Domain: sequra | |
| 17 | + * Domain Path: /languages | |
| 18 | + * Requires PHP: 7.3 | |
| 19 | + * Requires at least: 5.9 | |
| 20 | + * Tested up to: 6.9.4 | |
| 21 | + * WC requires at least: 4.7.0 | |
| 22 | + * WC tested up to: 10.6.0 | |
| 23 | + * Requires Plugins: woocommerce | |
| 34 | 24 | */ |
| 35 | 25 | |
| 36 | -// Make sure old WooCommerce seQura is not installed. | |
| 37 | -if ( ! defined( 'WC_SEQURA_PLG_PATH' ) && ! file_exists( WP_PLUGIN_DIR . '/woocommerce-sequra' ) && ! file_exists( WP_PLUGIN_DIR . '/woocommerce-sequracheckout' ) ) { | |
| 38 | - define( 'SEQURA_VERSION', '2.0.5' ); | |
| 39 | - define( 'WC_SEQURA_PLG_PATH', WP_PLUGIN_DIR . '/' . basename( plugin_dir_path( __FILE__ ) ) . '/' ); | |
| 40 | - define( 'SEQURA_SIGNUP_URL', 'https://share.hsforms.com/1J2S1J2NPTi-pZERcgJPOVw1c4yg' ); | |
| 41 | - add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'sequrapayment_action_links' ); | |
| 42 | - register_activation_hook( __FILE__, 'sequra_activation' ); | |
| 43 | - require_once WC_SEQURA_PLG_PATH . 'gateway-sequra.php'; | |
| 44 | -} else { | |
| 45 | - add_action( | |
| 46 | - 'admin_notices', | |
| 47 | - function () { | |
| 48 | - echo '<div id="message" class="error"><p>' . esc_html( __( 'Please, remove any previously installed seQura plugins from WooCommerce', 'sequra' ) ) . '</p></div>'; | |
| 49 | - } | |
| 50 | - ); | |
| 51 | -} | |
| 26 | +defined( 'WPINC' ) || die; | |
| 52 | 27 | |
| 53 | -/** | |
| 54 | - * Declare compatibility with WC HPOS. | |
| 55 | - * | |
| 56 | - * @return void | |
| 57 | - */ | |
| 58 | -add_action( 'before_woocommerce_init', function() { | |
| 59 | - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { | |
| 60 | - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); | |
| 28 | +require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; | |
| 29 | + | |
| 30 | +call_user_func( | |
| 31 | + function () { | |
| 32 | + \SeQura\WC\Bootstrap::init(); | |
| 33 | + /** | |
| 34 | + * The instance of the plugin. | |
| 35 | + * | |
| 36 | + * @var \SeQura\WC\Plugin $plugin | |
| 37 | + */ | |
| 38 | + $plugin = \SeQura\Core\Infrastructure\ServiceRegister::getService( \SeQura\WC\Plugin::class ); | |
| 39 | + register_activation_hook( __FILE__, array( $plugin, 'activate' ) ); | |
| 40 | + register_deactivation_hook( __FILE__, array( $plugin, 'deactivate' ) ); | |
| 61 | 41 | } |
| 62 | -} ); | |
| 42 | +); | |