$hostname, 'path' => $request_path, 'useragent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT']), 'version' => $GLOBALS['PLUGIN_VERSION'], )); $headers = array( 'Content-Type: application/x-www-form-urlencoded', 'user-agent' => 'AiTrackerStats/' . $GLOBALS['PLUGIN_VERSION'], ); wp_remote_post('https://aitrackerstats.com/api/aitracker', array( 'body' => $body, 'headers' => $headers, )); } } function aitrackerstats_enqueue_styles() { wp_enqueue_style( 'aitrackerstats-admin-styles', plugins_url('admin-styles.css', __FILE__) ); } add_action('admin_enqueue_scripts', 'aitrackerstats_enqueue_styles'); function aitrackerstats_sidebar_menu() { add_menu_page( 'A.I. Tracking Stats', 'A.I. Tracking Stats', 'manage_options', 'ai-tracking-stats', 'custom_menu_page_callback', plugins_url('ai.svg', __FILE__), 200 ); add_submenu_page( 'ai-tracking-stats', 'Verification Code', 'Verification Code', 'manage_options', 'ai-tracking-verification-code', 'show_verification_code' ); } function show_verification_code() { $site_url = home_url(); $hostname = wp_parse_url($site_url, PHP_URL_HOST); $base = base64_encode($hostname); echo '
Your Domain is : ' . esc_html($hostname) . '
'; echo 'Your verification code is: ' . esc_html($base) . '
'; echo 'Please use these when registering your site on https://aitrackerstats.com/app/login.
'; echo '