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 +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 16
16
* See also https://core.trac.wordpress.org/ticket/41358#ticket
17
17
* See also https://github.com/Automattic/jetpack/pull/7482
18
18
*
19
- * This can be removed once we have either of the two fixes above released
19
+ * This can be removed once we have either of the two fixes above released. The first
20
+ * trigger string is typical of a direct request (e.g. ala Postman) and the second
21
+ * trigger string is typical of a request from WordPress.com for Jetpack.
20
22
*
21
23
* See also https://github.com/woocommerce/woocommerce/pull/16158
24
+ *
25
+ * @since 0.7.0
26
+ * @version 0.7.1
22
27
*/
23
28
24
29
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 ;
30
+ $ trigger_strings = array ( '/wp-json/wc/v ' , '/?rest_route=%2Fwc%2Fv ' );
31
+
32
+ foreach ( $ trigger_strings as $ trigger_string ) {
33
+ if ( false !== strpos ( $ _SERVER [ 'REQUEST_URI ' ], $ trigger_string ) ) {
34
+ $ sender_should_load = false ;
35
+ break ;
36
+ }
28
37
}
29
38
30
39
return $ sender_should_load ;
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.7.0
6
+ Stable tag: 0.7.1
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.1 =
29
+ * Fix - add another URI to watch for when disabling sync during API requests
30
+
28
31
= 0.7.0 =
29
32
* Fix - disable jetpack sync during rest api requests to avoid slow responses
30
33
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.7.0
6
+ * Version: 0.7.1
7
7
* Author: Automattic
8
8
* Author URI: https://woocommerce.com
9
9
* Requires at least: 4.4
You can’t perform that action at this time.
0 commit comments