Unused CSS Finder 1.1.2
=======================

Crawls a website and reports the CSS classes and ids that no page uses.

Requires PHP 7.1+ with the curl and dom extensions. Command line only.

Usage
-----
  php unused_css.php https://example.com/
  php unused_css.php https://example.com/ --purge
  php unused_css.php --source=/path/to/your/website/files
  php unused_css.php https://example.com/ --source=/path/to/your/website/files
  php unused_css.php --help

--source reads your templates and scripts for class and id names, so areas a
crawler cannot reach (logins, members areas) are covered. On its own it checks
the .css files in that folder that your source files refer to; with a web address
it adds to what the crawl finds.

Reports are written to a folder named unused-css-<your-host> in the folder
where you run the command: report.txt, report.json and (with --purge) purged/.

Tip: drop report.json onto the online report viewer for an easy-to-read,
searchable summary. It is read in your browser, not uploaded:

  https://www.cssportal.com/unused-css-finder/unused-css-report-viewer.php

It is an estimate, not proof. A crawl does not run JavaScript, log in, or reach
pages that are not linked, and --source counts every word in your files as use,
so review the report before deleting any CSS.

Documentation
-------------
See the online documentation for what is and is not checked, every option,
and troubleshooting:

  https://www.cssportal.com/unused-css-finder/unused-css-finder-cli.php

Keep this file outside your public web folder. Only scan sites you own or
have permission to test.

License
-------
Released under the MIT License. See the LICENSE file. The software is provided
"as is", without warranty of any kind.
