| @@ -10,8 +10,9 @@ | ||
| 10 | 10 | |
| 11 | 11 | namespace WCPOS\WooCommercePOS\Admin; |
| 12 | 12 | |
| 13 | 13 | use WCPOS\WooCommercePOS\API\V1\Logs; |
| 14 | +use WCPOS\WooCommercePOS\Services\Cloudflare_Detector; | |
| 14 | 15 | use WCPOS\WooCommercePOS\Services\Extensions as ExtensionsService; |
| 15 | 16 | use WCPOS\WooCommercePOS\Services\Settings as SettingsService; |
| 16 | 17 | use const WCPOS\WooCommercePOS\PLUGIN_NAME; |
| 17 | 18 | use const WCPOS\WooCommercePOS\PLUGIN_URL; |
| @@ -108,8 +109,9 @@ | ||
| 108 | 109 | array( |
| 109 | 110 | 'react', |
| 110 | 111 | 'react-dom', |
| 111 | 112 | 'wp-api-fetch', |
| 113 | + \WCPOS\WooCommercePOS\Admin::API_FETCH_METHOD_PARAM_HANDLE, | |
| 112 | 114 | 'wp-url', |
| 113 | 115 | 'lodash', |
| 114 | 116 | ), |
| 115 | 117 | VERSION, |
| @@ -145,8 +147,9 @@ | ||
| 145 | 147 | $site_uuid = get_option( 'woocommerce_pos_uuid', '' ); |
| 146 | 148 | |
| 147 | 149 | return \sprintf( |
| 148 | 150 | 'var wcpos = wcpos || {}; wcpos.settings = { |
| 151 | + environment: %s, | |
| 149 | 152 | barcodes: %s, |
| 150 | 153 | order_statuses: %s, |
| 151 | 154 | countries: %s, |
| 152 | 155 | storeCountry: %s, |
| @@ -156,8 +159,9 @@ | ||
| 156 | 159 | currentUserId: %s, |
| 157 | 160 | anon_id: %s, |
| 158 | 161 | site_uuid: %s |
| 159 | 162 | }; wcpos.translationVersion = %s;', |
| 163 | + json_encode( array( 'cloudflare' => ( new Cloudflare_Detector() )->detect() ) ), | |
| 160 | 164 | json_encode( $barcodes ), |
| 161 | 165 | json_encode( $order_statuses ), |
| 162 | 166 | json_encode( $countries ), |
| 163 | 167 | json_encode( $store_country ), |