// Domain WHOIS Lookup Shortcode for Elementor function whois_lookup_shortcode($atts) { $domain = isset($_POST['whois_domain']) ? sanitize_text_field($_POST['whois_domain']) : ''; if (!$domain) return '
'; $api_key = 'at_asFTPYWiFVUEbUAZ6pYCeAjWmkhpW'; // আপনার actual API key $api_url = "https://www.whoisxmlapi.com/whoisserver/WhoisService?apiKey={$api_key}&domainName={$domain}&output=json"; $response = wp_remote_get($api_url); if (is_wp_error($response)) return 'API Error'; $data = json_decode(wp_remote_retrieve_body($response), true); if (empty($data['WhoisRecord'])) return 'No data found'; $w = $data['WhoisRecord']; // যেহেতু আপনি বিস্তারিত চাচ্ছেন, নিচে সব ফিল্ড ম্যাপ করলাম $registrant = $w['registrant'] ?? []; $admin = $w['administrativeContact'] ?? []; $tech = $w['technicalContact'] ?? []; $html = '

Domain Info

'; $html .= "

Domain Name: {$w['domainName']}

"; $html .= "

Host IP: {$w['nameServers']['hostNames'][0] ?? 'N/A'}

"; // IP direct দেওয়া না থাকলে $html .= "

Registrar: {$w['registrarName']}

"; $html .= "

Service Provider: {$w['registrant']['organization'] ?? 'N/A'}

"; $html .= "

Registered On: {$w['createdDate']}

"; $html .= "

Age: " . (isset($w['createdDate']) ? floor((time() - strtotime($w['createdDate'])) / (365*24*3600)) . ' years' : 'N/A') . "

"; $html .= "

Expires On: {$w['expiresDate']}

"; $html .= "

Updated On: {$w['updatedDate']}

"; $html .= "

Registrar status: {$w['status']}

"; $html .= "

Name Servers: " . implode(', ', $w['nameServers']['hostNames'] ?? []) . "

"; // Site View – সাধারণত url $html .= "

Site View: {$domain}

"; // Registrant Info $html .= "

Registrant Info

Name: {$registrant['name']}
Organization: {$registrant['organization']}
Street: {$registrant['street1']}
City: {$registrant['city']}
Postal Code: {$registrant['postalCode']}
Country: {$registrant['country']}
Phone: {$registrant['telephone']}
Email: {$registrant['email']}

"; // Admin Info $html .= "

Admin Info

Name: {$admin['name']}
Organization: {$admin['organization']}
Street: {$admin['street1']}
City: {$admin['city']}
Postal Code: {$admin['postalCode']}
Country: {$admin['country']}
Phone: {$admin['telephone']}
Email: {$admin['email']}

"; // Technical Info $html .= "

Technical Info

Name: {$tech['name']}
Organization: {$tech['organization']}
Street: {$tech['street1']}
City: {$tech['city']}
Postal Code: {$tech['postalCode']}
Country: {$tech['country']}
Phone: {$tech['telephone']}
Email: {$tech['email']}

"; $html .= '
'; return $html; } add_shortcode('whois_tool', 'whois_lookup_shortcode'); My Blog – My WordPress Blog
Scroll to Top