Skip to content

Commit

Permalink
Merge pull request #9 from somewherewarm/bump-minimum-required-versions
Browse files Browse the repository at this point in the history
Bumped minimum required versions and declared HPOS support
  • Loading branch information
jimjasson authored Jul 30, 2024
2 parents 28bbcc5 + c4a007e commit 9bed010
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
35 changes: 26 additions & 9 deletions gift-cards-coupon-input.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
* Plugin Name: Gift Cards - Coupon Input
* Plugin URI: https://woocommerce.com/products/gift-cards
* Description: Mini-extension for WooCommerce Gift Cards that allows you to use the default coupon form to apply and redeem gift cards.
* Version: 1.0.3
* Version: 2.0.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.com/
*
* Text Domain: woocommerce-gift-cards-coupon-input
* Domain Path: /languages/
*
* Requires at least: 4.4
* Tested up to: 6.3
* Requires at least: 6.2
* Tested up to: 6.6
*
* WC requires at least: 3.3
* WC tested up to: 8.2
* WC requires at least: 8.2
* WC tested up to: 9.1
*
* Copyright: © 2017-2023 SomewhereWarm SMPC.
* Copyright: © 2017-2024 SomewhereWarm SMPC.
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand All @@ -30,7 +30,7 @@
* Main plugin class.
*
* @class WC_GC_Coupon_Input
* @version 1.0.3
* @version 2.0.0
*/
class WC_GC_Coupon_Input {

Expand All @@ -39,14 +39,14 @@ class WC_GC_Coupon_Input {
*
* @var string
*/
public static $version = '1.0.3';
public static $version = '2.0.0';

/**
* Min required GC version.
*
* @var string
*/
public static $req_gc_version = '1.1.5';
public static $req_gc_version = '2.0';

/**
* GC URL.
Expand Down Expand Up @@ -96,6 +96,9 @@ public static function load_plugin() {
// Declare Blocks incompatibility.
add_action( 'before_woocommerce_init', array( __CLASS__, 'declare_blocks_compatibility' ) );

// Declare HPOS incompatibility.
add_action( 'before_woocommerce_init', array( __CLASS__, 'declare_hpos_compatibility' ) );

// Remove GC native form.
if ( version_compare( WC_GC()->get_plugin_version( true ), '1.7.0' ) < 0 ) {
remove_action( 'woocommerce_proceed_to_checkout', array( WC_GC()->cart, 'display_form' ), 9 );
Expand Down Expand Up @@ -139,6 +142,20 @@ public static function declare_blocks_compatibility() {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', plugin_basename( __FILE__ ), false );
}

/**
* Declare HPOS incompatibility.
*
* @since 2.0.0
*/
public static function declare_hpos_compatibility() {

if ( ! class_exists( 'Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
return;
}

\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', plugin_basename( __FILE__ ), true );
}

/**
* Extend the coupon input AJAX endpoint.
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "woocommerce-gift-cards-coupon-input",
"title": "Gift Cards - Coupon Input",
"version": "1.0.3",
"version": "2.0.0",
"homepage": "https://woocommerce.com/products/gift-cards/",
"license": "GPL-3.0+",
"repository": {
Expand Down
21 changes: 14 additions & 7 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=== Gift Cards - Coupon Input ===

Contributors: SomewhereWarm, franticpsyx, xristos3490
Contributors: automattic, woocommerce, SomewhereWarm
Tags: woocommerce, gift, cards, coupon, input
Requires at least: 4.4
Tested up to: 6.3
Stable tag: 1.0.3
Requires PHP: 5.6
WC requires at least: 3.3
WC tested up to: 8.2
Requires at least: 6.2
Tested up to: 6.6
Stable tag: 2.0.0
Requires PHP: 7.4
WC requires at least: 8.2
WC tested up to: 9.1
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -33,6 +33,13 @@ This plugin requires the official [WooCommerce Gift Cards](https://woocommerce.c

== Changelog ==

= 2.0.0 =
* Important - New: PHP 7.4+ is now required.
* Important - New: WooCommerce 8.2+ is now required.
* Important - New: WordPress 6.2+ is now required.
* Important - New: Gift Cards 2.0+ is now required.
* New - Declared compatibility with the new High-Performance order tables.

= 1.0.3 =
* Tweak - Declared support for WordPress 6.3 and WooCommerce 8.2.
* Tweak - Declared incompatibility with the cart/checkout Blocks.
Expand Down

0 comments on commit 9bed010

Please sign in to comment.