Nestor Soriano
52eed70f04
Add a 'NumberUtil' class with a 'round' method.
...
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.
This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
Nestor Soriano
b1e81d02da
Fix code style/sniffer errors in a few files.
2020-10-01 11:08:51 +02:00
Christopher Allford
6ad091a9b7
Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages
2020-01-28 21:21:29 -08:00
Gerhard
e22a024473
Cookies should only be set in wp-admin, avoid setting when doing ajax requests since that is seen as an admin request as well.
2019-10-10 08:29:10 +02:00
Marcin Bot
bd9961703b
Fix namespaced Jetpack tracks_get_identity
2019-07-12 15:35:49 +01:00
Gerhard
f74c32c17b
Add return
2019-07-02 10:25:32 +02:00
Gerhard
e08279d190
Add support for namespaced Jetpack tracks_get_identity from Jetpack 7.5
2019-07-02 10:20:57 +02:00
Paul Sealock
f7e56be638
Tracks: set cookie on admin_init
2019-05-22 12:14:28 +12:00
oskosk
120fdb2028
Use jetpack_require_lib_dir() instead of JETPACK__PLUGIN_DIR
2019-04-23 20:40:25 -03:00
oskosk
d6c8c2f389
Rely on the JETPACK__PLUGIN_DIR to load the Jetpack Tracks client file
2019-04-19 12:24:29 -03:00
Gerhard
fee86cd8cd
Move JS to woocommerce_setup_footer and do not output wp scripts.
2019-04-17 14:54:59 +02:00
Gerhard
5c7b069d17
Use wp_loaded for cookie set
2019-04-17 14:23:19 +02:00
Gerhard
f65f7a6d59
Remove wc_setcookie usage in WC_Tracks_Client::get_anon_id
2019-04-17 14:20:21 +02:00
Gerhard
00e8aeef60
Use __CLASS__ instead of self
2019-04-17 11:51:07 +02:00
Gerhard
c74df4ca11
Set tracks cookie on wp hook instead on when calling record event.
2019-04-17 11:39:50 +02:00
Jeff Stieler
2e2b3b9bba
Don’t block on Tracks requests and lower timeout to 1s.
2019-03-04 08:59:21 -07:00
Claudio Sanches
8ae61b75e3
Clean up
2019-02-22 15:08:23 -03:00
Claudio Sanches
9250ff0df5
Better check for Jetpack
2019-02-22 15:01:13 -03:00
Claudio Sanches
bad7860e7e
Check if file exists before loading
2019-02-22 15:00:33 -03:00
Paul Sealock
24c324ae4a
remove phpcs ignore
2019-02-22 12:24:31 +13:00
Paul Sealock
158cf33ded
add sanitize_text_field
2019-02-22 12:23:37 +13:00
Paul Sealock
851a2557f6
Tracks: Add a PHP client
2019-02-22 11:48:17 +13:00
Paul Sealock
1b62228faf
Tracks: Add a PHP client
2019-02-20 11:15:33 +13:00