PHPackages                             spatie/mixed-content-scanner-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. spatie/mixed-content-scanner-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

spatie/mixed-content-scanner-cli
================================

A tool to scan sites for mixed content

1.4.0(3y ago)922.5k20MITPHPPHP ^8.0CI passing

Since Jul 30Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/spatie/mixed-content-scanner-cli)[ Packagist](https://packagist.org/packages/spatie/mixed-content-scanner-cli)[ Docs](https://github.com/spatie/mixed-content-scanner-cli)[ RSS](/packages/spatie-mixed-content-scanner-cli/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (9)Dependencies (12)Versions (10)Used By (0)

A CLI tool to check sites for mixed content
===========================================

[](#a-cli-tool-to-check-sites-for-mixed-content)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d006c6041b05c47af22dc61e81c8c931af20c76c2129fc17547dc0f92ace35e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6d697865642d636f6e74656e742d7363616e6e65722d636c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/mixed-content-scanner-cli)[![Quality Score](https://camo.githubusercontent.com/f29a74e268b59337f5e47ec871eebb82f33b0b8f3e55bb06bfe486fec16ba765/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f6d697865642d636f6e74656e742d7363616e6e65722d636c692e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/mixed-content-scanner-cli)[![Total Downloads](https://camo.githubusercontent.com/9098142871e0073a9240a5e489c14c70c5463ed177ad9ab6b4eb437737ebb09b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6d697865642d636f6e74656e742d7363616e6e65722d636c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/mixed-content-scanner-cli)

This 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:

```
mixed-content-scanner scan https://spatie.be
```

And of course our company site reports no mixed content.

[![spatie](https://camo.githubusercontent.com/ca1254533661bf99698a577a8183a17241df84be81ce49635d2c7b213ea6405b/68747470733a2f2f7370617469652e6769746875622e696f2f6d697865642d636f6e74656e742d7363616e6e65722d636c692f7370617469652e6a7067)](https://camo.githubusercontent.com/ca1254533661bf99698a577a8183a17241df84be81ce49635d2c7b213ea6405b/68747470733a2f2f7370617469652e6769746875622e696f2f6d697865642d636f6e74656e742d7363616e6e65722d636c692f7370617469652e6a7067)

Here's an example of a local test server that does contain some mixed content:

[![mixed](https://camo.githubusercontent.com/b06a23fc03768f0d07d38b66a924a02d06d6c238a39ba049ea4d3b8558bd9891/68747470733a2f2f7370617469652e6769746875622e696f2f6d697865642d636f6e74656e742d7363616e6e65722d636c692f6d697865642e6a7067)](https://camo.githubusercontent.com/b06a23fc03768f0d07d38b66a924a02d06d6c238a39ba049ea4d3b8558bd9891/68747470733a2f2f7370617469652e6769746875622e696f2f6d697865642d636f6e74656e742d7363616e6e65722d636c692f6d697865642e6a7067)

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/dbc1b561eed5fcfc66a61db867eeead0d47651e71c8afca8eff2f0b8302d44c8/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6d697865642d636f6e74656e742d7363616e6e65722d636c692e6a70673f743d31)](https://spatie.be/github-ad-click/mixed-content-scanner-cli)

We 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).

We 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).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer global require spatie/mixed-content-scanner-cli
```

How it works under the hood
---------------------------

[](#how-it-works-under-the-hood)

When scanning a site, the tool will crawl every page. On all html retrieved, these elements and attributes will be checked:

- `audio`: `src`
- `embed`: `src`
- `form`: `action`
- `link`: `href`
- `iframe`: `src`
- `img`: `src`, `srcset`
- `object`: `data`
- `param`: `value`
- `script`: `src`
- `source`: `src`, `srcset`
- `video`: `src`

If any of those attributes start with `http://` the element will be regarded as mixed content.

The tool does not scan linked `.css` or `.js` files. Inline `` or `` are not taken into consideration.

Usage
-----

[](#usage)

You can scan a site by using the `scan` command followed by the url

```
mixed-content-scanner scan https://example.com
```

Options
-------

[](#options)

### SSL verification

[](#ssl-verification)

You 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.

If you want to turn on ssl verification just use the `verify-ssl option`

```
mixed-content-scanner scan https://self-signed.badssl.com/ --verify-ssl
```

That examples will result in non responding urls because the host does not have a valid ssl certificate

### Filtering and ignoring urls

[](#filtering-and-ignoring-urls)

You can filter which urls are going to be crawled by passing regex to the `filter` and `ignore` options.

In this example we are only going to crawl pages starting with `/en`.

```
mixed-content-scanner scan https://spatie.be --filter="^\/en"
```

You can use multiple filters:

```
mixed-content-scanner scan https://spatie.be --filter="^\/en" --filter="^\/nl"
```

You can also ignore certain urls. Here we are going to ignore all url's that contain the word `opensource`.

```
mixed-content-scanner scan https://spatie.be --ignore="opensource"
```

Of course you can also combine filters and ignores:

```
mixed-content-scanner scan https://spatie.be --filter="^\/en" --ignore="opensource"
```

### Ignoring robots

[](#ignoring-robots)

By default, the crawler will respect robots data. You can ignore them though with the `--ignore-robots` option.

```
mixed-content-scanner scan https://example.com --ignore-robots
```

### Custom User agent

[](#custom-user-agent)

By default, the crawler uses the underlying guzzle client for the user agent. You can override this value with the `--user-agent` option.

```
mixed-content-scanner scan https://example.com --user-agent='MyCustomCrawler'
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You'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.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

The 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.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance51

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 50.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~233 days

Recently: every ~413 days

Total

9

Last Release

1392d ago

Major Versions

0.0.1 → 1.0.02017-08-03

PHP version history (2 changes)0.0.1PHP ^7.1

1.4.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (48 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (14 commits)")[![tonsit](https://avatars.githubusercontent.com/u/1192391?v=4)](https://github.com/tonsit "tonsit (8 commits)")[![mrk-j](https://avatars.githubusercontent.com/u/1250622?v=4)](https://github.com/mrk-j "mrk-j (8 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (3 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (3 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (1 commits)")

---

Tags

command-linedeveloper-toolsmixed-content-errorsecuritysslhttpsspatieclitoolmixed-content-scanner-climixed-content

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spatie-mixed-content-scanner-cli/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-mixed-content-scanner-cli/health.svg)](https://phpackages.com/packages/spatie-mixed-content-scanner-cli)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k569.8M787](/packages/psy-psysh)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M130](/packages/wp-cli-wp-cli-tests)[spatie/flare-client-php

Send PHP errors to Flare

177156.9M21](/packages/spatie-flare-client-php)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.0M321](/packages/drupal-core-dev)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
