Skip to content

Lighthouse Report

The TerraLighthouse will be used to handle Lighthouse reports and scheduling tasks.

The TerraLighthouse class is a custom utility we use in the admin panel of our websites to monitor the overall health of our pages. It evaluates key metrics such as performance, SEO, and accessibility, utilizing the Lighthouse API. This API returns scores for both mobile and desktop views, which we store in our custom database and display in a table format for easy reference.

The API runs automatically via a cron job every 12 hours. If any values are flagged as suboptimal for our standards, an email alert is triggered, highlighting the areas in need of improvement and providing suggestions on how to enhance those metrics.

This system ensures we’re always up-to-date on how our websites are performing and can act quickly to resolve any issues that arise.

You can find the full class implementation here.

<?php
// Create an instance of the TerraLighthouse class with specified parameters
new TerraLighthouse((object) array(
'email' => array('email@terrahq.com', "email-2@terrahq.com", "email-3@terrahq.com"), // Email address to be used in the class
'interval' => 43200, // Interval in seconds (12 hours) for cron job execution
'url' => 'https://www.yourproject.com/', //add always wwww to the URL and URL to be used in the class, change this accordingly
));
?>