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 1616 * See also https://core.trac.wordpress.org/ticket/41358#ticket
1717 * See also https://github.com/Automattic/jetpack/pull/7482
1818 *
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.
2022 *
2123 * See also https://github.com/woocommerce/woocommerce/pull/16158
24+ *
25+ * @since 0.7.0
26+ * @version 0.7.1
2227 */
2328
2429function 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+ }
2837 }
2938
3039 return $ sender_should_load ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Contributors: automattic, woothemes
33Tags: woocommerce, rest-api, api
44Requires at least: 4.6
55Tested up to: 4.8
6- Stable tag: 0.7.0
6+ Stable tag: 0.7.1
77License: GPLv2 or later
88License URI: http://www.gnu.org/licenses/gpl-2.0.html
99
@@ -25,6 +25,9 @@ This section describes how to install the plugin and get it working.
2525
2626== Changelog ==
2727
28+ = 0.7.1 =
29+ * Fix - add another URI to watch for when disabling sync during API requests
30+
2831= 0.7.0 =
2932* Fix - disable jetpack sync during rest api requests to avoid slow responses
3033
Original file line number Diff line number Diff line change 33 * Plugin Name: WooCommerce API Dev
44 * Plugin URI: https://woocommerce.com/
55 * Description: A feature plugin providing a bleeding edge version of the WooCommerce REST API.
6- * Version: 0.7.0
6+ * Version: 0.7.1
77 * Author: Automattic
88 * Author URI: https://woocommerce.com
99 * Requires at least: 4.4
You can’t perform that action at this time.
0 commit comments