This repository was archived by the owner on Oct 4, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Jetpack compatibility hotfixes
4
+ *
5
+ * @since 0.7.0
6
+ */
7
+
8
+ if ( ! defined ( 'ABSPATH ' ) ) {
9
+ exit ;
10
+ }
11
+
12
+ /**
13
+ * Disables jetpack sync during rest requests to avoid lengthly (> 5 second) response
14
+ * times during the shutdown action for things like product creation
15
+ *
16
+ * See also https://core.trac.wordpress.org/ticket/41358#ticket
17
+ * See also https://github.com/Automattic/jetpack/pull/7482
18
+ *
19
+ * This can be removed once we have either of the two fixes above released
20
+ *
21
+ * See also https://github.com/woocommerce/woocommerce/pull/16158
22
+ */
23
+
24
+ function wc_api_dev_jetpack_sync_sender_should_load ( $ sender_should_load ) {
25
+ $ starts_with = '/wp-json/wc/v ' ;
26
+ if ( $ starts_with === substr ( $ _SERVER [ 'REQUEST_URI ' ], 0 , strlen ( $ starts_with ) ) ) {
27
+ $ sender_should_load = false ;
28
+ }
29
+
30
+ return $ sender_should_load ;
31
+ }
32
+
33
+ add_filter ( 'jetpack_sync_sender_should_load ' , 'wc_api_dev_jetpack_sync_sender_should_load ' , 999 );
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Contributors: automattic, woothemes
3
3
Tags: woocommerce, rest-api, api
4
4
Requires at least: 4.6
5
5
Tested up to: 4.8
6
- Stable tag: 0.6 .0
6
+ Stable tag: 0.7 .0
7
7
License: GPLv2 or later
8
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
9
@@ -25,6 +25,9 @@ This section describes how to install the plugin and get it working.
25
25
26
26
== Changelog ==
27
27
28
+ = 0.7.0 =
29
+ * Fix - disable jetpack sync during rest api requests to avoid slow responses
30
+
28
31
= 0.6.0 =
29
32
* Fix value default return on settings endpoints
30
33
* Fix broken variation image set
Original file line number Diff line number Diff line change 3
3
* Plugin Name: WooCommerce API Dev
4
4
* Plugin URI: https://woocommerce.com/
5
5
* Description: A feature plugin providing a bleeding edge version of the WooCommerce REST API.
6
- * Version: 0.6 .0
6
+ * Version: 0.7 .0
7
7
* Author: Automattic
8
8
* Author URI: https://woocommerce.com
9
9
* Requires at least: 4.4
@@ -117,6 +117,9 @@ public function includes() {
117
117
include_once ( dirname ( __FILE__ ) . '/api/class-wc-rest-dev-system-status-tools-controller.php ' );
118
118
include_once ( dirname ( __FILE__ ) . '/api/class-wc-rest-dev-shipping-methods-controller.php ' );
119
119
include_once ( dirname ( __FILE__ ) . '/api/class-wc-rest-dev-payment-gateways-controller.php ' );
120
+
121
+ // Things that aren't related to a specific endpoint but to things like cross-plugin compatibility
122
+ include_once ( dirname ( __FILE__ ) . '/hotfixes/wc-api-dev-jetpack-hotfixes.php ' );
120
123
}
121
124
122
125
/**
You can’t perform that action at this time.
0 commit comments