PHPackages                             wtiservice/wti-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. wtiservice/wti-service

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

wtiservice/wti-service
======================

Check Overall Website Performance

v2.0.1(2y ago)04MITPHP

Since Sep 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Aseemkumar17/trialWPIServices)[ Packagist](https://packagist.org/packages/wtiservice/wti-service)[ RSS](/packages/wtiservice-wti-service/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

WpiService PHP Class
====================

[](#wpiservice-php-class)

The `WpiService` class is a PHP library that allows you to check the performance of a website using the Google PageSpeed Insights API. This library provides a convenient way to analyze a website's performance metrics and retrieve specific performance data.

Installation
------------

[](#installation)

To use this library in your PHP project, follow these steps:

1. Install Guzzle HTTP client, if you haven't already, using Composer:

    ```
    composer require guzzlehttp/guzzle
    ```
2. Install `WpiService` Package in your project.

    ```
    composer require wpiservice/wpi-service
    ```
3. Create an instance of the `WpiService` class in your code.

```
use wpiservice\WpiService\WpiService;

$wpiService = new WpiService();
```

Usage
-----

[](#usage)

### Performance Analysis

[](#performance-analysis)

You can use the `Performance` method to analyze the performance of a website. This method takes two parameters: the URL of the website to be analyzed and your Google PageSpeed API key for authentication and access to the API.

```
$url = 'https://example.com';
$apiKey = 'your-api-key';

$result = $wpiService->Performance($url, $apiKey);

if (isset($result['error'])) {
    // Handle the error.
} else {
    // Use the performance data.
}
```

### Fetching Specific Performance Metrics

[](#fetching-specific-performance-metrics)

You can also fetch specific performance metrics from the Google PageSpeed Insights data using the `PerformanceMetric` method. This method takes two parameters: the performance data obtained from the API and the name of the specific performance metric to be retrieved.

```
$performanceData = $wpiService->Performance($url, $apiKey);
$metricName = 'first-contentful-paint';

$metricData = $wpiService->PerformanceMetric($performanceData, $metricName);

if (isset($metricData['error'])) {
    // Handle the error.
} else {
    // Use the specific performance metric data.
}
```

Valid values for `$metricName` include:

- 'first-contentful-paint'
- 'largest-contentful-paint'
- 'total-blocking-time'
- 'cumulative-layout-shift'

Error Handling
--------------

[](#error-handling)

Both `Performance` and `PerformanceMetric` methods return an associative array containing performance data or an error message if the request or metric retrieval fails. You should check for the presence of the 'error' key in the returned data to handle errors gracefully.

License
-------

[](#license)

This library is licensed under the MIT License.

Contribution
------------

[](#contribution)

Contributions are welcome! If you'd like to contribute to this project, please open an issue or submit a pull request.

---

Feel free to customize this README to include your name, contact information, and any additional details specific to your project. Providing clear and comprehensive documentation will make it easier for others to use your PHP class.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36c29f5a8dca520a3eb5432e80616b85eaf8b814beb787776b69740274cf135a?d=identicon)[Aseem Kumar](/maintainers/Aseem%20Kumar)

---

Top Contributors

[![Aseemkumar17](https://avatars.githubusercontent.com/u/126453889?v=4)](https://github.com/Aseemkumar17 "Aseemkumar17 (5 commits)")

### Embed Badge

![Health badge](/badges/wtiservice-wti-service/health.svg)

```
[![Health](https://phpackages.com/badges/wtiservice-wti-service/health.svg)](https://phpackages.com/packages/wtiservice-wti-service)
```

###  Alternatives

[scrutinizer/ocular

411.8M1.4k](/packages/scrutinizer-ocular)[larawatcher/larawatcher

Larawatcher: Laravel Database Query Profiler

10487.6k](/packages/larawatcher-larawatcher)[inviqa/spryker-debug

Inviqa Spryker Debug Module

14148.8k](/packages/inviqa-spryker-debug)[excimetry/excimetry

Excimetry PHP package. Bridge between ext-eximer and open telemetry

602.2k1](/packages/excimetry-excimetry)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
