From e4d818dfed3079e4ef1d9b4df45453b17f62c39f Mon Sep 17 00:00:00 2001 From: Serhiy Zakharchenko Date: Mon, 16 Sep 2024 09:48:59 +0100 Subject: [PATCH] Removed outdated notice and update database functionality (738) --- php/classes/class-ssp-stats.php | 67 --------------------------------- 1 file changed, 67 deletions(-) diff --git a/php/classes/class-ssp-stats.php b/php/classes/class-ssp-stats.php index 88e3457..c5512b5 100755 --- a/php/classes/class-ssp-stats.php +++ b/php/classes/class-ssp-stats.php @@ -213,12 +213,6 @@ public function bootstrap( $file, $version, $db_version ) { // Get required episode IDs for stats add_action( 'init', array( $this, 'load_episode_ids' ), 11 ); - // Add admin notice to upgrade stats table - add_action( 'admin_notices', array( $this, 'maybe_notify_stats_update' ) ); - - // Anonymise the IP address details stored in the database - add_action( 'admin_init', array( $this, 'maybe_update_stats_data' ), 11 ); - // Add stats meta box to episodes edit screen add_action( 'ssp_meta_boxes', array( $this, 'post_meta_box' ), 10, 1 ); @@ -1284,65 +1278,4 @@ public function dashboard_widget_callback(){ echo $html; } - - /** - * Checks if the ssp_stats_ips_updated option is set, if not shows a message to the user. - */ - public function maybe_notify_stats_update(){ - $ssp_stats_ips_updated = get_option( 'ssp_stats_ips_updated', 'no' ); - if ( 'yes' === $ssp_stats_ips_updated ) { - return; - } - $data_upgrade_url = add_query_arg( array( 'upgrade_stats_table' => 'anonymise_ip' ) ); - ?> -
-

-

-
- prefix}ssp_stats SET ip_address = CONCAT( SUBSTRING_INDEX( ip_address, '.', 3 ) , '.0' )"; - $affected_rows = $wpdb->query($query); - - if (false === $affected_rows){ - add_action( 'admin_notices', array( $this, 'update_stats_data_failed' ) ); - }else { - update_option( 'ssp_stats_ips_updated', 'yes' ); - add_action( 'admin_notices', array( $this, 'update_stats_data_succeeded' ) ); - } - - } - - public function update_stats_data_failed(){ - ?> -
-

-
- -
-

-
-