From f6c8d874f65e6589cec6027342606378fc1945a0 Mon Sep 17 00:00:00 2001 From: Ivan Petak Date: Tue, 29 Aug 2023 10:42:51 +0200 Subject: [PATCH] Test HPOS and new versions of WC and WP --- readme.txt | 7 +++++-- woocommerce-gateway-kekspay.php | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 69e2285..43b4f25 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: erstebank Tags: kekspay, woocommerce, gateway, payment Requires at least: 5.0 -Tested up to: 6.1 +Tested up to: 6.3 Requires PHP: 7.2 -Stable tag: 1.0.12 +Stable tag: 1.0.13 License: GPL v3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -49,6 +49,9 @@ For more installation options check the [official WordPress documentation](https == Changelog == += 1.0.13 = +* Declare compatibility with HPOS. + = 1.0.12 = * Raise QR Code Level 5 => 6. diff --git a/woocommerce-gateway-kekspay.php b/woocommerce-gateway-kekspay.php index 840891f..b1d680f 100644 --- a/woocommerce-gateway-kekspay.php +++ b/woocommerce-gateway-kekspay.php @@ -3,7 +3,7 @@ * Plugin Name: KEKS Pay for WooCommerce * Plugin URI: https://www.kekspay.hr/ * Description: Incredible fast and user friendly payment method created by Erste Bank Croatia. - * Version: 1.0.12 + * Version: 1.0.13 * Requires at least: 5.0 * Requires PHP: 7.2 * Author: Erste bank Croatia @@ -14,7 +14,7 @@ * Domain Path: /languages * * WC requires at least: 3.3 - * WC tested up to: 7.2 + * WC tested up to: 8.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -54,6 +54,19 @@ function kekspay_admin_notice_missing_woocommerce() { return; } +/** + * Declare Kekspay plugin compatible with HPOS. + * + * @return void + */ +function kekspay_hpos_compatible() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); + } +} +add_action( 'before_woocommerce_init', 'kekspay_hpos_compatible' ); + + if ( ! class_exists( 'WC_Kekspay' ) ) { /** * The main plugin class. @@ -128,7 +141,7 @@ public static function register_constants() { define( 'KEKSPAY_PLUGIN_ID', 'erste-kekspay-woocommerce' ); } if ( ! defined( 'KEKSPAY_PLUGIN_VERSION' ) ) { - define( 'KEKSPAY_PLUGIN_VERSION', '1.0.12' ); + define( 'KEKSPAY_PLUGIN_VERSION', '1.0.13' ); } if ( ! defined( 'KEKSPAY_DIR_PATH' ) ) { define( 'KEKSPAY_DIR_PATH', plugin_dir_path( __FILE__ ) );