CalderaWP/page-speed

Name: page-speed

Owner: Caldera Labs

Description: Get Google page speed from URL as formatted results

Created: 2016-08-13 23:52:06.0

Updated: 2016-08-14 13:01:29.0

Pushed: 2016-08-13 23:52:45.0

Homepage: null

Size: 2

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Turn URL into Google PageSpeed Results

Requires PHP7

Install

composer require calderawp/speed

Usage

Get API key and such https://developers.google.com/speed/docs/insights/v1/getting_started

use calderawp\speed\Client;

$key = 'YOUR KEY';
$url = 'https://calderawp.com';
$client = new Client( $url, $key );
try {
    //If succesful you will have results as stdClass
    $response = $client->query();
}catch( \Exception $e ){
    return $e->getMessage();
}

//Get object of calderawp\speed\Result from results
//Try/catch above was to prevent this running without valid data, which would make fatal error, which is bad.
$result = $client->get_result();
Copyright 2016 CalderaWP LLC & Josh Pollock. Licensed under the terms of the GNU GPL version 2 or later. Please share with your neighbor.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.