Estimated reading time : 3 min · Published
Inventory files by purpose
Start with public pages and follow their includes, stylesheets, scripts and datasets. Add routes defined in server configuration and files loaded from calculated names. A photograph may be selected through a catalogue without appearing directly in the page code.
In a PHP project, include and require load other files, so a folder named scripts may contain essential code. Preserve configuration, secrets, keys and access settings. Generated files, such as translation dictionaries or image manifests, may also be needed on every page view.
Choose deletions you can explain
For each candidate, record its purpose, the references checked and the reason for removal. Audit screenshots and local reports are often candidates; an optimized image or font needs further checking. Compare the contents of copies before treating them as duplicates.
A missing literal reference does not prove that a file is unused: examine assembled paths, JSON lists and responsive variants. Work in small groups on a restorable copy. Keep a file when its dependencies remain uncertain and record what is needed to decide.
Fictional example: index.php reads catalogue.json, whose internal configuration selects view.php from permitted templates. The name view.php may therefore be absent from the entry file while remaining essential. Follow the chain from entry point through data, template selection and includes. The diagram describes this teaching example; it does not suggest loading an unrestricted visitor-supplied path.
Then classify candidates by available evidence. A photo-640.webp variant may be selected through srcset without appearing in the main template. A cache requires knowing its producer and rebuild conditions; its name does not make it disposable. An audit screenshot used only in a report can be kept outside the delivered folder after checking. Validate each decision on a restorable copy, with the relevant languages and screen sizes.
Scroll the table horizontally to read every column. With a keyboard, focus the table area and use the arrow keys.
| Candidate | Evidence found or missing | Decision before delivery |
|---|---|---|
| view.php | Template selected by internal configuration | Keep it with its loading chain |
| photo-640.webp | Variant referenced in srcset or the data producing it | Keep and test screen sizes |
| capture-audit.png | Report-only use; no production use established after review | Archive outside delivery if the evidence is sufficient |
| cache/catalog.json | Rebuild and network dependencies unverified | Keep until rebuilding is validated |
Verify and deliver a clean project
After each group is removed, open the main page families in every language. Check images, downloads, fonts, the sitemap, feeds and interactive features. Compare the results with the behaviour observed before cleanup, on a phone and a computer.
Record the file count, completed checks and limitations. Store backups outside the public root with suitable protection. Delete temporary verification files and stop test servers; production content, data and dependencies remain in the project.
Reference documents
- PHP : include · Source consulted
- PHP : require
- MDN : Image candidates with srcset · Source consulted
Content updated on
