2017 © Pedro Peláez
 

library mixed-content-scanner-cli

A tool to scan sites for mixed content

image

spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  • Tuesday, May 22, 2018
  • by Spatie
  • Repository
  • 6 Watchers
  • 49 Stars
  • 277 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 11 Versions
  • 30 % Grown

The README.md

A CLI tool to check sites for mixed content

Latest Version on Packagist Quality Score Total Downloads, (*1)

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:, (*2)

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

And of course our company site reports no mixed content., (*3)

spatie, (*4)

Here's an example of a local test server that does contain some mixed content:, (*5)

mixed, (*6)

Support us

, (*7)

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products., (*8)

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. We publish all received postcards on our virtual postcard wall., (*9)

Installation

You can install the package via composer:, (*10)

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

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:, (*11)

  • 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., (*12)

The tool does not scan linked .css or .js files. Inline <script> or <style> are not taken into consideration., (*13)

Usage

You can scan a site by using the scan command followed by the url, (*14)

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

Options

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., (*15)

If you want to turn on ssl verification just use the verify-ssl option, (*16)

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, (*17)

Filtering and ignoring urls

You can filter which urls are going to be crawled by passing regex to the filter and ignore options., (*18)

In this example we are only going to crawl pages starting with /en., (*19)

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

You can use multiple filters:, (*20)

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., (*21)

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

Of course you can also combine filters and ignores:, (*22)

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

Ignoring robots

By default, the crawler will respect robots data. You can ignore them though with the --ignore-robots option., (*23)

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

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., (*24)

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

Changelog

Please see CHANGELOG for more information what has changed recently., (*25)

Testing

bash composer test, (*26)

Contributing

Please see CONTRIBUTING for details., (*27)

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker., (*28)

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., (*29)

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium., (*30)

We publish all received postcards on our company website., (*31)

Credits

The scanner is inspired by mixed-content-scan by Bram Van Damme. Parts of his readme and code were used., (*32)

License

The MIT License (MIT). Please see License File for more information., (*33)

The Versions

22/05 2018

dev-master

9999999-dev https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

22/05 2018

1.2.0

1.2.0.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

02/03 2018

dev-analysis-XZPdbb

dev-analysis-XZPdbb https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

02/03 2018

1.1.2

1.1.2.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

26/02 2018

1.1.1

1.1.1.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

22/12 2017

1.1.0

1.1.0.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

22/12 2017

1.2.0.x-dev

1.2.0.9999999-dev https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

03/08 2017

1.0.1

1.0.1.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

03/08 2017

1.0.0

1.0.0.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

30/07 2017

0.0.1

0.0.1.0 https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content

30/07 2017

dev-analysis-XZ2EDN

dev-analysis-XZ2EDN https://github.com/spatie/mixed-content-scanner-cli

A tool to scan sites for mixed content

  Sources   Download

MIT

The Requires

 

The Development Requires

https cli spatie tool mixed-content-scanner-cli mixed-content