private static function _get_last_send_time() { return apply_filters('elementor/tracker/last_send_time', get_option('elementor_tracker_last_send', false)); } private static function _get_posts_usage() { global $wpdb; $usage = []; $results = $wpdb->get_results("SELECT `post_type`, `post_status`, COUNT(`ID`) `hits` \n\t\t\t\tFROM {$wpdb->posts} `p`\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} `pm` ON(`p`.`ID` = `pm`.`post_id`)\n\t\t\t\tWHERE `post_type` != 'elementor_library'\n\t\t\t\t\tAND `meta_key` = '_elementor_edit_mode' AND `meta_value` = 'builder'\n\t\t\t\tGROUP BY `post_type`, `post_status`;"); if ($results) { foreach ($results as $result) { $usage[$result->post_type][$result->post_status] = $result->hits; } } return $usage; } private static function _get_library_usage() { global $wpdb; $usage = []; $results = $wpdb->get_results("SELECT `meta_value`, COUNT(`ID`) `hits` \n\t\t\t\tFROM {$wpdb->posts} `p`\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} `pm` ON(`p`.`ID` = `pm`.`post_id`)\n\t\t\t\tWHERE `post_type` = 'elementor_library'\n\t\t\t\t\tAND `meta_key` = '_elementor_template_type'\n\t\t\t\tGROUP BY `post_type`, `meta_value`;"); if ($results) { foreach ($results as $result) { $usage[$result->meta_value] = $result->hits; } } return $usage; } } Tracker::init();