Skip to content

Commit 87a2638

Browse files
Merge pull request #31 from godaddy-wordpress/mwc-11022/hpos-compatibility
HPOS support in Extra Product Sorting Options
2 parents b3d5892 + 5b55ee6 commit 87a2638

File tree

5 files changed

+50
-42
lines changed

5 files changed

+50
-42
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# http://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[{.jshintrc,*.json,*.toml,*.yml}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[{*.txt}]
21+
end_of_line = crlf

includes/class-wc-eso-customizer-checkbox-multiple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* upon which this class is based.
2020
*
2121
* @author SkyVerge
22-
* @copyright Copyright (c) 2014-2021, SkyVerge, Inc.
22+
* @copyright Copyright (c) 2014-2023, SkyVerge, Inc.
2323
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
2424
*/
2525

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Extra Product Sorting Options for WooCommerce provides options that extend the d
66

77
### Requirements
88

9-
- WooCommerce 3.0.9 or newer
10-
- WordPress 4.4 or newer
9+
- WooCommerce 3.9.4 or newer
10+
- WordPress 5.6 or newer
1111

1212
### Quick links & info
1313

readme.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Contributors: skyverge, beka.rice, tamarazuk
33
Tags: woocommerce, sorting, product sorting, orderby
44
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Donation+for+WooCommerce+Extra+Product+Sorting
5-
Requires at least: 4.4
5+
Requires at least: 5.6
66
Tested up to: 6.0.1
7-
Stable Tag: 2.9.1
8-
Requires PHP: 5.6
7+
Stable Tag: 2.10.0-dev.1
8+
Requires PHP: 7.4
99
License: GPLv3
1010
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1111

@@ -15,7 +15,7 @@ Rename the default product sorting option, add up to 5 new sorting options inclu
1515

1616
Extra Product Sorting Options for WooCommerce provides options that extend the default WooCommerce orderby options on the shop page. You can optionally set a new name for the default sorting (helpful if you've used this to create a custom sorting order), and can enable up to **5 new sorting options**: alphabetical, reverse alphabetical, on sale, review count, and availability product sorting. You can also remove core sorting options, or remove the sorting dropdown completely.
1717

18-
> **Requires: PHP 5.6, WooCommerce 3.5+ and WordPress 4.4+**
18+
> **Requires: PHP 7.4, WooCommerce 3.9+ and WordPress 5.6+**
1919

2020
= Features =
2121
Includes options to:
@@ -90,6 +90,10 @@ Yes you can! Join in on our [GitHub repository](https://github.com/skyverge/wooc
9090

9191
== Changelog ==
9292

93+
= 2023.nn.nn - version 2.10.0-dev.1 =
94+
* Misc - Add compatibility for WooCommerce High Performance Order Storage (HPOS)
95+
* Misc - Require PHP 7.4+, WordPress 5.6+ and WooCommerce 3.9+
96+
9397
= 2022.07.31 - version 2.9.1 =
9498
* Misc - Rename to Extra Product Sorting Options for WooCommerce
9599

woocommerce-extra-product-sorting-options.php

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
* Description: Rename default sorting and optionally extra product sorting options.
66
* Author: SkyVerge
77
* Author URI: http://www.skyverge.com/
8-
* Version: 2.9.1
8+
* Version: 2.10.0-dev.1
99
* Text Domain: woocommerce-extra-product-sorting-options
1010
* Domain Path: /i18n/languages/
1111
*
12-
* Copyright: (c) 2014-2021, SkyVerge, Inc. ([email protected])
12+
* Copyright: (c) 2014-2023, SkyVerge, Inc. ([email protected])
1313
*
1414
* License: GNU General Public License v3.0
1515
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
1616
*
1717
* @author SkyVerge
1818
* @category Admin
19-
* @copyright Copyright (c) 2014-2021, SkyVerge, Inc.
19+
* @copyright Copyright (c) 2014-2023, SkyVerge, Inc.
2020
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
2121
*
22-
* WC requires at least: 3.5.0
22+
* WC requires at least: 3.9.4
2323
* WC tested up to: 6.7.0
2424
*/
2525

@@ -43,10 +43,10 @@ class WC_Extra_Sorting_Options {
4343

4444

4545
/** plugin version number */
46-
const VERSION = '2.9.1';
46+
const VERSION = '2.10.0-dev.1';
4747

4848
/** required WooCommerce version number */
49-
const MIN_WOOCOMMERCE_VERSION = '3.5.0';
49+
const MIN_WOOCOMMERCE_VERSION = '3.9.4';
5050

5151
/** @var WC_Extra_Sorting_Options single instance of this plugin */
5252
protected static $instance;
@@ -87,25 +87,26 @@ public function __construct() {
8787
// run every time
8888
$this->install();
8989
}
90+
91+
// handle HPOS compatibility
92+
add_action( 'before_woocommerce_init', [ $this, 'handle_hpos_compatibility' ] );
9093
}
9194

9295

9396
/**
94-
* Adds Settings to WooCommerce Settings > Products page after "Default Product Sorting" setting.
97+
* Declares HPOS compatibility.
9598
*
96-
* @since 1.0.0
97-
* @deprecated 2.9.0
99+
* @since 2.10.0-dev.1
98100
*
99-
* @TODO remove this deprecated method by April 2022 or by version 3.0.0 {FN 2021-04-14}
101+
* @internal
100102
*
101-
* @param array $settings the current product settings
102-
* @return array updated settings
103+
* @return void
103104
*/
104-
public function add_settings( $settings ) {
105-
106-
wc_deprecated_function( __METHOD__ ,'2.9.0' );
107-
108-
return $settings;
105+
public function handle_hpos_compatibility()
106+
{
107+
if ( class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
108+
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', plugin_basename( __FILE__ ), true );
109+
}
109110
}
110111

111112

@@ -232,24 +233,6 @@ public function sanitize_option_list( $values ) {
232233
}
233234

234235

235-
/**
236-
* Gets the set of settings options.
237-
*
238-
* @since 2.7.0
239-
* @deprecated 2.9.0
240-
*
241-
* @TODO remove this method by version 3.0.0 or by April 2022 {FN 2021-04-14}
242-
*
243-
* @return array settings options
244-
*/
245-
protected function get_settings_options() {
246-
247-
wc_deprecated_function( __METHOD__, '2.9.0' );
248-
249-
return $this->get_extra_sorting_setting_options();
250-
}
251-
252-
253236
/**
254237
* Gets sorting options as settings options.
255238
*

0 commit comments

Comments
 (0)