{"id":25140942,"url":"https://github.com/digitalist-open-cloud/matomo-plugin-extratools","last_synced_at":"2026-03-10T01:33:17.626Z","repository":{"id":34233601,"uuid":"171628513","full_name":"Digitalist-Open-Cloud/Matomo-Plugin-ExtraTools","owner":"Digitalist-Open-Cloud","description":"ExtraTools is a plugin for Matomo, which provides some console commands.","archived":false,"fork":false,"pushed_at":"2026-02-27T14:43:27.000Z","size":312,"stargazers_count":28,"open_issues_count":7,"forks_count":12,"subscribers_count":16,"default_branch":"5.x-dev","last_synced_at":"2026-02-27T19:38:30.973Z","etag":null,"topics":["matomo","matomo-cli","matomo-plugin"],"latest_commit_sha":null,"homepage":"https://digitalist.cloud/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Digitalist-Open-Cloud.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-20T08:06:11.000Z","updated_at":"2026-02-27T14:43:32.000Z","dependencies_parsed_at":"2024-11-18T14:37:59.255Z","dependency_job_id":"a75fb1a7-5704-41bb-8ab6-abb863d2589a","html_url":"https://github.com/Digitalist-Open-Cloud/Matomo-Plugin-ExtraTools","commit_stats":{"total_commits":114,"total_committers":4,"mean_commits":28.5,"dds":0.02631578947368418,"last_synced_commit":"31c200e86d9b72200751a8050ef39a2e191bb4d4"},"previous_names":["digitalist-se/extratools"],"tags_count":74,"template":false,"template_full_name":null,"purl":"pkg:github/Digitalist-Open-Cloud/Matomo-Plugin-ExtraTools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digitalist-Open-Cloud%2FMatomo-Plugin-ExtraTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digitalist-Open-Cloud%2FMatomo-Plugin-ExtraTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digitalist-Open-Cloud%2FMatomo-Plugin-ExtraTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digitalist-Open-Cloud%2FMatomo-Plugin-ExtraTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Digitalist-Open-Cloud","download_url":"https://codeload.github.com/Digitalist-Open-Cloud/Matomo-Plugin-ExtraTools/tar.gz/refs/heads/5.x-dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Digitalist-Open-Cloud%2FMatomo-Plugin-ExtraTools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30320889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["matomo","matomo-cli","matomo-plugin"],"created_at":"2025-02-08T18:16:03.893Z","updated_at":"2026-03-10T01:33:17.617Z","avatar_url":"https://github.com/Digitalist-Open-Cloud.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extra Tools (for Matomo)\n\nSome extra cli commands to help with maintaining Matomo. Also providing an phpinfo page in the admin part.\nIntroducing new console commands:\n\n- `archive:list`\n- `extra:config:get`\n- `database:backup`\n- `database:create`\n- `database:drop`\n- `database:import`\n- `logger:delete`\n- `logger:show`\n- `matomo:install`\n- `segment:admin`\n- `segment:list`\n- `site:add`\n- `site:delete`\n- `site:list`\n- `site:url`\n- `visits:get`\n- `customdimensions:configure-new-dimension`\n\n## Background\n\nThe main reason to doing this plugin was to get automatic installs to work with Matomo, including automatic updates -\nand version controlled deliveries with configuration in json or yaml.\n\n## Known bugs\n\nAdding a site as part of `matomo:install` is currently broken, but you could just after the command run the `site:add` command:\n\n```sh\n./console site:add --name=Foo --urls=https://foo.bar\n```\n\n## Dependencies\n\nSine version 4.1.0-beta1 we are dependent on PHP 8.1\n\n### On host\n\n- mysql-client or mariadb-client (for database tasks)\n- PHP json extension\n\n### In composer.json (Matomo root)\n\nFrom version 5.1.0:\n\n- `composer require symfony/yaml:~2.6.0` (moves it from dev)\n\nFrom version 4.1.0-beta1:\n\n- `composer require symfony/yaml:~2.6.0` (moves it from dev)\n- `composer require symfony/process:^5.4`\n\nEarlier versions:\n\n- `composer require symfony/yaml:~2.6.0` (moves it from dev)\n- `composer require symfony/process:^3.4`\n\n## Install\n\nGit clone the plugin into your plugins folder:\n\n```sh\ngit clone https://github.com/digitalist-se/extratools.git ExtraTools\n```\n\n## Config\n\nActivate ExtraTools - in UI, or better - in the console:\n\n```sh\nconsole plugin:activate ExtraTools\n```\n\nSet up a db backup path, use the console (use the path you desire):\n\n```sh\n./console config:set 'ExtraTools.db_backup_path=\"/var/www/html/tmp\"'\n```\n\nOr add it manually to config.ini.php:\n\n```php\n[ExtraTools]\ndb_backup_path = \"/var/www/html/tmp\"\n```\n\n## Commands\n\n### `archive:list`\n\nGets al list of ongoing or scheduled core archivers, if such exist.\n\n### `extra:config:get`\n\nGets a section config.\n@todo - make this more like config:set - so you have more options.\n\n### `database:backup`\n\nBackups the db.\n\n### `database:create`\n\nCreates the db defined i config.ini.php.\nAdding the --force flag stops the command for asking questions.\n\n### `database:drop`\n\nDrops the db defined i config.ini.php - backup first if needed.\nAdding the --force flag stops the command for asking questions.\n\n### `database:import`\n\nImports database dump to database defined in config.ini.php, so if\nyou already have a installation - it overwrites it.\n\n### `logger:delete`\n\nRemoves logging entries from the DB, that is the internal logging in Matomo, not visits on sites.\n\n### `logger:show`\n\nShow logging and query entries of logs from the database, output could be exported to CSV.\n\n### `matomo:install`\n\nTo use matomo:install, you need ExtraTools to always be enabled, add `always_load_commands_from_plugin=ExtraTools` to `common.config.ini.php`.\n\nHere is how we do it in ad docker image build:\n\n```sh\n    echo \"[General]\" \u003e /var/www/html/config/common.config.ini.php; \\\n    echo \"always_load_commands_from_plugin=ExtraTools\" \u003e\u003e /var/www/html/config/common.config.ini.php; \\\n```\n\nInstalls Matamo. Wipes the current installation - as default it uses settings in\nyour config.ini.php file - but all values could be overridden with arguments or\nenvironment variables.\n\nIf you have a license for Matomo Premium plugins, set the environment variable `MATOMO_LICENSE` with the correct\nlicense token. The environment variable is set as a normal environment variable, in shell using export, in a\ndocker-compose file, the environment array etc. If the variable is set, Matomo will have the license key set on install.\n\n### `segment:admin`\n\nAdministration of segments, only options right now is to delete or activate a segment, a deleted segment could later be activated again.\n\n### `segment:list`\n\nList all segments, with ID, definition, date created and latest updated.\n\n### `site:add`\n\nAdds a new site to track.\n\n### `site:delete`\n\nDeletes a site with ID provided.\n\n### `site:list`\n\nList sites, with the optional format argument - supported output is text(default), json and yaml.\n\n### `site:url`\n\nAdds one or more URLs to a site.\n\n### `visits:get`\n\nGet all archived visits, for one site or all. For a segment or all segments, for today, or another day etc.\n\n### `customdimensions:configure-new-dimension`\n\nConfigure a new custom dimension. BETA.\n\n### phpinfo page\n\nProvides a phpinfo page in the admin section. Access it via:\nAdministration → Extra Tools → Phpinfo.\n\nThis displays the PHP configuration information similar to `phpinfo()`.\n\n### Invalidated Archives\n\nLists invalidated archive entries from the database. This helps you see which archives\nhave been invalidated and need to be re-processed by the archiver. Access it via:\nAdministration → Extra Tools → Invalidations.\n\nShows the archive name (or \"All visits\" for the default), period type, date, and when it was invalidated.\n\n#### Requirements\n\nMatomo needs a MySQL/MariaDB host, with a user setup that is allowed to drop\nthat db.\nThe first user is created as a super user and it is need to have one to\nset up Matomo. If you do not add values in environment variables or options to\nmatomo:install command, it will use the defaults for the user - so important\nthat you change that users password after install.\nMatomo also creates a first site to track, this also has default values that\nyou could override with environment variables or options.\n\nYou could also use a json-file for configuration - like all the above\nmentioned - and for installing plugins. An example json-file could be found in\nthe docs folder for this plugin.\n\n#### Environment variables\n\nSupported default environment variables from the official Matomo docker container:\n\n```sh\nMATOMO_DATABASE_HOST\nMATOMO_DATABASE_PORT\nMATOMO_DATABASE_TABLES_PREFIX\nMATOMO_DATABASE_USERNAME\nMATOMO_DATABASE_PASSWORD\nMATOMO_DATABASE_DBNAME\nMATOMO_DATABASE_ADAPTER\n```\n\nNon-default:\n\n```sh\nMATOMO_DATABASE_COLLATION\nMATOMO_DATABASE_CHARSET\n```\n\nThese could be overridden with (historical reasons):\n\n```sh\nMATOMO_DB_HOST\nMATOMO_DB_PREFIX\nMATOMO_DB_USERNAME\nMATOMO_DB_PASSWORD\nMATOMO_DB_NAME\nMATOMO_DB_COLLATION\nMATOMO_DB_CHARSET\n```\n\nOther environment variables:\n\n```sh\nMATOMO_FIRST_USER_NAME\nMATOMO_FIRST_USER_EMAIL\nMATOMO_FIRST_USER_PASSWORD\n\nMATOMO_FIRST_SITE_NAME\nMATOMO_FIRST_SITE_URL\n\nMATOMO_LOG_TIMESTAMP (1)\n```\n\n#### Installation preparation\n\nIf you have a config.ini.php in the config dir - delete it.\nRun:\n\n```sh\nconsole plugin:activate ExtraTools\n```\n\nThen follow one of the Examples below.\n\n#### Example install 1 (recommended)\n\n```sh\nconsole matomo:install --install-file=install.json\n```\n\n#### Example install 2\n\n```sh\nconsole matomo:install --db-username=myuser --db-pass=password \\\n  --db-host=localhost --db-port=3306 --db-name=matomo --first-site-name=Foo \\\n  --first-site-url=https//foo.bar --first-user='Mr Foo Bar' \\\n  --first-user-email=foo@bar.com --first-user-pass=secret\n```\n\n#### Example install 3\n\nUsing environment variables, docker-compose.yml example.\n\n```sh\nenvironment:\n      - MATOMO_DB_USERNAME=myuser\n      - MATOMO_DB_PASSWORD=secret\n      - MATOMO_DB_HOST=mysql\n      - MATOMO_DB_PORT=3306\n      - MATOMO_DB_NAME=matomo\n      - MATOMO_FIRST_USER_NAME=Mr Foo Bar\n      - MATOMO_FIRST_USER_EMAIL=foo@bar.com\n      - MATOMO_FIRST_USER_PASSWORD=secret\n      - MATOMO_FIRST_SITE_NAME=Foo\n      - MATOMO_FIRST_SITE_URL=https://foo.bar\n```\n\n#### Order of values\n\nHighest number = takes over. If you have you mysql server settings in environment\nvariables and provide the option --db-username=myuser, the latter is used for the\ndb username.\n\n1. config.ini.php (created when you install the first time)\n2. Environment variable\n3. Option (matomo:install --db-username=myuser)\n4. File overrides (matom-install --install-file=install.json)\n\n## CAUTION!\n\n- `matamo:install` wipes your current installation.\n- `database:drop` - as it says - drops the entire db, make a backup first if you\n  want to save you data, and check if it's ok.\n- `database:import` - writes over your current database.\n- `site:delete` - really deletes a site you have setup in Matomo.\n\nThis plugin comes with **no** guarantees. But it's free and open source.\nSo, let's make it better!\n\n## Version supported\n\nThis plugin requires Matomo \u003e= 5.0.0-b1.\n\n## Thank you!\n\nThis plugin is based on work done by [Ben Evans](https://github.com/nebev) in\nhttps://github.com/nebev/piwik-cli-setup, and also reusing code in Matomo\ncore.\n\n## Tests\n\nHow to run tests.\n\n### PHPstan\n\n```sh\ndocker-compose exec matomo bash -c \"/var/www/html/plugins/ExtraTools/vendor/bin/phpstan analyze -c /var/www/html/plugins/ExtraTools/tests/phpstan.neon  --level=0 plugins/ExtraTools/\"\n```\n\n### Phpunit\n\n```sh\ndocker-compose up -d\ndocker-compose exec --user=root matomo bash -c  \"cd plugins/ExtraTools \u0026\u0026 composer install --no-interaction --no-progress\"\ndocker-compose exec matomo ./console matomo:install --install-file=/var/www/html/config/install.json --force\ndocker-compose exec matomo ./console site:add --name=Foo --urls=https://foo.bar\ndocker-compose exec matomo touch /var/www/html/.gitmodules\ndocker-compose exec matomo ./console development:enable\ndocker-compose exec matomo ./console config:set --section=tests --key=http_host --value=web\ndocker-compose exec matomo ./console config:set --section=tests --key=request_uri --value=/\ndocker-compose exec matomo ./console config:set --section=database_tests --key=host --value=db\ndocker-compose exec matomo ./console config:set --section=database_tests --key=username --value=root\ndocker-compose exec matomo ./console config:set --section=database_tests --key=password --value=root\ndocker-compose exec matomo ./console config:set --section=database_tests --key=dbname --value=matomo_test\ndocker-compose exec matomo ./console config:set --section=database_tests --key=tables_prefix --value=\"\"\ndocker-compose exec matomo /var/www/html/plugins/ExtraTools/vendor/bin/phpunit -c plugins/ExtraTools/tests/phpunit.xml --coverage-text --testdox --log-junit report.xml\n```\n\n## License\n\nCopyright (C) Digitalist Open Cloud \u003ccloud@digitalist.com\u003e\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalist-open-cloud%2Fmatomo-plugin-extratools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalist-open-cloud%2Fmatomo-plugin-extratools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalist-open-cloud%2Fmatomo-plugin-extratools/lists"}