PHPackages                             bramus/mixed-content-scan - 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. bramus/mixed-content-scan

ActiveLibrary

bramus/mixed-content-scan
=========================

Scan your HTTPS-enabled website for Mixed Content

2.9(7y ago)51610.5k↓100%49[17 issues](https://github.com/bramus/mixed-content-scan/issues)[1 PRs](https://github.com/bramus/mixed-content-scan/pulls)MITPHPPHP &gt;=5.4

Since Jan 7Pushed 6y ago24 watchersCompare

[ Source](https://github.com/bramus/mixed-content-scan)[ Packagist](https://packagist.org/packages/bramus/mixed-content-scan)[ RSS](/packages/bramus-mixed-content-scan/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (16)Used By (0)

Mixed Content Scan
==================

[](#mixed-content-scan)

[![Source](https://camo.githubusercontent.com/cfbbe4fa5cf9553728d326399be9482f653fb28ad2f9c8cc5cb2d56e6394377a/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d6272616d75732f6d697865642d2d636f6e74656e742d2d7363616e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/bramus/mixed-content-scan) [![Version](https://camo.githubusercontent.com/f495d699b2340b69c0fc4b4ebac5582dcbe51693d9a26f8fbe27da1db0034e25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272616d75732f6d697865642d636f6e74656e742d7363616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bramus/mixed-content-scan) [![Downloads](https://camo.githubusercontent.com/681e76477b146c89473283a23656150b9ad6fb308b823abbc5ba3af9153a1dee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272616d75732f6d697865642d636f6e74656e742d7363616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bramus/mixed-content-scan/stats) [![License](https://camo.githubusercontent.com/a1e2c33141efa194cf26d9b6e0f93ae9c3fbe80b7c06d5fefe137907e2faf09b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6272616d75732f6d697865642d636f6e74656e742d7363616e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/bramus/mixed-content-scan/blob/master/LICENSE.txt)

Scan your HTTPS-enabled website for Mixed Content

Built by Bramus! () and [Contributors](https://github.com/bramus/mixed-content-scan/graphs/contributors)

About
-----

[](#about)

`Mixed Content Scan` is a CLI Script which crawls+scans HTTPS-enabled websites for Mixed Content.

The script starts at a given URL, and then starts processing it:

- All contained `img[src|srcset|data-src]`, `iframe[src]`, `script[src]`, `link[href][rel="stylesheet"]`, `object[data]`, `form[action]`, `embed[src]`, `video[src]`, `audio[src]`, `source[src|srcset]`, and `params[name="movie"][value]` elements are checked for being Mixed Content or not
- All contained `a[href]` elements linking to the same or a deeper level are successively processed for Mixed Content.

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

[](#installation)

Installation is possible using [Composer](https://getcomposer.org/)

```
composer global require bramus/mixed-content-scan:~2.9

```

*New to Composer?* It's a command line tool for dependency management in PHP. On Linux/Unix/OSX you will need to [download and run the install script](https://getcomposer.org/download/) and *(recommended)* successively [move `composer.phar` to a global location](https://getcomposer.org/doc/00-intro.md#globally). On Windows you will need to [run the installer](https://getcomposer.org/doc/00-intro.md#installation-windows)

Usage
-----

[](#usage)

Run this script from the CLI, a such:

```
$ mixed-content-scan https://www.bram.us/

```

The script itself will start scanning and give feedback whilst running. When Mixed Content is found, the URLs causing Mixed Content warnings will be shown on screen:

```
$ mixed-content-scan https://www.bram.us/
[2015-01-07 12:54:20] MCS.NOTICE: Scanning https://www.bram.us/ [] []
[2015-01-07 12:54:21] MCS.INFO: 00000 - https://www.bram.us/ [] []
[2015-01-07 12:54:22] MCS.INFO: 00001 - https://www.bram.us/projects/ [] []
[2015-01-07 12:54:22] MCS.INFO: 00002 - https://www.bram.us/projects/mint-custom-title/ [] []
[2015-01-07 12:54:23] MCS.INFO: 00003 - https://www.bram.us/projects/bramusicq/ [] []
[2015-01-07 12:54:24] MCS.INFO: 00004 - https://www.bram.us/projects/gm_bramus/ [] []
[2015-01-07 12:54:24] MCS.INFO: 00005 - https://www.bram.us/projects/js_bramus/ [] []
[2015-01-07 12:54:26] MCS.INFO: 00006 - https://www.bram.us/projects/js_bramus/jsprogressbarhandler/ [] []
[2015-01-07 12:54:27] MCS.INFO: 00007 - https://www.bram.us/projects/js_bramus/lazierload/ [] []
[2015-01-07 12:54:27] MCS.INFO: 00008 - https://www.bram.us/projects/the-box-office/ [] []
[2015-01-07 12:54:28] MCS.INFO: 00009 - https://www.bram.us/projects/tinymce-plugins/ [] []
[2015-01-07 12:54:29] MCS.INFO: 00010 - https://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/ [] []
[2015-01-07 12:54:30] MCS.INFO: 00011 - https://www.bram.us/projects/flashlightboxinjector/ [] []

...

[2015-01-07 12:54:45] MCS.INFO: 00036 - https://www.bram.us/2007/06/04/accessible-expanding-and-collapsing-menu/ [] []
[2015-01-07 12:54:45] MCS.ERROR: 00037 - https://www.bram.us/demo/projects/jsprogressbarhandler/ [] []
[2015-01-07 12:54:45] MCS.WARNING: http://www.google-analytics.com/urchin.js [] []
[2015-01-07 12:54:46] MCS.INFO: 00038 - https://www.bram.us/2008/07/11/ror-progress-bar-helper/ [] []
[2015-01-07 12:54:46] MCS.INFO: 00039 - https://www.bram.us/2008/11/10/jsprogressbarhandler-033/ [] []
[2015-01-07 12:54:47] MCS.ERROR: 00040 - https://www.bram.us/demo/projects/lazierload/ [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1212/1285026452_0aeb38b6e6.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1074/1273115418_a77357040a.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1096/1273106588_91f7a736c6.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1324/1216309045_31ca82f9d9.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1262/1217169586_e4b2bfa7df.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1149/1216304291_63fd48d9c4.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1366/1216301505_51b3c590ff.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1184/1216299847_c57975bed2.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1085/1217158084_a9b059d25b.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1040/1216293529_3b7c044815.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1029/1084232736_5b8c023f46.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1318/1043062251_17071a8cc7.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1221/1043059543_05713e6156.jpg [] []
[2015-01-07 12:54:47] MCS.WARNING: http://www.google-analytics.com/urchin.js [] []
[2015-01-07 12:54:47] MCS.INFO: 00041 - https://www.bram.us/2011/09/30/css-regions-and-css-exclusions/ [] []
[2015-01-07 12:54:47] MCS.INFO: 00042 - https://www.bram.us/2014/06/04/good-looking-shapes-gallery/ [] []

...

```

Mixed Content Scan uses ANSI coloring, provided by [bramus/ansi-php](https://github.com/bramus/ansi-php), so one can easily spot errors based on the color.

Advanced usage / CLI Options
----------------------------

[](#advanced-usage--cli-options)

Mixed Content Scan support several CLI options which can manipulate its behavior:

- `--output=path/to/file`: File to output results to. Defaults to `php://stdout` (= show on screen).
- `--format=ansi|no-ansi|json`: Define which formatter to use for outputting the results
    - `ansi` *(Default)*: ANSI Colored Line Formatter
    - `no-ansi`: Monolog Line Formatter
    - `json`: Monolog JSON Formatter
- `--no-crawl`: Don't crawl scanned pages for new pages
- `--no-check-certificate`: Don't check the certificate for validity (e.g. allow self-signed or missing certificates)
- `--timeout=value-in-milliseconds`: How long to wait for each request to complete. Defaults to 10000ms.
- `--delay=value-in-seconds`: How long to wait between each request. Defaults to 0s.
- `--input=path/to/file`: Specify a file containing a list of links as the source, instead of parsing the passed in URL. Automatically enables `--no-crawl`
- `--ignore=path/to/file`: File containing URL patterns to ignore. See *Ignoring links* further down on how to build this file.
- `--loglevel=level`: The Monolog loglevel to log at. Defaults to `200` (= `info`). Both numeric values, as string (lowercase) values are supported as input. See [Monolog Log Levels](https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#log-levels) for more info.
- `--user-agent='user-agent'`: Set the user agent to be used when crawling.

Example: `mixed-content-scan https://www.bram.us/ --ignore=./wordpress.txt --output=./results.txt --format=no-ansi`

Handling errors
---------------

[](#handling-errors)

Internally Mixed Content Scan uses Curl to perform requests. If an error should be encountered (in case of a connection loss for example), the error will be shown on screen:

```
...
[2015-01-07 12:56:43] MCS.INFO: 00003 - https://www.bram.us/projects/bramusicq/ [] []
[2015-01-07 12:56:53] MCS.CRITICAL: cURL Error (28): SSL connection timeout [] []
...

```

Ignoring links
--------------

[](#ignoring-links)

It's possible to define a list of patterns to ignore. To do so, create a text file with on each line a PCRE pattern to ignore. Pass in the path to that file using the `--ignore` option. Lines starting with `#` are considered being comments and therefore are ignored.

For a WordPress installation, the ignore pattern file – which is distributed with Mixed Content Scan in `ignorepattens/wordpress.txt` – would be this:

```
# Paginated Overview Links
^{$rootUrl}/page/(\d+)/$

# Single Post Links
# ^{$rootUrl}/(\d+)/(\d+)/

# Tag Overview Links
^{$rootUrl}/tag/

# Author Overview Links
^{$rootUrl}/author/

# Category Overview Links
^{$rootUrl}/category/

# Monthly Overview Links
^{$rootUrl}/(\d+)/(\d+)/$

# Year Overview Links
^{$rootUrl}/(\d+)/$

# Comment Subscription Link
^{$rootUrl}/comment-subscriptions

# Wordpress Core File Links
^{$rootUrl}/(.*)?wp\-(.*)\.php

# Archive Links
^{$rootUrl}/archive/

# Replyto Links
\?replytocom\=

```

The `{$rootUrl}` token in each pattern will be replaced with the (root) URL passed into the script.

Note: The [PHP PCRE Cheat Sheet](https://www.cs.washington.edu/education/courses/190m/12sp/cheat-sheets/php-regex-cheat-sheet.pdf) might come in handy.

Known issues
------------

[](#known-issues)

Mixed Content Scan:

- Doesn't take `` into account *(but who uses that, anyways?)*
- Doesn't scan linked `.css` or `.js` files themselves for Mixed Content
- Doesn't scan inline `` or `` for mixed content

Please open an issue *(or fix it and perform a pull request ;))* when you've encountered a problem.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% 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 ~108 days

Recently: every ~239 days

Total

15

Last Release

2628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2f3975d755fc2711e29e9795df804bcd686bbb770d0d947eba58f3478942b6d?d=identicon)[bramus](/maintainers/bramus)

---

Top Contributors

[![bramus](https://avatars.githubusercontent.com/u/213073?v=4)](https://github.com/bramus "bramus (104 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (6 commits)")[![konklone](https://avatars.githubusercontent.com/u/4592?v=4)](https://github.com/konklone "konklone (4 commits)")[![mathiasbynens](https://avatars.githubusercontent.com/u/81942?v=4)](https://github.com/mathiasbynens "mathiasbynens (4 commits)")[![hansott](https://avatars.githubusercontent.com/u/3886384?v=4)](https://github.com/hansott "hansott (3 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (2 commits)")[![tristanbes](https://avatars.githubusercontent.com/u/346010?v=4)](https://github.com/tristanbes "tristanbes (1 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (1 commits)")[![georgezee](https://avatars.githubusercontent.com/u/491346?v=4)](https://github.com/georgezee "georgezee (1 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (1 commits)")[![berkod](https://avatars.githubusercontent.com/u/133788?v=4)](https://github.com/berkod "berkod (1 commits)")

### Embed Badge

![Health badge](/badges/bramus-mixed-content-scan/health.svg)

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

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k3](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[drevops/git-artifact

Package artifact from your codebase in CI and push it to a separate git repo.

2133.2k](/packages/drevops-git-artifact)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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