Vuurtoren is a set of quick 'n dirty PHP scripts to assist in testing websites with Lighthouse.
Keep in mind these scripts were developed for my own purpose. I only share these scripts so others (including myself) may learn from it. Pull requests and issues are welcomed but do not assume these scripts will be maintained.
- Install PHP CLI (at least 7.2.17) including PHP-XML (I've used Ubuntu's default packages)
- Install CLI version of Lighthouse using this guide.
- Git clone this repository
- Read the scripts: 'fetchSitemaps.php', 'generateURLsFromSitemaps.php' and 'runLighthouseOnURLS.php'. The last one contains the Lighthouse parameters, feel free to adjust to your own liking.
- Edit the sitemaps_urls.txt file with URLs pointing towards XML sitemaps
- Open a terminal and run:
php -f fetchSitemaps.php sitemaps_urls.txt
- Check if the sitemaps where downloaded correctly in sitemaps
- In the terminal run:
php -f generateURLsFromSitemaps.php sitemaps
to generate files with urls for Lighthouse - Check if the files are created correctly in urls
- In the terminal run:
time php -f runLighthouseOnURLS.php urls
(time is an optional command-line utility showing how long the script took) - Enjoy doing something else while Lighthouse tests your website(s)
Note: You need to do this on a machine with Chrome browser installed. Chromium apparently gave errors such as NO_TRACING_STARTED
- Ubuntu 18.04.2 LTS
- NPM 6.4.1 (Nodejs 10.15.3 deb from Nodesource, Ubuntu's package was older if I remember correctly)
- Lighthouse 4.1.0
- PHP 7.2.17