Skip to content
Youths Forum Youths Forum Youths Forum

Tech Blogs & Programming Tutorials

Youths Forum Youths Forum Youths Forum

Tech Blogs & Programming Tutorials

  • Blog
  • News
  • Programming
    • PHP
    • JavaScript
    • JQuery
    • CSS
    • HTML
    • API
  • Stock Market Live
  • Automobiles
    • Cars
  • Gadgets
    • Phones
    • Android Phones

Categories

  • Automobiles (12)
    • Cars (7)
  • Blog (103)
    • Poems (2)
    • Space (2)
  • Command (2)
  • Education (2)
  • Entertainment (4)
  • Gadgets (9)
    • Phones (8)
      • Android Phones (4)
  • HTML Templates (11)
  • IT Training Institutes (1)
  • Lifestyle (4)
  • News (51)
  • Others (23)
  • Programming (296)
    • API (16)
    • CSS (83)
    • Database (4)
    • Hosting (1)
    • HTML (37)
    • JavaScript (117)
      • JQuery (27)
      • ReactJS (7)
    • PHP (116)
  • Python (3)
  • recipes (1)
  • SEE Result (1)
  • Server (3)
  • Blog
  • News
  • Programming
    • PHP
    • JavaScript
    • JQuery
    • CSS
    • HTML
    • API
  • Stock Market Live
  • Automobiles
    • Cars
  • Gadgets
    • Phones
    • Android Phones
Close

Search

ProgrammingPHP

Website Performance Analyzing Tool using PHP

By Admin
January 9, 2025 5 Min Read
0

In today’s fast-paced digital world, a website’s performance can make or break its user experience. A slow-loading site or poor server response times can lead to decreased user engagement and even revenue losses. To address these challenges, we introduce the Website Performance Analyzer, a robust tool designed to help website owners and developers gain actionable insights into their site’s performance metrics.

Follow this video for complete guidance:

Full Source Code : Website Performance Analyzer

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Website Performance Analyzer</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        .bg-gradient-purple { 
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); 
        }
        .hover-lift { 
            transition: transform 0.3s ease; 
        }
        .hover-lift:hover { 
            transform: translateY(-5px); }
    </style>
</head>
<body class="bg-light">
    <div class="bg-gradient-purple text-white py-5 shadow-sm">
        <div class="container">
            <h1 class="text-center display-5 fw-bold mb-3">Website Performance Analyzer</h1>
            <p class="text-center lead mb-0 opacity-75">Get detailed insights into your website's performance metrics</p>
        </div>
    </div>
    
    <div class="container my-5">
        <div class="card border-0 shadow-sm p-4 mb-5">
            <form action="" method="POST">
                <div class="input-group input-group-lg">
                    <span class="input-group-text border-0 bg-white">
                        <i class="fas fa-globe text-primary"></i>
                    </span>
                    <input type="text" name="url" value="<?php echo @$_POST['url'];?>" class="form-control border-0 shadow-none" placeholder="Enter website URL (e.g., https://example.com)" required>
                    <button type="submit" class="btn btn-primary px-4">
                        <i class="fas fa-tachometer-alt me-2"></i>Analyze
                    </button>
                </div>
            </form>
        </div>

        <?php
        if ($_SERVER["REQUEST_METHOD"] == "POST") {
            $url = filter_var($_POST['url'], FILTER_VALIDATE_URL);
            if ($url) {
                $ch = curl_init($url);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_HEADER, true);
                curl_setopt($ch, CURLOPT_NOBODY, true);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                $response = curl_exec($ch);
                $total_time = curl_getinfo($ch, CURLINFO_TOTAL_TIME);
                $dns_time = curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME);
                $connect_time = curl_getinfo($ch, CURLINFO_CONNECT_TIME);
                $ssl_time = curl_getinfo($ch, CURLINFO_APPCONNECT_TIME);
                $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
                curl_close($ch);
                
                $content = @file_get_contents($url);
                $page_size = $content ? strlen($content) : 0;

                if ($http_code) {
        ?>
                    <div class="row g-4">
                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-primary bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-clock fa-2x text-primary"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">Total Load Time</h5>
                                    <h3 class="text-primary mb-0"><?php echo round($total_time * 1000, 2); ?> ms</h3>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-success bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-search fa-2x text-success"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">DNS Lookup</h5>
                                    <h3 class="text-success mb-0"><?php echo round($dns_time * 1000, 2); ?> ms</h3>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-info bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-server fa-2x text-info"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">Server Response</h5>
                                    <h3 class="text-info mb-0"><?php echo $http_code; ?></h3>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-warning bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-plug fa-2x text-warning"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">Connection Time</h5>
                                    <h3 class="text-warning mb-0"><?php echo round($connect_time * 1000, 2); ?> ms</h3>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-danger bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-lock fa-2x text-danger"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">SSL Time</h5>
                                    <h3 class="text-danger mb-0"><?php echo round($ssl_time * 1000, 2); ?> ms</h3>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="card border-0 shadow-sm h-100 hover-lift">
                                <div class="card-body text-center p-4">
                                    <div class="rounded-circle bg-secondary bg-opacity-10 p-3 d-inline-block mb-3">
                                        <i class="fas fa-file fa-2x text-secondary"></i>
                                    </div>
                                    <h5 class="text-uppercase text-muted small mb-3">Page Size</h5>
                                    <h3 class="text-secondary mb-0"><?php echo round($page_size / 1024, 2); ?> KB</h3>
                                </div>
                            </div>
                        </div>
                    </div>
        <?php
                } else {
                    echo '<div class="alert alert-danger shadow-sm border-0">Error: Unable to connect to the URL.</div>';
                }
            } else {
                echo '<div class="alert alert-danger shadow-sm border-0">Invalid URL. Please enter a valid URL.</div>';
            }
        }
        ?>
    </div>
</body>
</html>

What is the Website Performance Analyzer?

The Website Performance Analyzer is a web-based tool that simplifies the process of analyzing key performance metrics for any website. By inputting a URL, users can instantly evaluate various technical aspects, such as load time, DNS lookup time, server response, SSL handshake time, and overall page size.

The tool provides detailed insights in an easy-to-understand, visually appealing format, enabling developers to identify bottlenecks and optimize their websites effectively.

Why Website Performance Matters?

Website performance is critical for several reasons:

  • User Experience: Faster websites retain users longer and improve satisfaction.
  • Search Engine Ranking: Search engines like Google prioritize fast-loading websites, making performance a key SEO factor.
  • Conversion Rates: Studies show that even a one-second delay in page load time can reduce conversions by up to 7%.
  • Accessibility: Performance optimization ensures better accessibility for users with slower internet connections.

Key Features of the Tool

  • Total Load Time : This metric measures how quickly the website’s resources are fetched and rendered. It helps in identifying slow-loading pages that may frustrate users.
  • DNS Lookup Time : DNS lookup time tracks how long it takes to resolve the website’s domain name to its corresponding IP address. High DNS lookup times can indicate inefficient domain configurations.
  • Server Response Time : This feature highlights how quickly the server responds to requests. Faster response times indicate a well-optimized server.
  • SSL Handshake Time : The time taken to establish a secure HTTPS connection is crucial for websites requiring secure data transmission.
  • Page Size : This metric shows the total size of the website’s resources, such as images, scripts, and stylesheets. Optimizing page size can significantly enhance loading speeds.

How It Works

Using the Website Performance Analyzer is simple:

  • Enter the URL of the website you wish to analyze in the provided input box.
  • Click on the Analyze button.
  • The tool processes the website and returns a detailed report of performance metrics, displayed in an intuitive, card-based layout.

Who Can Benefit from This Tool?

This tool is ideal for:

  • Web Developers: Debug performance issues during development or after deployment.
  • SEO Specialists: Monitor site performance and ensure it meets SEO standards.
  • Business Owners: Understand how their website performs in real-world scenarios and take steps to improve user experience.

Why Choose the Website Performance Analyzer?

The Website Performance Analyzer stands out because of its simplicity, efficiency, and visually enriched interface. Unlike other tools that require extensive configurations, this tool delivers performance insights in just a few clicks. Its user-friendly design makes it accessible to both technical and non-technical users.

The Website Performance Analyzer is a must-have tool for anyone seeking to improve their website’s speed, reliability, and user experience. Whether you’re troubleshooting a slow-loading page or planning an overall optimization strategy, this tool provides the actionable insights needed to achieve your goals.

Take control of your website’s performance today and deliver the best possible experience to your audience!

Tags:

performancePHP
Author

Admin

Follow Me
Other Articles
Previous

Easily Convert Your Website into a Progressive Web App (PWA)

Next

Design a BMI Calculator using JavaScript

No Comment! Be the first one.

Leave a Reply

Your email address will not be published. Required fields are marked *

FIFA World Cup 2026 Predict and Win by SportsGuff

Recent Posts

  • Unpacking Nepal’s Record Rs 2.12 Trillion Budget and What It Means for You
  • How to Write a Strong Scholarship Application: The Ultimate Step-by-Step Guide
  • How to Prepare for Exams Without Stress: The Ultimate Science-Backed Guide
  • Chiranjibi Adhikari Appointed Acting President of CAN Federation
  • How to Design a Student Marksheet Using HTML and CSS

Tags

adsense ai animate animation animation using HTML and CSS API blog calculator chatgpt Cryptocurrency CSS css animation design Email Facebook featured filemanager file manager free template google htaccess HTML image Instagram interview javascript JQuery jquery ui NADA AutoShow NADA Auto Show 2024 password PHP Progressive Web App PWA QR random react reactjs Rotate travel Twitter vpn youthforum youthsforum youtube

About Us

At Youths Forum, we are passionate about sharing knowledge that empowers students, educators, professionals, and technology enthusiasts.

Our Mission

Our mission is simple: to make technology and education accessible, understandable, and beneficial for everyone. We strive to create content that helps our readers learn new skills and stay updated with industry developments.

RSS RSS

  • Unpacking Nepal’s Record Rs 2.12 Trillion Budget and What It Means for You Admin
  • How to Write a Strong Scholarship Application: The Ultimate Step-by-Step Guide Admin
  • How to Prepare for Exams Without Stress: The Ultimate Science-Backed Guide Admin

Quick Links

  • Stock Market Live
  • Parliament Election 2082
Copyright 2026 — Youths Forum. All rights reserved. Blogsy WordPress Theme