Commit Graph

154 Commits

Author SHA1 Message Date
Timmy Crawford 5d4e3ced65 Convert js filter to underscores too, to match wc-admin 2020-03-17 16:09:37 -07:00
Rebecca Scott 7adabc9a6a Remove unnecessary use statement 2020-03-17 11:51:50 +10:00
Rebecca Scott 4bdcd3eccd Start tracking product_update 2020-03-17 11:27:57 +10:00
Timmy Crawford 356e5a562f Protect _ui and _ut props, move JS filter below product count 2020-03-16 17:00:25 -07:00
Timmy Crawford 2c8195ca8a remove console.log 2020-03-13 17:09:13 -07:00
Timmy Crawford 5880ef902d Add ability to filter props for js-based tracks. 2020-03-13 16:31:06 -07:00
Timmy Crawford 0c1f468692 Add filter for php-based tracks event properties. 2020-03-09 12:46:40 -07:00
Christopher Allford bf02776a3b Corrected inconsistent uses of the Constants library 2020-02-03 13:15:12 -08:00
Christopher Allford 6ad091a9b7 Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
Rodrigo Primo 94373f78ea Fix WordPress.Arrays.MultipleStatementAlignment errors automatically using phpcbf 2019-12-20 13:51:26 -03:00
Rodrigo Primo f06ad5d78a Replace removed WordPress.Security.NonceVerification.NoNonceVerification
WordPress Coding Standard 2.0 removed the sniff
WordPress.Security.NonceVerification.NoNonceVerification:

```
The WordPress.Security.NonceVerification sniff used the same error code for both an error as well as a warning.
The old error code NoNonceVerification is no longer used.
The error now uses the Missing error code, while the warning now uses the Recommended error code.
```

(from
d45f5e5cf3/CHANGELOG.md (200-rc1---2018-12-31))

This commit updates WooCommerce code and replaces all instances where WordPress.Security.NonceVerification.NoNonceVerification verification was used with either WordPress.Security.NonceVerification.Missing or
WordPress.Security.NonceVerification.Recommended. In a few cases WordPress.Security.NonceVerification.NoNonceVerification was used but was not needed, so instead of replacing the sniff, the line was removed. In two other cases, I removed other unrelated sniffs that were not needed.
2019-12-13 17:45:32 -03:00
Gerhard Potgieter aaee28fe1e
Merge pull request #24798 from woocommerce/fix/24792
Do not set tracking cookie on ajax requests
2019-11-18 14:00:21 +02:00
Claudio Sanches ff80f08353 Fixed coding standards 2019-10-16 15:49:03 -03:00
Claudio Sanches 3604c4939a Prevent PHP warning in tracker 2019-10-16 15:47:32 -03: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
Rodrigo Primo 0128a0686b
Merge pull request #24396 from woocommerce/fix-implode-parameter-order
Use correct parameter order for implode.
2019-08-23 11:14:50 -03:00
Claudio Sanches 8a278d3d96 Fixed coding standards 2019-08-19 20:42:42 -03:00
Claudio Sanches 6bc080fef0 Prevent PHP warning when date is null 2019-08-19 20:41:30 -03:00
David Stone d685964df6 Use correct parameter order for implode. Solves deprecation notice in PHP 7.4 2019-08-13 13:03:09 -06:00
vedanshujain 6ab03e6acd Return early if post status is `auto-draft` to prevent fatal.
While creating an order, if we remove an item after adding, `pre_post_update` hook gets called. Since the order is not created yet, `$order->get_date_created()` will be null, and this will cause a fatal in the event tracker which checks for and tracks edit in order created date.

We now return early when order status is `auto-draft` to prevent these kind of errors.
2019-07-17 00:21:18 +05:30
Gerhard Potgieter 7c0d0251ee
Merge pull request #23883 from woocommerce/add/new-edit-order-tracks
Track more events on the edit order screen for future design validation.
2019-07-15 09:36:01 +02:00
Marcin Bot bd9961703b Fix namespaced Jetpack tracks_get_identity 2019-07-12 15:35:49 +01:00
Rodrigo Primo 52ecc2f357
Merge pull request #24056 from woocommerce/fix/obw-tracks-events
OBW: Fix event recording in OBW
2019-07-11 10:00:22 -03:00
Gerhard Potgieter 013ee83b47
Merge pull request #23189 from woocommerce/tracks/coupons
Tracks: Add coupons view events
2019-07-09 11:04:43 +02:00
Claudio Sanches adc543f8f1
Merge pull request #24058 from woocommerce/add/wc-admin-obw-recommended
OBW: Add wc-admin to recommended page
2019-07-08 16:56:49 -03:00
Claudio Sanches c131225825
Merge pull request #24050 from woocommerce/update/23930
Add support for namespaced Jetpack tracks_get_identity
2019-07-08 16:48:01 -03:00
Paul Sealock 2d2ef711b8 Pass in select id 2019-07-08 11:41:52 +12:00
Paul Sealock bc23340909 Use #doaction to target bulk actions 2019-07-05 17:02:30 +12:00
Paul Sealock 7af9d1813d Tracks: Add coupons view events 2019-07-05 16:46:58 +12:00
Rodrigo Primo 9325e233d7
Merge pull request #23190 from woocommerce/tracks/status-events
Tracks: Status page events
2019-07-04 15:21:07 -03:00
Paul Sealock 08224c06f2 Add facebook and wc-admin to 'obw_recommended' Tracks event properties 2019-07-04 13:07:18 +12:00
Timmy Crawford 6f6265f8e3 Track views of the last step in the OBW. 2019-07-02 14:56:08 -07:00
Timmy Crawford 3f6d5eb49a Tracks: Fix marketing signup track. 2019-07-02 14:47:41 -07: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
Jeff Stieler 3bf58f2d48 Tracks: fix blog ID retrieval from Jetpack options.
JavaScripty syntax resulted in boolean values.
2019-06-27 14:15:17 -06:00
Albert Juhé Lluveras 26c2d49586 Set Tracks image position to fixed 2019-06-18 13:05:30 +02:00
Jeff Stieler 05fd441145 Add payment method to order status change tracking. 2019-06-07 12:52:22 +02:00
Jeff Stieler 1bd9a7d9a7 Use a consistent tracks event naming scheme. 2019-06-07 12:31:42 +02:00
Jeff Stieler e251557550 Track when users click “add order” from an order edit screen. 2019-06-07 12:21:04 +02:00
Jeff Stieler 6c90d9da57 Track order actions. 2019-06-07 10:55:33 +02:00
Jeff Stieler f9d064e778 Track changes to order creation date. 2019-06-06 17:09:50 +02:00
Rodrigo Primo ff1020a787
Merge pull request #23787 from woocommerce/fix/tracks-cookie-set-action
Tracks: set cookie on admin_init insead of wp_loaded
2019-05-27 12:16:27 -03:00
Claudio Sanches 91a8592ebb Fixed conditional logic 2019-05-22 20:16:10 -03:00
Paul Sealock f7e56be638 Tracks: set cookie on admin_init 2019-05-22 12:14:28 +12:00
Paul Sealock c74d5b30ca Tracks: use woocommerce_apply_user_tracking and woocommerce_apply_tracking 2019-05-22 09:18:34 +12:00
Paul Sealock ca4e79bdd1 Tracks: Add check for OBW is-opting-in 2019-05-21 12:20:25 +12:00
Paul Sealock ef12058326 Tracks: Fix OBW scripts 2019-04-26 09:54:13 +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 9ad8ef56da Be sure to also print the wp script since the OBW does not include those by default in the footer. 2019-04-17 14:56:51 +02: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 13e40cdee7 Remove total revenue from Tracks events.
Query to calculate is far too expensive and doesn’t seem to ever get cached with large datasets.
2019-04-15 09:37:34 +02:00
Paul Sealock 1d7cd1722a Tracks: various fixes 2019-04-08 15:58:03 +12:00
Paul Sealock 2d244a8047 Tracks: Status page events 2019-04-02 16:51:48 +13:00
Gerhard e86fbf62cc Add transient caching to the blog_details values tracks collects. 2019-03-13 15:12:07 +02:00
Jeff Stieler 68573f6ed5
Increase Tracks performance (perhaps..) (#22829)
* Don’t block on Tracks requests and lower timeout to 1s.

* Where possible, render Tracks pixels in the page footer instead of making a blocking HTTP request from the server.

* Add direct API call fallback for Tracks event pixels.
2019-03-06 15:55:49 -07:00
Joshua Flowers 795b571147 Add scripts to wc setup footer 2019-03-06 11:55:19 +13:00
Jeff Stieler 7caba832f6
Refactor Tracks classes to remove singletons and static methods. (#22930) 2019-03-04 17:30:01 -07:00
Jeff Stieler c22c3aafa2
Track settings changes. (#22810)
* Track settings changes.
2019-03-04 15:37:59 -07:00
Jeff Stieler 1072d1a275 Tracks: Use wp_doing_ajax() instead of checking constant. 2019-03-04 10:04:48 -07:00
Jeff Stieler 262afba502 Add direct API call fallback for Tracks event pixels.
Handles cases where wp_redirect() is called.
2019-03-04 09:59:49 -07:00
Jeff Stieler 22c20b0d32 Where possible, render Tracks pixels in the page footer instead of making a blocking HTTP request from the server. 2019-03-04 08:59:21 -07:00
Jeff Stieler 2e2b3b9bba Don’t block on Tracks requests and lower timeout to 1s. 2019-03-04 08:59:21 -07:00
Joshua T Flowers 17b786e500 Tracks: Move tracking script to make available on page load (#22914)
* Filter wc queued js to add tracking script outside of jQuery

* Add tracking script directly to footer

* Move empty tracking function to admin footer hook
2019-03-04 14:16:05 +08:00
Joshua Flowers 9e6836e3a0 Use get_current_step() inside step tracking method 2019-03-04 14:14:45 +08:00
Joshua Flowers 919785bce8 Whitelist specific footer scripts 2019-03-04 14:14:45 +08:00
Joshua Flowers 123940b2ac Only add marketing tracking on next_step step of OBW 2019-03-04 14:14:45 +08:00
Joshua Flowers 3ab791843d Track marketing signup on form submission 2019-03-04 14:14:45 +08:00
Joshua Flowers 9128e8c4f5 Add scripts to wc setup footer 2019-03-04 14:14:45 +08:00
Paul Sealock 37d3fff3d6
Merge pull request #22807 from woocommerce/add/tracks-gross-revenue
Add gross revenue to Tracks base data.
2019-03-04 09:35:37 +13:00
Joshua T Flowers e53724832d
Tracks: Add tracking event when OBW is started (#22877)
* Check if current step matches event before firing

* Move step check to switch statement

* Track when the OBW has started

* Rename Jetpack activation tracking method

* Remove duplicate tracking optin check

* Track when option to track is udpated in OBW

* Check if tracking is actively being opted into in is_tracking_enabled()

* Move tracking start check into WC_Admin_Setup_Wizard_Tracking

* Clean up tracking opt-in check logic
2019-03-01 11:12:30 +08:00
Joshua T Flowers 234f3a1bb9
Tracks: Add tracking event for skipped step in OBW (#22879)
* Check if current step matches event before firing

* Move step check to switch statement

* Add ability to get steps from setup wizard

* Track last completed step in options

* Track skipped step name if bypassing the save process

* Track skipped step prior to current instead of step after last completed step
2019-03-01 10:58:11 +08:00
Joshua T Flowers 64b565465f
Tracks: Add tracking for Jetpack activation in OBW (#22875)
* Check if current step matches event before firing

* Move step check to switch statement

* Track when Jetpack is activated
2019-02-28 14:33:00 +08:00
Joshua T Flowers 53f1f5c095
Tracks: Add selected recommended plugins in OBW (#22874)
* Add tracking to store setup OBW

* Check if current step matches event before firing

* Move step check to switch statement

* Track selected plugins recommended for install
2019-02-28 14:27:05 +08:00
Joshua T Flowers f48ec6deec
Tracks: Add tracking for shipping units and labels (#22873)
* Check if current step matches event before firing

* Move step check to switch statement

* Track shipping units and labels
2019-02-28 14:22:13 +08:00
Joshua T Flowers a91adfa087
Tracks: Add selected payment gateways in OBW (#22872)
* Check if current step matches event before firing

* Move step check to switch statement

* Track payment gateways in OBW

* Combine arrays into comma separate strings
2019-02-28 11:58:08 +08:00
Joshua T Flowers 9f1b111692
Tracks: Add store setup event in OBW (#22860)
* Add tracking to store setup OBW

* Check if current step matches event before firing

* Move step check to switch statement

* Extract save events into separate method
2019-02-28 11:28:07 +08:00
Paul Sealock e2697629b9
Merge pull request #22794 from woocommerce/add/tracks-orders_edit_status_change
Tracks: Orders edit status change
2019-02-27 12:43:02 +13:00
Claudio Sanches f95f0f519e Fixed coding standards 2019-02-26 19:59:04 -03:00
Paul Sealock 260481522e better return comment 2019-02-26 16:34:43 +13:00
Jeff Stieler fe841ecc0b Add gross revenue to Tracks base data. 2019-02-26 16:31:26 +13:00
Paul Sealock bf2561270a remove check 2019-02-26 07:59:12 +13:00
Paul Sealock 0763edaeea Change prefix to wcadmin 2019-02-26 07:57:44 +13:00
Jeff Stieler 41e79ace80 Add Tracks events for product import start and finish. 2019-02-25 11:36:39 +13:00
Claudio Sanches 14fa222347
Merge pull request #22676 from woocommerce/add/woo-identity
Tracks: add Woo identity
2019-02-22 15:10:22 -03: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
Jeff Stieler 04a1b7d79d
Track when product categories are created. (#22790)
* Track when product categories are created.

* Product category tracking: rename page property and include parent category ID.

* Fix PHPCS issues with product category tracking event.
2019-02-21 18:38:50 -07:00
Jeff Stieler 88fdbae5da
Track when a product is published. (#22788) 2019-02-21 18:34:06 -07:00
Jeff Stieler e41b0985f3
Track Subscriptions connection actions (#22805)
* Track when the Helper connection process is started.

* Track when the Helper connection process is cancelled.

* Track when the Helper connection process has completed successfully.

* Track when the Helper has been disconnected.

* Track when the Helper refreshes subscriptions.
2019-02-21 16:28:15 -07: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
Jeff Stieler 5c414507f9
Add Tracks events for product import start and finish. (#22787)
* Add Tracks events for product import start and finish.

* Move tracks event firing code into classes grouped by category/kind.

* Fix PHPCS warnings/errors with product and importer event tracking.

* Include products count in base Tracks data. (#22791)

* Add extensions page view tracking. (#22803)

* Add extensions page view tracking.

* Add tracking for extension searches. (#22804)
2019-02-21 15:45:43 -07:00