{"id":13453463,"url":"https://github.com/bramus/mixed-content-scan","last_synced_at":"2025-05-16T10:08:56.671Z","repository":{"id":24423355,"uuid":"27824509","full_name":"bramus/mixed-content-scan","owner":"bramus","description":"Scan your HTTPS-enabled website for Mixed Content","archived":false,"fork":false,"pushed_at":"2019-12-09T16:55:02.000Z","size":100,"stargazers_count":521,"open_issues_count":17,"forks_count":50,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-10T20:17:44.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"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/bramus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-10T14:55:48.000Z","updated_at":"2025-05-09T09:13:17.000Z","dependencies_parsed_at":"2022-08-06T02:00:21.833Z","dependency_job_id":null,"html_url":"https://github.com/bramus/mixed-content-scan","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramus%2Fmixed-content-scan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramus%2Fmixed-content-scan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramus%2Fmixed-content-scan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramus%2Fmixed-content-scan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bramus","download_url":"https://codeload.github.com/bramus/mixed-content-scan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082892,"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":[],"created_at":"2024-07-31T08:00:40.390Z","updated_at":"2025-05-16T10:08:51.657Z","avatar_url":"https://github.com/bramus.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Mixed Content Scan\n\n[![Source](http://img.shields.io/badge/source-bramus/mixed--content--scan-blue.svg?style=flat-square)](https://github.com/bramus/mixed-content-scan) [![Version](https://img.shields.io/packagist/v/bramus/mixed-content-scan.svg?style=flat-square)](https://packagist.org/packages/bramus/mixed-content-scan) [![Downloads](https://img.shields.io/packagist/dt/bramus/mixed-content-scan.svg?style=flat-square)](https://packagist.org/packages/bramus/mixed-content-scan/stats) [![License](https://img.shields.io/packagist/l/bramus/mixed-content-scan.svg?style=flat-square)](https://github.com/bramus/mixed-content-scan/blob/master/LICENSE.txt)\n\n\nScan your HTTPS-enabled website for Mixed Content\n\nBuilt by Bramus! ([https://www.bram.us/](https://www.bram.us/)) and [Contributors](https://github.com/bramus/mixed-content-scan/graphs/contributors)\n\n## About\n\n`Mixed Content Scan` is a CLI Script which crawls+scans HTTPS-enabled websites for Mixed Content.\n\nThe script starts at a given URL, and then starts processing it:\n\n*  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\n*  All contained `a[href]` elements linking to the same or a deeper level are successively processed for Mixed Content.\n\n## Installation\n\nInstallation is possible using [Composer](https://getcomposer.org/)\n\n```\ncomposer global require bramus/mixed-content-scan:~2.9\n```\n\n_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)\n\n## Usage\n\nRun this script from the CLI, a such:\n\n```\n$ mixed-content-scan https://www.bram.us/\n```\n\nThe 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:\n\n```\n$ mixed-content-scan https://www.bram.us/\n[2015-01-07 12:54:20] MCS.NOTICE: Scanning https://www.bram.us/ [] []\n[2015-01-07 12:54:21] MCS.INFO: 00000 - https://www.bram.us/ [] []\n[2015-01-07 12:54:22] MCS.INFO: 00001 - https://www.bram.us/projects/ [] []\n[2015-01-07 12:54:22] MCS.INFO: 00002 - https://www.bram.us/projects/mint-custom-title/ [] []\n[2015-01-07 12:54:23] MCS.INFO: 00003 - https://www.bram.us/projects/bramusicq/ [] []\n[2015-01-07 12:54:24] MCS.INFO: 00004 - https://www.bram.us/projects/gm_bramus/ [] []\n[2015-01-07 12:54:24] MCS.INFO: 00005 - https://www.bram.us/projects/js_bramus/ [] []\n[2015-01-07 12:54:26] MCS.INFO: 00006 - https://www.bram.us/projects/js_bramus/jsprogressbarhandler/ [] []\n[2015-01-07 12:54:27] MCS.INFO: 00007 - https://www.bram.us/projects/js_bramus/lazierload/ [] []\n[2015-01-07 12:54:27] MCS.INFO: 00008 - https://www.bram.us/projects/the-box-office/ [] []\n[2015-01-07 12:54:28] MCS.INFO: 00009 - https://www.bram.us/projects/tinymce-plugins/ [] []\n[2015-01-07 12:54:29] MCS.INFO: 00010 - https://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/ [] []\n[2015-01-07 12:54:30] MCS.INFO: 00011 - https://www.bram.us/projects/flashlightboxinjector/ [] []\n\n...\n\n[2015-01-07 12:54:45] MCS.INFO: 00036 - https://www.bram.us/2007/06/04/accessible-expanding-and-collapsing-menu/ [] []\n[2015-01-07 12:54:45] MCS.ERROR: 00037 - https://www.bram.us/demo/projects/jsprogressbarhandler/ [] []\n[2015-01-07 12:54:45] MCS.WARNING: http://www.google-analytics.com/urchin.js [] []\n[2015-01-07 12:54:46] MCS.INFO: 00038 - https://www.bram.us/2008/07/11/ror-progress-bar-helper/ [] []\n[2015-01-07 12:54:46] MCS.INFO: 00039 - https://www.bram.us/2008/11/10/jsprogressbarhandler-033/ [] []\n[2015-01-07 12:54:47] MCS.ERROR: 00040 - https://www.bram.us/demo/projects/lazierload/ [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1212/1285026452_0aeb38b6e6.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1074/1273115418_a77357040a.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1096/1273106588_91f7a736c6.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1324/1216309045_31ca82f9d9.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1262/1217169586_e4b2bfa7df.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1149/1216304291_63fd48d9c4.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1366/1216301505_51b3c590ff.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1184/1216299847_c57975bed2.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1085/1217158084_a9b059d25b.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1040/1216293529_3b7c044815.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1029/1084232736_5b8c023f46.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1318/1043062251_17071a8cc7.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://farm2.static.flickr.com/1221/1043059543_05713e6156.jpg [] []\n[2015-01-07 12:54:47] MCS.WARNING: http://www.google-analytics.com/urchin.js [] []\n[2015-01-07 12:54:47] MCS.INFO: 00041 - https://www.bram.us/2011/09/30/css-regions-and-css-exclusions/ [] []\n[2015-01-07 12:54:47] MCS.INFO: 00042 - https://www.bram.us/2014/06/04/good-looking-shapes-gallery/ [] []\n\n...\n```\n\nMixed 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.\n\n## Advanced usage / CLI Options\n\nMixed Content Scan support several CLI options which can manipulate its behavior:\n\n- `--output=path/to/file`: File to output results to. Defaults to `php://stdout` (= show on screen).\n- `--format=ansi|no-ansi|json`: Define which formatter to use for outputting the results\n    - `ansi` _(Default)_: ANSI Colored Line Formatter\n    - `no-ansi`: Monolog Line Formatter\n    - `json`: Monolog JSON Formatter\n- `--no-crawl`: Don't crawl scanned pages for new pages\n- `--no-check-certificate`: Don\\'t check the certificate for validity (e.g. allow self-signed or missing certificates)\n- `--timeout=value-in-milliseconds`: How long to wait for each request to complete. Defaults to 10000ms.\n- `--delay=value-in-seconds`: How long to wait between each request. Defaults to 0s.\n- `--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`\n- `--ignore=path/to/file`: File containing URL patterns to ignore. See _Ignoring links_ further down on how to build this file.\n- `--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.\n- `--user-agent='user-agent'`: Set the user agent to be used when crawling.\n\nExample: `mixed-content-scan https://www.bram.us/ --ignore=./wordpress.txt --output=./results.txt --format=no-ansi`\n\n## Handling errors\n\nInternally 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:\n\n```\n...\n[2015-01-07 12:56:43] MCS.INFO: 00003 - https://www.bram.us/projects/bramusicq/ [] []\n[2015-01-07 12:56:53] MCS.CRITICAL: cURL Error (28): SSL connection timeout [] []\n...\n```\n\n## Ignoring links\n\nIt'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.\n\nFor a WordPress installation, the ignore pattern file – which is distributed with Mixed Content Scan in `ignorepattens/wordpress.txt` – would be this:\n\n```\n# Paginated Overview Links\n^{$rootUrl}/page/(\\d+)/$\n\n# Single Post Links\n# ^{$rootUrl}/(\\d+)/(\\d+)/\n\n# Tag Overview Links\n^{$rootUrl}/tag/\n\n# Author Overview Links\n^{$rootUrl}/author/\n\n# Category Overview Links\n^{$rootUrl}/category/\n\n# Monthly Overview Links\n^{$rootUrl}/(\\d+)/(\\d+)/$\n\n# Year Overview Links\n^{$rootUrl}/(\\d+)/$\n\n# Comment Subscription Link\n^{$rootUrl}/comment-subscriptions\n\n# Wordpress Core File Links\n^{$rootUrl}/(.*)?wp\\-(.*)\\.php\n\n# Archive Links\n^{$rootUrl}/archive/\n\n# Replyto Links\n\\?replytocom\\=\n```\n\nThe `{$rootUrl}` token in each pattern will be replaced with the (root) URL passed into the script.\n\nNote: 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.\n\n## Known issues\n\nMixed Content Scan:\n\n* Doesn't take `\u003cbase href=\"...\"\u003e` into account _(but who uses that, anyways?)_\n* Doesn't scan linked `.css` or `.js` files themselves for Mixed Content\n* Doesn't scan inline `\u003cscript\u003e` or `\u003cstyle\u003e` for mixed content\n\nPlease open an issue _(or fix it and perform a pull request ;))_ when you've encountered a problem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramus%2Fmixed-content-scan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbramus%2Fmixed-content-scan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramus%2Fmixed-content-scan/lists"}