Skip to content

Commit

Permalink
Revert "Add/user tracking option api (#9003)"
Browse files Browse the repository at this point in the history
This reverts commit c9b754c.
  • Loading branch information
dereksmart committed Mar 27, 2018
1 parent af241c0 commit 9709cc4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 112 deletions.
50 changes: 0 additions & 50 deletions _inc/lib/class.jetpack-user-event-tracking.php

This file was deleted.

1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<file>tests/php/test_class.jetpack-constants.php</file>
<file>tests/php/test_class.jetpack-connection-banner.php</file>
<file>tests/php/test_class.jetpack-options.php</file>
<file>tests/php/test_class.jetpack-user-event-tracking.php</file>
</testsuite>
<testsuite name="php-lint">
<file phpVersion="5.3.0" phpVersionOperator="lte">tests/php/test_php-lint.php</file>
Expand Down
3 changes: 1 addition & 2 deletions sync/class.jetpack-sync-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ public static function get_constants_whitelist() {
'hosting_provider' => array( 'Jetpack_Sync_Functions', 'get_hosting_provider' ),
'locale' => 'get_locale',
'site_icon_url' => array( 'Jetpack_Sync_Functions', 'site_icon_url' ),
'roles' => array( 'Jetpack_Sync_Functions', 'roles' ),
'default_user_event_tracking' => array( 'Jetpack_Sync_functions', 'get_default_user_tracking_value' )
'roles' => array( 'Jetpack_Sync_Functions', 'roles' ),
);


Expand Down
5 changes: 0 additions & 5 deletions sync/class.jetpack-sync-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public static function get_shortcodes() {
return array_keys( $shortcode_tags );
}

public static function get_default_user_tracking_value() {
jetpack_require_lib( 'class.jetpack-user-event-tracking' );
return Jetpack_User_Event_Tracking::default_value();
}

/**
* Removes any callback data since we will not be able to process it on our side anyways.
*/
Expand Down
10 changes: 1 addition & 9 deletions sync/class.jetpack-sync-module-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ public function expand_user( $user ) {
$user->locale = get_user_locale( $user->ID );
}
}
jetpack_require_lib( 'class.jetpack-user-event-tracking' );
if ( Jetpack_User_Event_Tracking::has_value( $user->ID ) ) {
$user->jetpack_tracking_enabled = Jetpack_User_Event_Tracking::is_enabled( $user->ID );
}

return $user;
}

Expand Down Expand Up @@ -289,11 +286,6 @@ function maybe_save_user_meta( $meta_id, $user_id, $meta_key, $value ) {
$this->add_flags( $user_id, array( 'locale_changed' => true ) );
}

jetpack_require_lib( 'class.jetpack-user-event-tracking' );
if ( $meta_key === Jetpack_User_Event_Tracking::$KEY ) {
$this->add_flags( $user_id, array( 'tracking_opt_out_changed' => true ) );
}

$user = get_user_by( 'id', $user_id );
if ( $meta_key === $user->cap_key ) {
$this->add_flags( $user_id, array( 'capabilities_changed' => true ) );
Expand Down
15 changes: 7 additions & 8 deletions tests/php.multisite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
</php>
<testsuites>
<testsuite name="general">
<file>php/test_class.jetpack.php</file>
<file>php/test_class.functions.compat.php</file>
<file>php/test_class.jetpack-network.php</file>
<file>php/test_class.jetpack-client-server.php</file>
<file>php/test_class.jetpack-xmlrpc-server.php</file>
<file>php/test_class.jetpack-heartbeat.php</file>
<file>php/test_class.jetpack-user-event-tracking.php</file>
</testsuite>
<file>php/test_class.jetpack.php</file>
<file>php/test_class.functions.compat.php</file>
<file>php/test_class.jetpack-network.php</file>
<file>php/test_class.jetpack-client-server.php</file>
<file>php/test_class.jetpack-xmlrpc-server.php</file>
<file>php/test_class.jetpack-heartbeat.php</file>
</testsuite>
<testsuite name="core-api">
<directory phpVersion="5.6.0" phpVersionOperator=">=" prefix="test_" suffix=".php">tests/php/core-api</directory>
</testsuite>
Expand Down
1 change: 0 additions & 1 deletion tests/php/sync/test_class.jetpack-sync-callables.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public function test_sync_callable_whitelist() {
'site_icon_url' => Jetpack_Sync_Functions::site_icon_url(),
'shortcodes' => Jetpack_Sync_Functions::get_shortcodes(),
'roles' => Jetpack_Sync_Functions::roles(),
'default_user_event_tracking' => Jetpack_Sync_Functions::get_default_user_tracking_value()
);

if ( function_exists( 'wp_cache_is_enabled' ) ) {
Expand Down
36 changes: 0 additions & 36 deletions tests/php/test_class.jetpack-user-event-tracking.php

This file was deleted.

0 comments on commit 9709cc4

Please sign in to comment.