{"id":19325044,"url":"https://github.com/spatie/mixed-content-scanner-cli","last_synced_at":"2025-04-13T11:09:30.397Z","repository":{"id":23355915,"uuid":"98778969","full_name":"spatie/mixed-content-scanner-cli","owner":"spatie","description":"A cli tool to check your site for mixed content","archived":false,"fork":false,"pushed_at":"2022-09-07T08:42:02.000Z","size":345,"stargazers_count":85,"open_issues_count":0,"forks_count":18,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-09T22:22:48.084Z","etag":null,"topics":["command-line","developer-tools","mixed-content-error","security","ssl"],"latest_commit_sha":null,"homepage":"https://spatie.be/opensource","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-30T06:13:55.000Z","updated_at":"2023-12-07T20:26:50.000Z","dependencies_parsed_at":"2022-09-07T10:41:27.303Z","dependency_job_id":null,"html_url":"https://github.com/spatie/mixed-content-scanner-cli","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fmixed-content-scanner-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fmixed-content-scanner-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fmixed-content-scanner-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Fmixed-content-scanner-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/mixed-content-scanner-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","developer-tools","mixed-content-error","security","ssl"],"created_at":"2024-11-10T02:08:43.874Z","updated_at":"2025-04-13T11:09:30.366Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A CLI tool to check sites for mixed content\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/mixed-content-scanner-cli.svg?style=flat-square)](https://packagist.org/packages/spatie/mixed-content-scanner-cli)\n[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/mixed-content-scanner-cli.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/mixed-content-scanner-cli)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/mixed-content-scanner-cli.svg?style=flat-square)](https://packagist.org/packages/spatie/mixed-content-scanner-cli)\n\nThis repo contains a tool called `mixed-content-scanner` that can help you find pieces of mixed content on your site. This is how you can use it:\n\n```bash\nmixed-content-scanner scan https://spatie.be\n```\n\nAnd of course our company site reports no mixed content.\n\n![spatie](https://spatie.github.io/mixed-content-scanner-cli/spatie.jpg)\n\nHere's an example of a local test server that does contain some mixed content:\n\n![mixed](https://spatie.github.io/mixed-content-scanner-cli/mixed.jpg)\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/mixed-content-scanner-cli.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/mixed-content-scanner-cli)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer global require spatie/mixed-content-scanner-cli\n```\n\n## How it works under the hood\n\nWhen scanning a site, the tool will crawl every page. On all html retrieved, these elements and attributes will be checked:\n\n- `audio`: `src`\n- `embed`: `src`\n- `form`: `action`\n- `link`: `href`\n- `iframe`: `src`\n- `img`: `src`, `srcset`\n- `object`: `data`\n- `param`: `value`\n- `script`: `src`\n- `source`: `src`, `srcset`\n- `video`: `src`\n\nIf any of those attributes start with `http://` the element will be regarded as mixed content.\n\nThe tool does not scan linked `.css` or `.js` files. Inline `\u003cscript\u003e` or `\u003cstyle\u003e` are not taken into consideration.\n\n## Usage\n\nYou can scan a site by using the `scan` command followed by the url\n\n```bash\nmixed-content-scanner scan https://example.com\n```\n\n## Options\n\n### SSL verification\n\nYou might want to check your site for mixed content before actually launching it.  It's quite common your site doesn't have an ssl certificate installed yet at that point. That's why by default the tool will not verify ssl certificates.\n\nIf you want to turn on ssl verification just use the `verify-ssl option`\n\n```bash\nmixed-content-scanner scan https://self-signed.badssl.com/ --verify-ssl\n```\n\nThat examples will result in non responding urls because the host does not have a valid ssl certificate\n\n### Filtering and ignoring urls\n\nYou can filter which urls are going to be crawled by passing regex to the `filter` and `ignore` options. \n\nIn this example we are only going to crawl pages starting with `/en`.\n\n```bash\nmixed-content-scanner scan https://spatie.be --filter=\"^\\/en\"\n```\n\nYou can use multiple filters:\n\n```bash\nmixed-content-scanner scan https://spatie.be --filter=\"^\\/en\" --filter=\"^\\/nl\"\n```\n\nYou can also ignore certain urls. Here we are going to ignore all url's that contain the word `opensource`.\n\n```bash\nmixed-content-scanner scan https://spatie.be --ignore=\"opensource\"\n```\n\nOf course you can also combine filters and ignores:\n\n```bash\nmixed-content-scanner scan https://spatie.be --filter=\"^\\/en\" --ignore=\"opensource\"\n```\n\n### Ignoring robots\n\nBy default, the crawler will respect robots data. You can ignore them though with the `--ignore-robots` option.\n\n```bash\nmixed-content-scanner scan https://example.com --ignore-robots\n```\n\n### Custom User agent\nBy default, the crawler uses the underlying guzzle client for the user agent. You can override this value with the `--user-agent` option.\n```bash\nmixed-content-scanner scan https://example.com --user-agent='MyCustomCrawler'\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Postcardware\n\nYou're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.\n\nOur address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.\n\nWe publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).\n\n## Credits\n\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\nThe scanner is inspired by [mixed-content-scan](https://github.com/bramus/mixed-content-scan) by [Bram Van Damme](https://github.com/bramus). Parts of his readme and code were used.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fmixed-content-scanner-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Fmixed-content-scanner-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Fmixed-content-scanner-cli/lists"}