From 60c57c0064bd6d37fd7893ef3468be34b29a228b Mon Sep 17 00:00:00 2001 From: Fernando Claussen Date: Fri, 13 Jul 2018 13:29:32 -0400 Subject: [PATCH] Removing telemetry component --- admin/class-gdpr-admin.php | 30 ----------------------------- admin/partials/settings.php | 3 +-- includes/class-gdpr-activator.php | 2 -- includes/class-gdpr-deactivator.php | 1 - includes/class-gdpr.php | 14 -------------- 5 files changed, 1 insertion(+), 49 deletions(-) diff --git a/admin/class-gdpr-admin.php b/admin/class-gdpr-admin.php index 2679fac8..f58f8112 100755 --- a/admin/class-gdpr-admin.php +++ b/admin/class-gdpr-admin.php @@ -135,19 +135,9 @@ public function add_menu() { $settings_hook = add_submenu_page( $parent_slug, $menu_title, $menu_title, $capability, $menu_slug, $function ); - $menu_slug = 'edit.php?post_type=telemetry'; - - $cpt = 'telemetry'; - $cpt_obj = get_post_type_object( $cpt ); - - if ( $cpt_obj ) { - add_submenu_page( $parent_slug, $cpt_obj->labels->name, $cpt_obj->labels->menu_name, $capability, $menu_slug ); - } - add_action( "load-{$requests_hook}", array( 'GDPR_Help', 'add_requests_help' ) ); add_action( "load-{$tools_hook}", array( 'GDPR_Help', 'add_tools_help' ) ); add_action( "load-{$settings_hook}", array( 'GDPR_Help', 'add_settings_help' ) ); - add_action( 'load-edit.php', array( 'GDPR_Help', 'add_telemetry_help' ) ); } /** @@ -201,7 +191,6 @@ public function register_settings() { 'gdpr_consent_types' => array( $this, 'sanitize_consents' ), 'gdpr_deletion_needs_review' => 'boolval', 'gdpr_disable_css' => 'boolval', - 'gdpr_enable_telemetry_tracker' => 'boolval', 'gdpr_use_recaptcha' => 'boolval', 'gdpr_recaptcha_site_key' => 'sanitize_text_field', 'gdpr_recaptcha_secret_key' => 'sanitize_text_field', @@ -710,25 +699,6 @@ public function clean_data_breach_request() { delete_option( 'gdpr_data_breach_initiated' ); } - /** - * CRON job runs this to clean up the telemetry post type every 12 hours. - * @since 1.0.0 - * @author Fernando Claussen - */ - public function telemetry_cleanup() { - $args = array( - 'post_type' => 'telemetry', - 'posts_per_page' => -1, - 'fields' => 'ids', - ); - - $telemetry_posts = get_posts( $args ); - - foreach ( $telemetry_posts as $post ) { - wp_delete_post( $post, true ); - } - } - /** * Sanitizes the consents during WordPress registration. * @since 1.0.0 diff --git a/admin/partials/settings.php b/admin/partials/settings.php index a49cc234..7dc2d8a1 100755 --- a/admin/partials/settings.php +++ b/admin/partials/settings.php @@ -64,8 +64,7 @@ - - > + diff --git a/includes/class-gdpr-activator.php b/includes/class-gdpr-activator.php index 3b406fef..d0a54fa4 100755 --- a/includes/class-gdpr-activator.php +++ b/includes/class-gdpr-activator.php @@ -25,7 +25,6 @@ class GDPR_Activator { /** * Runs when the user first activates the plugin. - * Sets a CRON jo to clean up the telemetry post type every 12 hours. * * @since 1.0.0 * @static @@ -37,7 +36,6 @@ public static function activate() { } add_option( 'gdpr_disable_css', false ); - add_option( 'gdpr_enable_telemetry_tracker', false ); add_option( 'gdpr_use_recaptcha', false ); add_option( 'gdpr_recaptcha_site_key', '' ); add_option( 'gdpr_recaptcha_secret_key', '' ); diff --git a/includes/class-gdpr-deactivator.php b/includes/class-gdpr-deactivator.php index f0c4463c..24ecf315 100755 --- a/includes/class-gdpr-deactivator.php +++ b/includes/class-gdpr-deactivator.php @@ -32,7 +32,6 @@ class GDPR_Deactivator { * @author Fernando Claussen */ public static function deactivate() { - wp_clear_scheduled_hook( 'telemetry_cleanup' ); } } diff --git a/includes/class-gdpr.php b/includes/class-gdpr.php index f13a5c6c..5589a8c9 100755 --- a/includes/class-gdpr.php +++ b/includes/class-gdpr.php @@ -96,11 +96,6 @@ private function load_dependencies() { */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-gdpr-audit-log.php'; - /** - * The class responsible for defining the telemetry post type. - */ - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-gdpr-telemetry.php'; - /** * The class responsible for defining the requests section of the plugin. */ @@ -171,7 +166,6 @@ private function define_admin_hooks() { $plugin_admin = new GDPR_Admin( $this->get_plugin_name(), $this->get_version() ); $requests_admin = new GDPR_Requests_Admin( $this->get_plugin_name(), $this->get_version() ); - $telemetry = new GDPR_Telemetry( $this->get_plugin_name(), $this->get_version() ); $requests = new GDPR_Requests( $this->get_plugin_name(), $this->get_version() ); $plugin_emails = new GDPR_Email(); $woo_add_to_registration = get_option( 'gdpr_add_consent_checkboxes_registration', false ); @@ -209,7 +203,6 @@ private function define_admin_hooks() { add_action( 'wp_ajax_gdpr_audit_log', array( $plugin_admin, 'audit_log' ) ); add_action( 'admin_post_gdpr_data_breach', array( $plugin_admin, 'send_data_breach_confirmation_email' ) ); add_action( 'clean_gdpr_data_breach_request', array( $plugin_admin, 'clean_data_breach_request' ), 10, 2 ); // CRON JOB - add_action( 'telemetry_cleanup', array( $plugin_admin, 'telemetry_cleanup' ) ); // CRON JOB add_action( 'admin_post_gdpr_delete_user', array( $requests_admin, 'delete_user' ) ); add_action( 'admin_post_gdpr_cancel_request', array( $requests_admin, 'cancel_request' ) ); @@ -218,13 +211,6 @@ private function define_admin_hooks() { add_action( 'wp_ajax_gdpr_anonymize_comments', array( $requests_admin, 'anonymize_comments' ) ); add_action( 'wp_ajax_gdpr_reassign_content', array( $requests_admin, 'reassign_content' ) ); - add_action( 'init', array( $telemetry, 'register_post_type' ) ); - add_filter( 'http_api_debug', array( $telemetry, 'log_request' ), 10, 5 ); - add_filter( 'manage_telemetry_posts_columns', array( $telemetry, 'manage_columns' ) ); - add_filter( 'manage_telemetry_posts_custom_column', array( $telemetry, 'custom_column' ), 10, 2 ); - add_filter( 'restrict_manage_posts', array( $telemetry, 'actions_above_table' ) ); - add_filter( 'views_edit-telemetry', '__return_null' ); - // CRON JOBS add_action( 'clean_gdpr_requests', array( $requests, 'clean_requests' ) ); add_action( 'clean_gdpr_user_request_key', array( $requests, 'clean_user_request_key' ), 10, 2 );