Get Google Page Speed data for a given URL

dev-master 2016-08-13 23:52 UTC

This package is auto-updated.

Last update: 2020-07-07 22:00:32 UTC


Requires PHP7


composer require calderawp/speed


Get API key and such

 	use calderawp\speed\Client;
 	$key = 'YOUR KEY';
 	$url = '';
 	$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.