├── Audits └── .gitkeep ├── lang ├── am.json ├── ar.json ├── az.json ├── be.json ├── bn.json ├── bs.json ├── cy.json ├── da.json ├── dv.json ├── eo.json ├── es-ar.json ├── et.json ├── fa.json ├── fi.json ├── gl.json ├── he.json ├── hi.json ├── hr.json ├── hu.json ├── hy.json ├── is.json ├── ka.json ├── ko.json ├── ku.json ├── lb.json ├── lt.json ├── lv.json ├── ms.json ├── nn.json ├── pl.json ├── ro.json ├── ru.json ├── si.json ├── sk.json ├── sl.json ├── sr.json ├── ta.json ├── te.json ├── th.json ├── tl.json ├── tzm.json ├── ur.json ├── vi.json ├── zh-cn.json ├── zh-tw.json ├── es.json ├── uk.json └── cs.json ├── .github ├── FUNDING.yml ├── stale.yml ├── dependabot.yml └── workflows │ └── tests.yml ├── vendor ├── ducks-project │ └── spl-types │ │ ├── appveyor.yml │ │ ├── codecov.yml │ │ ├── phpstan.neon.dist │ │ ├── .readthedocs.yml │ │ ├── .github │ │ ├── FUNDING.yml │ │ ├── SECURITY.md │ │ └── workflows │ │ │ └── php.yml │ │ ├── phpbench.json.dist │ │ ├── .scrutinizer.yml │ │ ├── phpcs.xml.dist │ │ ├── .styleci.yml │ │ ├── .travis.yml │ │ ├── .editorconfig │ │ ├── bootstrap.php │ │ ├── .gitignore │ │ ├── psalm.xml.dist │ │ ├── phpunit.xml.dist │ │ ├── SplBool.php │ │ ├── LICENSE │ │ ├── SplInt.php │ │ ├── SplString.php │ │ ├── assets │ │ └── documentation │ │ │ ├── SplType.md │ │ │ ├── SplType.construct.md │ │ │ ├── SplEnum.getConstList.md │ │ │ ├── SplInt.md │ │ │ ├── SplFloat.md │ │ │ ├── SplBool.md │ │ │ ├── SplString.md │ │ │ └── SplEnum.md │ │ ├── SplFloat.php │ │ ├── SplEnum.php │ │ ├── .circleci │ │ └── config.yml │ │ ├── composer.json │ │ ├── SplType.php │ │ └── .php-cs-fixer.dist.php ├── devdavido │ └── lighthouse │ │ ├── .gitignore │ │ ├── src │ │ └── Exceptions │ │ │ └── AuditFailedException.php │ │ ├── phpunit.xml │ │ ├── composer.json │ │ ├── LICENSE.md │ │ └── README.md ├── composer │ ├── autoload_namespaces.php │ ├── autoload_files.php │ ├── autoload_psr4.php │ ├── platform_check.php │ ├── LICENSE │ ├── autoload_real.php │ └── installed.php ├── symfony │ ├── polyfill-php80 │ │ ├── Resources │ │ │ └── stubs │ │ │ │ ├── ValueError.php │ │ │ │ ├── UnhandledMatchError.php │ │ │ │ ├── PhpToken.php │ │ │ │ ├── Stringable.php │ │ │ │ └── Attribute.php │ │ ├── README.md │ │ ├── LICENSE │ │ ├── composer.json │ │ ├── bootstrap.php │ │ ├── PhpToken.php │ │ └── Php80.php │ ├── polyfill-mbstring │ │ ├── README.md │ │ ├── LICENSE │ │ ├── composer.json │ │ └── Resources │ │ │ └── unidata │ │ │ └── caseFolding.php │ └── process │ │ ├── Exception │ │ ├── ExceptionInterface.php │ │ ├── LogicException.php │ │ ├── RuntimeException.php │ │ ├── InvalidArgumentException.php │ │ ├── ProcessSignaledException.php │ │ ├── ProcessFailedException.php │ │ └── ProcessTimedOutException.php │ │ ├── composer.json │ │ ├── README.md │ │ ├── LICENSE │ │ ├── Pipes │ │ ├── PipesInterface.php │ │ └── UnixPipes.php │ │ ├── ProcessUtils.php │ │ ├── PhpExecutableFinder.php │ │ ├── PhpProcess.php │ │ ├── InputStream.php │ │ ├── ExecutableFinder.php │ │ └── CHANGELOG.md └── autoload.php ├── ChromePath.js ├── screenshots ├── Dashboard.png ├── OverallScores.png ├── WebsiteSettings.png ├── FirstContentfulPaint.png ├── PerformanceSubcategories.png ├── TimelineFirstContentfulPaint.png └── OVERVIEW.md ├── .editorconfig ├── .gitignore ├── Exceptions ├── InstallationFailedException.php ├── InternetUnavailableException.php ├── DirectoryNotWriteableException.php ├── DependencyUnexpectedResultException.php ├── DependencyNpmMisconfigurationException.php ├── AuditFailedException.php ├── AuditFailedNotFoundException.php ├── AuditFailedTooManyRequestsException.php ├── AuditFailedAuthoriseRefusedException.php ├── AuditFailedMethodNotAllowedException.php ├── DependencyMissingException.php └── DependencyOfChromeMissingException.php ├── stylesheets └── pluginCheck.css ├── templates ├── pluginChecked.twig └── pluginCheck.twig ├── Columns ├── Metrics │ ├── Max.php │ ├── Min.php │ ├── Median.php │ ├── Audit.php │ ├── MaxPercent.php │ ├── MinPercent.php │ ├── MedianPercent.php │ ├── MaxSeconds.php │ ├── MinSeconds.php │ └── MedianSeconds.php ├── PageUrl.php └── Filters │ └── AuditScoreClassifier.php ├── Process.php ├── Helper.php ├── plugin.json ├── Menu.php ├── composer.json ├── Reports ├── GetPerformanceSpeedIndexMobile.php ├── GetPerformanceSpeedIndexDesktop.php ├── GetPerformanceInteractiveMobile.php ├── GetPerformanceInteractiveDesktop.php ├── GetPerformanceTotalBlockingTimeMobile.php ├── GetPerformanceCumulativeLayoutShiftMobile.php ├── GetPerformanceTotalBlockingTimeDesktop.php ├── GetPerformanceCumulativeLayoutShiftDesktop.php ├── GetPerformanceFirstContentfulPaintMobile.php ├── GetPerformanceFirstContentfulPaintDesktop.php ├── GetPerformanceLargestContentfulPaintMobile.php ├── GetPerformanceLargestContentfulPaintDesktop.php ├── GetPerformanceScoreMobile.php └── GetPerformanceScoreDesktop.php ├── .php_cs ├── Commands └── ClearTaskRunningFlag.php ├── Updates └── 1.1.0.php ├── EmulatedDevice.php ├── tests └── Unit │ ├── Metric │ ├── PercentTest.php │ └── SecondsTest.php │ └── Filter │ └── AuditScoreClassifierTest.php ├── docs └── faq.md ├── Controller.php └── ExecutableFinder.php /Audits/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lang/am.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ar.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/az.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/be.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/bn.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/bs.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/cy.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/da.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/dv.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/eo.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/es-ar.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/et.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/fa.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/fi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/gl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/he.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hr.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hu.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hy.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/is.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ka.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ko.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ku.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/lb.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/lt.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/lv.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ms.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/nn.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/pl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ro.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ru.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/si.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sk.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sr.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/te.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/th.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/tl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/tzm.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ur.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/vi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/zh-cn.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | buy_me_a_coffee: "devdavido" 2 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | build: 3 | verbosity: minimal 4 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | token: 77f0d2fe-c97d-4466-9633-cebce47c0fa1 3 | -------------------------------------------------------------------------------- /ChromePath.js: -------------------------------------------------------------------------------- 1 | const puppeteer = require('puppeteer'); 2 | 3 | process.stdout.write(puppeteer.executablePath()); 4 | -------------------------------------------------------------------------------- /screenshots/Dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/Dashboard.png -------------------------------------------------------------------------------- /screenshots/OverallScores.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/OverallScores.png -------------------------------------------------------------------------------- /screenshots/WebsiteSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/WebsiteSettings.png -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 6 3 | paths: 4 | - src 5 | - Tests 6 | -------------------------------------------------------------------------------- /screenshots/FirstContentfulPaint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/FirstContentfulPaint.png -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-lts-latest 5 | tools: 6 | python: "latest" 7 | -------------------------------------------------------------------------------- /screenshots/PerformanceSubcategories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/PerformanceSubcategories.png -------------------------------------------------------------------------------- /screenshots/TimelineFirstContentfulPaint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevDavido/performance-audit-plugin/HEAD/screenshots/TimelineFirstContentfulPaint.png -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [donaldinou] 4 | open_collective: ducks-project 5 | -------------------------------------------------------------------------------- /vendor/devdavido/lighthouse/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | node_modules 4 | package.json 5 | yarn.lock 6 | config.js 7 | report.json 8 | .DS_Store 9 | .idea 10 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Make this project use the PSR-12 coding standard. 4 | 5 | 6 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | class ValueError extends Error 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Mbstring 2 | =========================== 3 | 4 | This component provides a partial, native PHP implementation for the 5 | [Mbstring](https://php.net/mbstring) extension. 6 | 7 | More information can be found in the 8 | [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). 9 | 10 | License 11 | ======= 12 | 13 | This library is released under the [MIT license](LICENSE). 14 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | class UnhandledMatchError extends Error 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | risky: false 3 | version: 7.4 4 | preset: psr12 5 | monolithic: true 6 | tab-width: 4 7 | use-tabs: false 8 | finder: 9 | exclude: 10 | - "modules" 11 | - "node_modules" 12 | - "nova" 13 | - "nova-components" 14 | - "storage" 15 | - "spark" 16 | - "vendor" 17 | - "Tests" 18 | name: 19 | - "*.php" 20 | not-name: 21 | - "*.blade.php" 22 | - "_ide_helper.php" 23 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { 13 | class PhpToken extends Symfony\Polyfill\Php80\PhpToken 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 10 | 'e9b48b9bab803e9eba6dfd8e270dddfd' => $vendorDir . '/ducks-project/spl-types/bootstrap.php', 11 | '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 12 | ); 13 | -------------------------------------------------------------------------------- /vendor/devdavido/lighthouse/src/Exceptions/AuditFailedException.php: -------------------------------------------------------------------------------- 1 | output = $output; 14 | } 15 | 16 | public function getOutput() 17 | { 18 | return $this->output; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | dist: trusty 3 | php: 4 | # - 5.4 5 | # - 5.5 6 | - 5.6 7 | - 7.0 8 | - 7.1 9 | - 7.2 10 | - 7.3 11 | 12 | #matrix: 13 | # include: 14 | # - php: 5.3 15 | # dist: precise 16 | 17 | before_script: 18 | - composer install --no-interaction --optimize-autoloader 19 | script: 20 | - mkdir -p build/logs 21 | - composer unittest 22 | - composer atoumtest 23 | 24 | after_success: 25 | - travis_retry php vendor/bin/php-coveralls 26 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | interface Stringable 14 | { 15 | /** 16 | * @return string 17 | */ 18 | public function __toString(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /stylesheets/pluginCheck.css: -------------------------------------------------------------------------------- 1 | .pluginsManagement .linkDisabled { 2 | opacity: 0.75; 3 | cursor: not-allowed; 4 | pointer-events: none; 5 | } 6 | 7 | .pluginsManagement .card-content > h3:first-child { 8 | margin-top: 0; 9 | } 10 | 11 | .pluginsManagement .card-content .alert.no-margin-bottom { 12 | margin-bottom: 0; 13 | } 14 | 15 | .pluginsManagement .performance-audit-log-output { 16 | overflow-y: auto; 17 | max-height: 336px; 18 | padding: 0.6em 0.8em; 19 | line-height: 1.8em; 20 | border: 1px solid #dddddd; 21 | } 22 | -------------------------------------------------------------------------------- /vendor/devdavido/lighthouse/phpunit.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | tests/Unit 11 | 12 | 13 | tests/Integration 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vendor/symfony/process/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | /** 15 | * Marker Interface for the Process Component. 16 | * 17 | * @author Johannes M. Schmitt 18 | */ 19 | interface ExceptionInterface extends \Throwable 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /Exceptions/AuditFailedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | /** 15 | * LogicException for the Process Component. 16 | * 17 | * @author Romain Neutron 18 | */ 19 | class LogicException extends \LogicException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.{php,html,twig,hac3,inc}] 10 | indent_style = space 11 | indent_size = 4 12 | 13 | [*.{json,lock}] 14 | indent_style = space 15 | indent_size = 4 16 | 17 | [*.{yml,yaml}] 18 | indent_style = space 19 | indent_size = 2 20 | 21 | [*.md] 22 | max_line_length = 80 23 | trim_trailing_whitespace = false 24 | 25 | [*.{xml,xsd}] 26 | max_line_length = off 27 | indent_size = 2 28 | 29 | [COMMIT_EDITMSG] 30 | max_line_length = 0 31 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 1.1.x | :white_check_mark: | 11 | 12 | ## Reporting a Vulnerability 13 | 14 | If you think that you have found a security issue in this repos, 15 | please do not use the issue tracker and do not post it publicly. 16 | Instead, all security issues must be sent to donald_duck [at] dteam-df.org 17 | -------------------------------------------------------------------------------- /vendor/symfony/process/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | /** 15 | * RuntimeException for the Process Component. 16 | * 17 | * @author Johannes M. Schmitt 18 | */ 19 | class RuntimeException extends \RuntimeException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/symfony/polyfill-php80'), 10 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 11 | 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), 12 | 'Ducks\\Component\\SplTypes\\' => array($vendorDir . '/ducks-project/spl-types'), 13 | 'DevDavido\\Lighthouse\\' => array($vendorDir . '/devdavido/lighthouse/src'), 14 | ); 15 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | $splTypes = [ 13 | 'SplType', 14 | 'SplInt', 15 | 'SplFloat', 16 | 'SplEnum', 17 | 'SplBool', 18 | 'SplString', 19 | ]; 20 | 21 | foreach ($splTypes as $splType) { 22 | if (!class_exists($splType, false)) { 23 | class_alias('\\Ducks\\Component\\SplTypes\\' . $splType, $splType, true); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/symfony/process/Exception/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | /** 15 | * InvalidArgumentException for the Process Component. 16 | * 17 | * @author Romain Neutron 18 | */ 19 | class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /Exceptions/AuditFailedNotFoundException.php: -------------------------------------------------------------------------------- 1 | 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs 15 | within the next 30 days. Thank you for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /templates/pluginChecked.twig: -------------------------------------------------------------------------------- 1 | {% extends 'admin.twig' %} 2 | 3 | {% block content %} 4 |
5 |

6 | {{ 'PerformanceAudit_PluginCheck'|translate }} 7 |

8 |
9 | 10 |
11 |
12 |

{{ 'PerformanceAudit_PluginCheckLogOutput'|translate }}

13 | {% if hasErrorInOutput %} 14 |
{{ 'PerformanceAudit_PluginCheckHasErrors'|translate }}
15 | {% endif %} 16 |
17 | {{ logOutput|raw }} 18 |
19 |
20 |
21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /Columns/Metrics/Max.php: -------------------------------------------------------------------------------- 1 | %4$s.", 11 | "Version": "Версія" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | commit-message: 8 | prefix: "build(github-actions)" 9 | schedule: 10 | interval: "monthly" 11 | labels: 12 | - "dependabot" 13 | 14 | - package-ecosystem: "composer" 15 | directory: "/" 16 | commit-message: 17 | prefix: "build(dependencies)" 18 | schedule: 19 | interval: "monthly" 20 | labels: 21 | - "dependabot" 22 | ignore: 23 | - dependency-name: "*" 24 | update-types: [ "version-update:semver-major" ] 25 | - dependency-name: "php" 26 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.gitignore: -------------------------------------------------------------------------------- 1 | # Managed by Composer 2 | /app/bootstrap.php.cache 3 | /var/bootstrap.php.cache 4 | /build/* 5 | /bin/* 6 | !bin/console 7 | /vendor/ 8 | 9 | # PHPUnit 10 | /app/phpunit.xml 11 | /phpunit.xml 12 | .phpunit.result.cache 13 | 14 | # Composer PHAR 15 | /composer.phar 16 | #/composer.lock 17 | 18 | # Sublime project 19 | *.tmplanguage.cache 20 | *.tmpPreferences.cache 21 | *.stTheme.cache 22 | *.sublime-project 23 | *.sublime-workspace 24 | 25 | # Idea 26 | .idea/* 27 | 28 | # vscode 29 | *.code-workspace 30 | 31 | # Swap & temp files 32 | *~ 33 | *.tmp 34 | *.bak 35 | *.swp 36 | .*.kate-swp 37 | .swp.* 38 | .metadata 39 | .directory 40 | .project 41 | local.properties 42 | .settings/ 43 | .loadpath 44 | *.kdev4 45 | .kdev4/ 46 | .vagrant/ 47 | /test 48 | /tests 49 | /.history 50 | .DS_Store 51 | -------------------------------------------------------------------------------- /Columns/Metrics/Median.php: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /vendor/symfony/process/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/process", 3 | "type": "library", 4 | "description": "Executes commands in sub-processes", 5 | "keywords": [], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2.5", 20 | "symfony/polyfill-php80": "^1.16" 21 | }, 22 | "autoload": { 23 | "psr-4": { "Symfony\\Component\\Process\\": "" }, 24 | "exclude-from-classmap": [ 25 | "/Tests/" 26 | ] 27 | }, 28 | "minimum-stability": "dev" 29 | } 30 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | =7.2.5", 17 | "symfony/process": "^5.4" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "^6.1|^7.0" 21 | }, 22 | "autoload": { 23 | "psr-4": { 24 | "DevDavido\\Lighthouse\\": "src/" 25 | } 26 | }, 27 | "autoload-dev": { 28 | "psr-4": { 29 | "DevDavido\\Lighthouse\\Test\\": "tests/" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Process.php: -------------------------------------------------------------------------------- 1 | $userPath 23 | ]; 24 | } elseif (is_array($env)) { 25 | $env += [ 26 | 'PATH' => $userPath 27 | ]; 28 | } 29 | 30 | parent::__construct($command, __DIR__, $env, null, 60); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | #[Attribute(Attribute::TARGET_CLASS)] 13 | final class Attribute 14 | { 15 | public const TARGET_CLASS = 1; 16 | public const TARGET_FUNCTION = 2; 17 | public const TARGET_METHOD = 4; 18 | public const TARGET_PROPERTY = 8; 19 | public const TARGET_CLASS_CONSTANT = 16; 20 | public const TARGET_PARAMETER = 32; 21 | public const TARGET_ALL = 63; 22 | public const IS_REPEATABLE = 64; 23 | 24 | /** @var int */ 25 | public $flags; 26 | 27 | public function __construct(int $flags = self::TARGET_ALL) 28 | { 29 | $this->flags = $flags; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./Tests/ 23 | 24 | 25 | 26 | 27 | 28 | ./ 29 | 30 | ./Resources 31 | ./Tests 32 | ./vendor 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Php80 2 | ======================== 3 | 4 | This component provides features added to PHP 8.0 core: 5 | 6 | - [`Stringable`](https://php.net/stringable) interface 7 | - [`fdiv`](https://php.net/fdiv) 8 | - [`ValueError`](https://php.net/valueerror) class 9 | - [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class 10 | - `FILTER_VALIDATE_BOOL` constant 11 | - [`get_debug_type`](https://php.net/get_debug_type) 12 | - [`PhpToken`](https://php.net/phptoken) class 13 | - [`preg_last_error_msg`](https://php.net/preg_last_error_msg) 14 | - [`str_contains`](https://php.net/str_contains) 15 | - [`str_starts_with`](https://php.net/str_starts_with) 16 | - [`str_ends_with`](https://php.net/str_ends_with) 17 | - [`get_resource_id`](https://php.net/get_resource_id) 18 | 19 | More information can be found in the 20 | [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). 21 | 22 | License 23 | ======= 24 | 25 | This library is released under the [MIT license](LICENSE). 26 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70205)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/process/README.md: -------------------------------------------------------------------------------- 1 | Process Component 2 | ================= 3 | 4 | The Process component executes commands in sub-processes. 5 | 6 | Sponsor 7 | ------- 8 | 9 | The Process component for Symfony 5.4/6.0 is [backed][1] by [SensioLabs][2]. 10 | 11 | As the creator of Symfony, SensioLabs supports companies using Symfony, with an 12 | offering encompassing consultancy, expertise, services, training, and technical 13 | assistance to ensure the success of web application development projects. 14 | 15 | Help Symfony by [sponsoring][3] its development! 16 | 17 | Resources 18 | --------- 19 | 20 | * [Documentation](https://symfony.com/doc/current/components/process.html) 21 | * [Contributing](https://symfony.com/doc/current/contributing/index.html) 22 | * [Report issues](https://github.com/symfony/symfony/issues) and 23 | [send Pull Requests](https://github.com/symfony/symfony/pulls) 24 | in the [main Symfony repository](https://github.com/symfony/symfony) 25 | 26 | [1]: https://symfony.com/backers 27 | [2]: https://sensiolabs.com 28 | [3]: https://symfony.com/sponsor 29 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplBool.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * The SplBool class is used to enforce strong typing of the bool type. 16 | * 17 | * @see SplBool http://php.net/manual/en/class.splbool.php 18 | * 19 | * @psalm-api 20 | */ 21 | class SplBool extends SplEnum 22 | { 23 | /** 24 | * @var bool 25 | */ 26 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 27 | public const __default = self::false; 28 | 29 | /** 30 | * @var bool 31 | */ 32 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 33 | public const false = false; 34 | 35 | /** 36 | * @var bool 37 | */ 38 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 39 | public const true = true; 40 | } 41 | -------------------------------------------------------------------------------- /vendor/symfony/process/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PerformanceAudit", 3 | "description": "Daily performance audits of all your sites in Matomo.", 4 | "version": "3.2.0", 5 | "theme": false, 6 | "require": { 7 | "php": ">=7.2.5", 8 | "matomo": ">=5.0.0-b1,<6.0.0-b1" 9 | }, 10 | "authors": [ 11 | { 12 | "name": "DevDavido", 13 | "homepage": "https://github.com/DevDavido" 14 | } 15 | ], 16 | "support": { 17 | "email": "github{at}diskoboss{døt}de", 18 | "issues": "https://github.com/DevDavido/performance-audit-plugin/issues" 19 | }, 20 | "homepage": "https://github.com/DevDavido/performance-audit-plugin", 21 | "license": "GPL-3.0+", 22 | "keywords": [ 23 | "performance", 24 | "audit", 25 | "monitor", 26 | "measure", 27 | "report", 28 | "lighthouse", 29 | "web vitals", 30 | "first contentful paint", 31 | "speed index", 32 | "largest contentful paint", 33 | "interactive", 34 | "time to interactive", 35 | "total blocking time", 36 | "cumulative layout shift" 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/symfony/process/Exception/ProcessSignaledException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | use Symfony\Component\Process\Process; 15 | 16 | /** 17 | * Exception that is thrown when a process has been signaled. 18 | * 19 | * @author Sullivan Senechal 20 | */ 21 | final class ProcessSignaledException extends RuntimeException 22 | { 23 | private $process; 24 | 25 | public function __construct(Process $process) 26 | { 27 | $this->process = $process; 28 | 29 | parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); 30 | } 31 | 32 | public function getProcess(): Process 33 | { 34 | return $this->process; 35 | } 36 | 37 | public function getSignal(): int 38 | { 39 | return $this->getProcess()->getTermSignal(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-mbstring", 3 | "type": "library", 4 | "description": "Symfony polyfill for the Mbstring extension", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2" 20 | }, 21 | "provide": { 22 | "ext-mbstring": "*" 23 | }, 24 | "autoload": { 25 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 26 | "files": [ "bootstrap.php" ] 27 | }, 28 | "suggest": { 29 | "ext-mbstring": "For best performance" 30 | }, 31 | "minimum-stability": "dev", 32 | "extra": { 33 | "thanks": { 34 | "name": "symfony/polyfill", 35 | "url": "https://github.com/symfony/polyfill" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/devdavido/lighthouse/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Dimitris Zavantias 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Menu.php: -------------------------------------------------------------------------------- 1 | addItem('PerformanceAudit_CoreAdminHome_MenuPerformance', 'PerformanceAudit_PluginCheck', $this->urlForAction('pluginCheck'), $orderId = 4); 24 | $menu->addItem('PerformanceAudit_CoreAdminHome_MenuPerformance', 'PerformanceAudit_Version', $this->urlForAction('version'), $orderId = 5); 25 | } 26 | 27 | /** 28 | * Returns URL for action. 29 | * 30 | * @param string $name 31 | * @return string 32 | */ 33 | public function getUrlForAction(string $name) 34 | { 35 | return http_build_query($this->urlForActionWithDefaultUserParams($name)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Duck's Project 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-php80", 3 | "type": "library", 4 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Ion Bazan", 11 | "email": "ion.bazan@gmail.com" 12 | }, 13 | { 14 | "name": "Nicolas Grekas", 15 | "email": "p@tchwork.com" 16 | }, 17 | { 18 | "name": "Symfony Community", 19 | "homepage": "https://symfony.com/contributors" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=7.2" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, 27 | "files": [ "bootstrap.php" ], 28 | "classmap": [ "Resources/stubs" ] 29 | }, 30 | "minimum-stability": "dev", 31 | "extra": { 32 | "thanks": { 33 | "name": "symfony/polyfill", 34 | "url": "https://github.com/symfony/polyfill" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Columns/Metrics/Audit.php: -------------------------------------------------------------------------------- 1 | 'firstContentfulPaint', 18 | 'speed-index' => 'speedIndex', 19 | 'largest-contentful-paint' => 'largestContentfulPaint', 20 | 'interactive' => 'interactive', 21 | 'total-blocking-time' => 'totalBlockingTime', 22 | 'cumulative-layout-shift' => 'cumulativeLayoutShift', 23 | 'score' => 'score' 24 | ]; 25 | 26 | /** 27 | * Enables all metrics for given lighthouse instance. 28 | * 29 | * @param Lighthouse $lighthouse 30 | * @return void 31 | */ 32 | public static function enableEachLighthouseAudit(Lighthouse $lighthouse) { 33 | $audits = array_keys(self::METRICS); 34 | foreach ($audits as $audit) { 35 | $lighthouse->enableAudit($audit); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Exceptions/DependencyMissingException.php: -------------------------------------------------------------------------------- 1 | 0) { 21 | $message .= " Searched in the following directories for the dependency: "; 22 | $message .= implode(", ", $extraDirs) . ".\n"; 23 | } 24 | if (ini_get('open_basedir')) { 25 | $searchDirs = array_filter(array_merge(explode(PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs)); 26 | $message .= " Please disable PHP open_basedir or set your PHP open_basedir option to: \n"; 27 | $message .= implode(PATH_SEPARATOR, $searchDirs); 28 | } 29 | parent::__construct($message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplInt.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * The SplInt class is used to enforce strong typing of the integer type. 16 | * 17 | * @see SplInt http://php.net/manual/en/class.splint.php 18 | * 19 | * @psalm-api 20 | */ 21 | class SplInt extends SplType 22 | { 23 | /** 24 | * @var int 25 | */ 26 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 27 | public const __default = 0; 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | public function __construct($initial_value = self::__default, bool $strict = true) 33 | { 34 | parent::__construct($initial_value, $strict); 35 | if (!$strict) { 36 | $initial_value = (int) $initial_value; 37 | } 38 | if (!is_int($initial_value)) { 39 | throw new \UnexpectedValueException('Value not an integer'); 40 | } 41 | $this->__default = $initial_value; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplString.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * The SplString class is used to enforce strong typing of the string type. 16 | * 17 | * @see SplString http://php.net/manual/en/class.splstring.php 18 | * 19 | * @psalm-api 20 | */ 21 | class SplString extends SplType 22 | { 23 | /** 24 | * @var string 25 | */ 26 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 27 | public const __default = ''; 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | public function __construct($initial_value = self::__default, bool $strict = true) 33 | { 34 | parent::__construct($initial_value, $strict); 35 | if (!$strict) { 36 | $initial_value = (string) $initial_value; 37 | } 38 | if (!is_string($initial_value)) { 39 | throw new \UnexpectedValueException('Value not a string'); 40 | } 41 | $this->__default = $initial_value; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplType.md: -------------------------------------------------------------------------------- 1 | # [The SplType class](#The-SplType-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | Parent class for all SPL types. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | abstract SplType { 14 | /* Constants */ 15 | const NULL __default = NULL ; 16 | /* Methods */ 17 | __construct ([ mixed $initial_value [, bool $strict ]] ) 18 | } 19 | ``` 20 | 21 | ## [Predefined Constants](#Predefined-Constants) 22 | 23 | **SplType::__default** 24 | 25 | ## [Table of Contents](#Table-of-Contents) 26 | 27 | - [SplType::__construct] — Creates a new value of some type 28 | 29 | ## [See Also](#See-Also) 30 | 31 | - [`SplInt`] 32 | - [`SplFloat`] 33 | - [`SplEnum`] 34 | - [`SplBool`] 35 | - [`SplString`] 36 | 37 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 38 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 39 | [`SplType`]: /assets/documentation/SplType.md 40 | [`SplInt`]: /assets/documentation/SplInt.md 41 | [`SplFloat`]: /assets/documentation/SplFloat.md 42 | [`SplEnum`]: /assets/documentation/SplEnum.md 43 | [`SplBool`]: /assets/documentation/SplBool.md 44 | [`SplString`]: /assets/documentation/SplString.md 45 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplFloat.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * The SplFloat class is used to enforce strong typing of the float type. 16 | * 17 | * @see http://php.net/manual/en/class.splfloat.php 18 | * 19 | * @psalm-api 20 | */ 21 | class SplFloat extends SplType 22 | { 23 | /** 24 | * @var float 25 | */ 26 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 27 | public const __default = 0.0; 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | public function __construct($initial_value = self::__default, bool $strict = true) 33 | { 34 | parent::__construct($initial_value, $strict); 35 | if (!$strict) { 36 | $initial_value = (float) $initial_value; 37 | } 38 | if (!is_float($initial_value) && !is_int($initial_value)) { 39 | throw new \UnexpectedValueException('Value not a float'); 40 | } 41 | $this->__default = $initial_value; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Columns/Metrics/MaxPercent.php: -------------------------------------------------------------------------------- 1 | getPrettyPercentFromQuotient($value / 100), 0, -1); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Columns/Metrics/MinPercent.php: -------------------------------------------------------------------------------- 1 | getPrettyPercentFromQuotient($value / 100), 0, -1); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Columns/Metrics/MedianPercent.php: -------------------------------------------------------------------------------- 1 | getPrettyPercentFromQuotient($value / 100), 0, -1); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "devdavido/performance-audit-plugin", 3 | "type": "project", 4 | "license": "GPL-3.0-only", 5 | "authors": [ 6 | { 7 | "name": "DevDavido", 8 | "homepage": "https://github.com/DevDavido" 9 | } 10 | ], 11 | "require": { 12 | "php": ">=7.2.5", 13 | "ext-json": "*", 14 | "ext-spl": "*", 15 | "ducks-project/spl-types": "^5.0", 16 | "symfony/polyfill-mbstring": "^1.31", 17 | "symfony/process": "^5.4", 18 | "devdavido/lighthouse": "dev-master#91ddfe4126453d3c9cb4c8263a5238967fbdf9ac" 19 | }, 20 | "require-dev": { 21 | "friendsofphp/php-cs-fixer": "^2.19" 22 | }, 23 | "autoload": { 24 | "classmap": ["./"] 25 | }, 26 | "scripts": { 27 | "format": [ 28 | "vendor/bin/php-cs-fixer fix --verbose" 29 | ] 30 | }, 31 | "config": { 32 | "preferred-install": "dist", 33 | "sort-packages": true, 34 | "optimize-autoloader": true, 35 | "platform": { 36 | "php": "7.2.5" 37 | } 38 | }, 39 | "minimum-stability": "dev", 40 | "prefer-stable": true, 41 | "repositories": [ 42 | { 43 | "type": "vcs", 44 | "url": "https://github.com/devdavido/lighthouse-php" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - '*.md' 7 | 8 | jobs: 9 | tests: 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | php: ['7.2', '7.4', '8.0', '8.3'] 14 | matomo-target: ['minimum_required_matomo', 'maximum_supported_matomo'] 15 | node: ['12.x', '20.x'] 16 | 17 | runs-on: ubuntu-latest 18 | 19 | permissions: 20 | checks: write 21 | pull-requests: write 22 | contents: read 23 | 24 | name: Tests w/ PHP ${{ matrix.php }}, Node.js ${{ matrix.node }}, Target Matomo '${{ matrix.matomo-target }}' 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v6 29 | with: 30 | lfs: true 31 | persist-credentials: false 32 | 33 | - name: Run plugin tests 34 | uses: matomo-org/github-action-tests@main 35 | with: 36 | plugin-name: 'PerformanceAudit' 37 | test-type: 'PluginTests' 38 | php-version: ${{ matrix.php }} 39 | matomo-test-branch: ${{ matrix.matomo-target }} 40 | node-version: ${{ matrix.node }} 41 | mysql-service: true 42 | -------------------------------------------------------------------------------- /Columns/Metrics/MaxSeconds.php: -------------------------------------------------------------------------------- 1 | getPrettyNumber($value / 1000, 3); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Columns/Metrics/MinSeconds.php: -------------------------------------------------------------------------------- 1 | getPrettyNumber($value / 1000, 3); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /templates/pluginCheck.twig: -------------------------------------------------------------------------------- 1 | {% extends 'admin.twig' %} 2 | 3 | {% block content %} 4 |
5 |

6 | {{ 'PerformanceAudit_PluginCheck'|translate }} 7 |

8 |
9 | 10 |
11 |
12 | {% if error %} 13 |
14 | {{ 'PerformanceAudit_PluginCheckAlertSystemIssue'|translate }} 15 |
16 | {{ error }} 17 |
18 | {% else %} 19 |
20 | {{ 'PerformanceAudit_PluginCheckAlertNoSystemIssues'|translate }} 21 |
22 | 23 | 29 | {% endif %} 30 |
31 |
32 | {% endblock %} 33 | -------------------------------------------------------------------------------- /Columns/Metrics/MedianSeconds.php: -------------------------------------------------------------------------------- 1 | getPrettyNumber($value / 1000, 3); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplType.construct.md: -------------------------------------------------------------------------------- 1 | # [SplType::__construct](#SplType::__construct) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | SplType::__construct — Creates a new value of some type 5 | 6 | ## [Description](#Description) 7 | 8 | ```php 9 | SplType::__construct ([ mixed $initial_value [, bool $strict ]] ) 10 | ``` 11 | 12 | ## [Parameters](#Parameters) 13 | 14 | ### [initial_value](#initial_value) 15 | Type and default value depends on the extension class. 16 | 17 | ### [strict](#strict) 18 | Whether to set the object's sctrictness. 19 | 20 | ## [Return Values](#Return-Values) 21 | 22 | A new Typed SplType 23 | 24 | ## [Errors/Exceptions](#Errors/Exceptions) 25 | 26 | Throws an [UnexpectedValueException] if incompatible type is given. 27 | 28 | ## [Examples](#Examples) 29 | 30 | ## [Notes](#Notes) 31 | 32 | > **Note:** Nothing to report yet 33 | 34 | ## [See Also](#See-Also) 35 | 36 | - [`SplInt`] 37 | - [`SplFloat`] 38 | - [`SplEnum`] 39 | - [`SplBool`] 40 | - [`SplString`] 41 | 42 | [UnexpectedValueException]: https://www.php.net/manual/en/class.unexpectedvalueexception.php 43 | [`SplType`]: /assets/documentation/SplType.md 44 | [`SplInt`]: /assets/documentation/SplInt.md 45 | [`SplFloat`]: /assets/documentation/SplFloat.md 46 | [`SplEnum`]: /assets/documentation/SplEnum.md 47 | [`SplBool`]: /assets/documentation/SplBool.md 48 | [`SplString`]: /assets/documentation/SplString.md 49 | -------------------------------------------------------------------------------- /Exceptions/DependencyOfChromeMissingException.php: -------------------------------------------------------------------------------- 1 | getConstList(true)); 29 | ``` 30 | 31 | The above example will output: 32 | 33 | > ``` 34 | > array(3) { 35 | > ["__default"] => bool(false) 36 | > ["false"] => bool(false) 37 | > ["true"] => bool(true) 38 | > } 39 | > ``` 40 | 41 | ## [Notes](#Notes) 42 | 43 | > **Note:** Nothing to report yet 44 | 45 | ## [See Also](#See-Also) 46 | 47 | - [`SplType`] 48 | - [`SplInt`] 49 | - [`SplFloat`] 50 | - [`SplBool`] 51 | - [`SplString`] 52 | 53 | [`SplType`]: /assets/documentation/SplType.md 54 | [`SplInt`]: /assets/documentation/SplInt.md 55 | [`SplFloat`]: /assets/documentation/SplFloat.md 56 | [`SplEnum`]: /assets/documentation/SplEnum.md 57 | [`SplBool`]: /assets/documentation/SplBool.md 58 | [`SplString`]: /assets/documentation/SplString.md 59 | -------------------------------------------------------------------------------- /Reports/GetPerformanceSpeedIndexMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_SpeedIndex_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_SpeedIndex'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_SpeedIndex_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'speed-index', 29 | 'Speed Index' 30 | ]); 31 | $this->order = 3; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'SpeedIndex'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceSpeedIndexDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_SpeedIndex_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_SpeedIndex'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_SpeedIndex_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'speed-index', 29 | 'Speed Index' 30 | ]); 31 | $this->order = 3; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'SpeedIndex'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceInteractiveMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_Interactive_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_Interactive'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_Interactive_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'interactive', 29 | 'Time To Interactive' 30 | ]); 31 | $this->order = 5; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'Interactive'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | notPath('docs') 5 | ->notPath('lang') 6 | ->notPath('node_modules') 7 | ->notPath('screenshots') 8 | ->notPath('templates') 9 | ->notPath('vendor') 10 | ->in(__DIR__) 11 | ->name('*.php') 12 | ->ignoreDotFiles(true) 13 | ->ignoreVCS(true); 14 | 15 | return PhpCsFixer\Config::create() 16 | ->setRules([ 17 | '@PSR2' => true, 18 | 'array_syntax' => ['syntax' => 'short'], 19 | 'ordered_imports' => ['sortAlgorithm' => 'alpha'], 20 | 'no_unused_imports' => true, 21 | 'not_operator_with_successor_space' => false, 22 | 'trailing_comma_in_multiline_array' => false, 23 | 'no_trailing_comma_in_singleline_array' => true, 24 | 'phpdoc_scalar' => true, 25 | 'unary_operator_spaces' => true, 26 | 'binary_operator_spaces' => true, 27 | 'blank_line_before_statement' => [ 28 | 'statements' => ['break', 'continue', 'declare'], 29 | ], 30 | 'braces' => false, 31 | 'phpdoc_single_line_var_spacing' => true, 32 | 'phpdoc_var_without_name' => true, 33 | 'class_attributes_separation' => [ 34 | 'elements' => [ 35 | 'method', 'property', 36 | ], 37 | ], 38 | 'method_argument_space' => [ 39 | 'on_multiline' => 'ensure_fully_multiline', 40 | 'keep_multiple_spaces_after_comma' => true, 41 | ] 42 | ]) 43 | ->setFinder($finder); 44 | -------------------------------------------------------------------------------- /Reports/GetPerformanceInteractiveDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_Interactive_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_Interactive'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_Interactive_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'interactive', 29 | 'Time To Interactive' 30 | ]); 31 | $this->order = 5; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'Interactive'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Commands/ClearTaskRunningFlag.php: -------------------------------------------------------------------------------- 1 | setName('performanceaudit:clear-task-running-flag'); 21 | $this->setDescription('Clear flag for currently running performance audit task'); 22 | } 23 | 24 | /** 25 | * Execute command. 26 | * 27 | * @return int 28 | */ 29 | protected function doExecute(): int 30 | { 31 | $hasRunningTask = !!Option::get(Tasks::hasTaskRunningKey()); 32 | if ($hasRunningTask) { 33 | StaticContainer::get(Logger::class)->debug('Cleared task running flag manually now'); 34 | Option::delete(Tasks::hasTaskRunningKey()); 35 | 36 | $this->getOutput()->writeln('Performance Audit running task flag was cleared successfully.'); 37 | return self::SUCCESS; 38 | } 39 | 40 | StaticContainer::get(Logger::class)->debug('No task running flag available to clear now'); 41 | $this->getOutput()->writeln('Performance Audit running task flag was not set, so nothing to clear now.'); 42 | return self::SUCCESS; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.github/workflows/php.yml: -------------------------------------------------------------------------------- 1 | name: PHP Composer 2 | 3 | on: 4 | push: 5 | branches: [ "5.x" ] 6 | pull_request: 7 | branches: [ "5.x" ] 8 | 9 | permissions: 10 | contents: read 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - name: Setup PHP 20 | uses: shivammathur/setup-php@v2 21 | with: 22 | php-version: 7.2 23 | tools: composer:v2 24 | 25 | - name: Validate composer.json and composer.lock 26 | run: composer validate --strict 27 | 28 | - name: Cache Composer packages 29 | id: composer-cache 30 | uses: actions/cache@v3 31 | with: 32 | path: vendor 33 | key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} 34 | restore-keys: | 35 | ${{ runner.os }}-php- 36 | 37 | - name: Install php-coveralls dev 38 | run: composer require --dev --update-with-all-dependencies php-coveralls/php-coveralls 39 | 40 | - name: Install dependencies 41 | run: composer install --prefer-dist --no-progress 42 | 43 | - name: Run phpunit test 44 | run: composer unittest 45 | 46 | - name: Run atoum test 47 | run: composer atoumtest 48 | 49 | #- name: npm install, make test-coverage 50 | # run: | 51 | # npm install 52 | # make test-coverage 53 | 54 | - name: Upload coverage to Codecov 55 | uses: codecov/codecov-action@v4 56 | 57 | - name: Coveralls 58 | uses: coverallsapp/github-action@v2 59 | -------------------------------------------------------------------------------- /Reports/GetPerformanceTotalBlockingTimeMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_TotalBlockingTime_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_TotalBlockingTime'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_TotalBlockingTime_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'lighthouse-total-blocking-time', 29 | 'Total Blocking Time' 30 | ]); 31 | $this->order = 6; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'TotalBlockingTime'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceCumulativeLayoutShiftMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_CumulativeLayoutShift_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_CumulativeLayoutShift'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_CumulativeLayoutShift_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'cls', 29 | 'Cumulative Layout Shift' 30 | ]); 31 | $this->order = 7; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'CumulativeLayoutShift'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceTotalBlockingTimeDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_TotalBlockingTime_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_TotalBlockingTime'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_TotalBlockingTime_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'lighthouse-total-blocking-time', 29 | 'Total Blocking Time' 30 | ]); 31 | $this->order = 6; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'TotalBlockingTime'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceCumulativeLayoutShiftDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_CumulativeLayoutShift_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_CumulativeLayoutShift'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_CumulativeLayoutShift_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'cls', 29 | 'Cumulative Layout Shift' 30 | ]); 31 | $this->order = 7; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'CumulativeLayoutShift'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceFirstContentfulPaintMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_FirstContentfulPaint_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_FirstContentfulPaint'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_FirstContentfulPaint_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'first-contentful-paint', 29 | 'First Contentful Paint' 30 | ]); 31 | $this->order = 2; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'FirstContentfulPaint'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceFirstContentfulPaintDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_FirstContentfulPaint_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_FirstContentfulPaint'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_FirstContentfulPaint_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'first-contentful-paint', 29 | 'First Contentful Paint' 30 | ]); 31 | $this->order = 2; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'FirstContentfulPaint'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceLargestContentfulPaintMobile.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_LargestContentfulPaint_Mobile'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_LargestContentfulPaint'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_LargestContentfulPaint_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 28 | 'lighthouse-largest-contentful-paint', 29 | 'Largest Contentful Paint' 30 | ]); 31 | $this->order = 4; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsMobile($widgetsList, $factory, 'LargestContentfulPaint'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Reports/GetPerformanceLargestContentfulPaintDesktop.php: -------------------------------------------------------------------------------- 1 | name = Piwik::translate('PerformanceAudit_Report_Header_LargestContentfulPaint_Desktop'); 24 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_LargestContentfulPaint'); 25 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 26 | Piwik::translate('PerformanceAudit_Report_LargestContentfulPaint_Documentation_Information'), 27 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 28 | 'lighthouse-largest-contentful-paint', 29 | 'Largest Contentful Paint' 30 | ]); 31 | $this->order = 4; 32 | } 33 | 34 | /** 35 | * Configure widget. 36 | * 37 | * @param WidgetsList $widgetsList 38 | * @param ReportWidgetFactory $factory 39 | * @return void 40 | */ 41 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 42 | { 43 | parent::configureWidgetsDesktop($widgetsList, $factory, 'LargestContentfulPaint'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Columns/PageUrl.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | use Symfony\Component\Process\Process; 15 | 16 | /** 17 | * Exception for failed processes. 18 | * 19 | * @author Johannes M. Schmitt 20 | */ 21 | class ProcessFailedException extends RuntimeException 22 | { 23 | private $process; 24 | 25 | public function __construct(Process $process) 26 | { 27 | if ($process->isSuccessful()) { 28 | throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); 29 | } 30 | 31 | $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", 32 | $process->getCommandLine(), 33 | $process->getExitCode(), 34 | $process->getExitCodeText(), 35 | $process->getWorkingDirectory() 36 | ); 37 | 38 | if (!$process->isOutputDisabled()) { 39 | $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", 40 | $process->getOutput(), 41 | $process->getErrorOutput() 42 | ); 43 | } 44 | 45 | parent::__construct($error); 46 | 47 | $this->process = $process; 48 | } 49 | 50 | public function getProcess() 51 | { 52 | return $this->process; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplEnum.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * SplEnum gives the ability to emulate and create enumeration objects natively in PHP. 16 | * 17 | * @see SplEnum http://php.net/manual/en/class.splenum.php 18 | * 19 | * @psalm-api 20 | */ 21 | abstract class SplEnum extends SplType 22 | { 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function __construct($initial_value = null, bool $strict = true) 27 | { 28 | if (null === $initial_value) { 29 | $initial_value = static::__default; 30 | } 31 | $class = new \ReflectionClass($this); 32 | if (!in_array($initial_value, $class->getConstants(), $strict)) { 33 | throw new \UnexpectedValueException('Value not a const in enum ' . $class->getShortName()); 34 | } 35 | $this->__default = $initial_value; 36 | } 37 | 38 | /** 39 | * Returns all consts (possible values) as an array. 40 | * 41 | * @param bool $include_default Whether to include __default property. 42 | * 43 | * @return array 44 | */ 45 | final public function getConstList(bool $include_default = false) 46 | { 47 | $class = new \ReflectionClass($this); 48 | $constants = $class->getConstants(); 49 | if (!$include_default) { 50 | unset($constants['__default']); 51 | } 52 | return $constants; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Php80 as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return; 16 | } 17 | 18 | if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { 19 | define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); 20 | } 21 | 22 | if (!function_exists('fdiv')) { 23 | function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } 24 | } 25 | if (!function_exists('preg_last_error_msg')) { 26 | function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } 27 | } 28 | if (!function_exists('str_contains')) { 29 | function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } 30 | } 31 | if (!function_exists('str_starts_with')) { 32 | function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } 33 | } 34 | if (!function_exists('str_ends_with')) { 35 | function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } 36 | } 37 | if (!function_exists('get_debug_type')) { 38 | function get_debug_type($value): string { return p\Php80::get_debug_type($value); } 39 | } 40 | if (!function_exists('get_resource_id')) { 41 | function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplInt.md: -------------------------------------------------------------------------------- 1 | # [The SplInt class](#The-SplInt-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | The SplInt class is used to enforce strong typing of the integer type. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | SplInt extends SplType { 14 | /* Constants */ 15 | const integer __default = 0; 16 | /* Inherited methods */ 17 | SplType::__construct ([ mixed $initial_value [, bool $strict ]] ) 18 | } 19 | ``` 20 | 21 | ## [Predefined Constants](#Predefined-Constants) 22 | 23 | **SplInt::__default** 24 | 25 | ## [Examples](#Examples) 26 | 27 | ### Example #1 SplInt usage example 28 | 29 | ```php 30 | getMessage() . PHP_EOL; 37 | } 38 | 39 | echo $int . PHP_EOL; 40 | ``` 41 | 42 | The above example will output: 43 | 44 | > ``` 45 | > Value not an integer 46 | > 94 47 | > ``` 48 | 49 | ## [Table of Contents](#Table-of-Contents) 50 | 51 | - [SplType::__construct] — Creates a new value of some type 52 | 53 | ## [See Also](#See-Also) 54 | 55 | - [`SplType`] 56 | - [`SplFloat`] 57 | - [`SplEnum`] 58 | - [`SplBool`] 59 | - [`SplString`] 60 | 61 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 62 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 63 | [`SplType`]: /assets/documentation/SplType.md 64 | [`SplInt`]: /assets/documentation/SplInt.md 65 | [`SplFloat`]: /assets/documentation/SplFloat.md 66 | [`SplEnum`]: /assets/documentation/SplEnum.md 67 | [`SplBool`]: /assets/documentation/SplBool.md 68 | [`SplString`]: /assets/documentation/SplString.md 69 | -------------------------------------------------------------------------------- /vendor/symfony/process/Pipes/PipesInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Pipes; 13 | 14 | /** 15 | * PipesInterface manages descriptors and pipes for the use of proc_open. 16 | * 17 | * @author Romain Neutron 18 | * 19 | * @internal 20 | */ 21 | interface PipesInterface 22 | { 23 | public const CHUNK_SIZE = 16384; 24 | 25 | /** 26 | * Returns an array of descriptors for the use of proc_open. 27 | */ 28 | public function getDescriptors(): array; 29 | 30 | /** 31 | * Returns an array of filenames indexed by their related stream in case these pipes use temporary files. 32 | * 33 | * @return string[] 34 | */ 35 | public function getFiles(): array; 36 | 37 | /** 38 | * Reads data in file handles and pipes. 39 | * 40 | * @param bool $blocking Whether to use blocking calls or not 41 | * @param bool $close Whether to close pipes if they've reached EOF 42 | * 43 | * @return string[] An array of read data indexed by their fd 44 | */ 45 | public function readAndWrite(bool $blocking, bool $close = false): array; 46 | 47 | /** 48 | * Returns if the current state has open file handles or pipes. 49 | */ 50 | public function areOpen(): bool; 51 | 52 | /** 53 | * Returns if pipes are able to read output. 54 | */ 55 | public function haveReadSupport(): bool; 56 | 57 | /** 58 | * Closes file handles and pipes. 59 | */ 60 | public function close(); 61 | } 62 | -------------------------------------------------------------------------------- /Updates/1.1.0.php: -------------------------------------------------------------------------------- 1 | migration = $factory; 31 | } 32 | 33 | /** 34 | * Return database migrations to be executed in this update. 35 | * 36 | * @param Updater $updater 37 | * @return Db[] 38 | */ 39 | public function getMigrations(Updater $updater) 40 | { 41 | $migration = $this->migration->db->boundSql(' 42 | UPDATE `' . Common::prefixTable('site_setting') . '` 43 | SET 44 | `setting_name` = ? 45 | WHERE 46 | `plugin_name` = ? AND 47 | `setting_name` = ? 48 | ', [ 49 | 'has_grouped_urls', 50 | 'PerformanceAudit', 51 | 'has_urls_without_query_string' 52 | ]); 53 | 54 | return [$migration]; 55 | } 56 | 57 | /** 58 | * Perform the incremental version update. 59 | * 60 | * @param Updater $updater 61 | */ 62 | public function doUpdate(Updater $updater) 63 | { 64 | $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /EmulatedDevice.php: -------------------------------------------------------------------------------- 1 | 1, 39 | self::Desktop => 2, 40 | self::Both => 3 41 | ]; 42 | 43 | /** 44 | * Get ID of emulated device. 45 | * 46 | * @param string $enum 47 | * @return int 48 | * @throws OutOfBoundsException 49 | */ 50 | public static function getIdFor(string $enum) { 51 | if (!isset(self::Lookup[$enum])) { 52 | throw new OutOfBoundsException($enum . ' is no valid EmulatedDevice enum.'); 53 | } 54 | 55 | return self::Lookup[$enum]; 56 | } 57 | 58 | /** 59 | * Get emulated device(s) as array. 60 | * 61 | * @param string $enum 62 | * @return array 63 | */ 64 | public static function getList(string $enum) { 65 | $emulatedDevices = (array) $enum; 66 | if (current($emulatedDevices) === 'both') { 67 | $emulatedDevices = ['desktop', 'mobile']; 68 | } 69 | 70 | return $emulatedDevices; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplFloat.md: -------------------------------------------------------------------------------- 1 | # [The SplFloat class](#The-SplFloat-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | The SplFloat class is used to enforce strong typing of the float type. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | SplFloat extends SplType { 14 | /* Constants */ 15 | const float __default = 0; 16 | /* Inherited methods */ 17 | SplType::__construct ([ mixed $initial_value [, bool $strict ]] ) 18 | } 19 | ``` 20 | 21 | ## [Predefined Constants](#Predefined-Constants) 22 | 23 | **SplFloat::__default** 24 | 25 | ## [Examples](#Examples) 26 | 27 | ### Example #1 SplFloat usage example 28 | 29 | ```php 30 | getMessage() . PHP_EOL; 38 | } 39 | 40 | echo $float . PHP_EOL; 41 | echo $newFloat . PHP_EOL; 42 | ``` 43 | 44 | The above example will output: 45 | 46 | > ``` 47 | > Value not a float 48 | > 3.154 49 | > 3 50 | > ``` 51 | 52 | ## [Table of Contents](#Table-of-Contents) 53 | 54 | - [SplType::__construct] — Creates a new value of some type 55 | 56 | ## [See Also](#See-Also) 57 | 58 | - [`SplType`] 59 | - [`SplInt`] 60 | - [`SplEnum`] 61 | - [`SplBool`] 62 | - [`SplString`] 63 | 64 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 65 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 66 | [`SplType`]: /assets/documentation/SplType.md 67 | [`SplInt`]: /assets/documentation/SplInt.md 68 | [`SplFloat`]: /assets/documentation/SplFloat.md 69 | [`SplEnum`]: /assets/documentation/SplEnum.md 70 | [`SplBool`]: /assets/documentation/SplBool.md 71 | [`SplString`]: /assets/documentation/SplString.md 72 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | $filesToLoad = \Composer\Autoload\ComposerStaticInit98dde460e8a16c8877d8f8d8a8e6921c::$files; 37 | $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 38 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 | 41 | require $file; 42 | } 43 | }, null, null); 44 | foreach ($filesToLoad as $fileIdentifier => $file) { 45 | $requireFile($fileIdentifier, $file); 46 | } 47 | 48 | return $loader; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/Unit/Metric/PercentTest.php: -------------------------------------------------------------------------------- 1 | formatter = new Formatter(); 30 | } 31 | 32 | public function test_max_median_min_percent_format_as_expected() 33 | { 34 | $objs = [ 35 | new MaxPercent(), 36 | new MedianPercent(), 37 | new MinPercent() 38 | ]; 39 | 40 | foreach ($objs as $obj) { 41 | $this->assertSame('0', $obj->format(0, $this->formatter)); 42 | $this->assertSame('50.125', $obj->format(50.125, $this->formatter)); 43 | $this->assertSame('100', $obj->format(100, $this->formatter)); 44 | $this->assertSame('-100.55', $obj->format(-100.55, $this->formatter)); 45 | } 46 | } 47 | 48 | public function test_max_median_min_percent_format_with_exception() 49 | { 50 | $this->expectException(TypeError::class); 51 | 52 | $objs = [ 53 | new MaxPercent(), 54 | new MedianPercent(), 55 | new MinPercent() 56 | ]; 57 | 58 | foreach ($objs as $obj) { 59 | $obj->format('test', $this->formatter); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplBool.md: -------------------------------------------------------------------------------- 1 | # [The SplBool class](#The-SplBool-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | The SplBool class is used to enforce strong typing of the bool type. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | SplBool extends SplEnum { 14 | /* Constants */ 15 | const boolean __default = false; 16 | const boolean false = false; 17 | const boolean true = true; 18 | /* Inherited methods */ 19 | public array SplEnum::getConstList ([ bool $include_default = false ] ) 20 | } 21 | ``` 22 | 23 | ## [Predefined Constants](#Predefined-Constants) 24 | 25 | **SplBool::__default** 26 | **SplBool::false** 27 | **SplBool::true** 28 | 29 | ## [Examples](#Examples) 30 | 31 | ### Example #1 SplBool usage example 32 | 33 | ```php 34 | ``` 49 | > TRUE 50 | > ``` 51 | 52 | ## [Table of Contents](#Table-of-Contents) 53 | 54 | - [SplType::__construct] — Creates a new value of some type 55 | - [SplEnum::getConstList] — Returns all consts (possible values) as an array. 56 | 57 | ## [See Also](#See-Also) 58 | 59 | - [`SplType`] 60 | - [`SplInt`] 61 | - [`SplFloat`] 62 | - [`SplEnum`] 63 | - [`SplString`] 64 | 65 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 66 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 67 | [`SplType`]: /assets/documentation/SplType.md 68 | [`SplInt`]: /assets/documentation/SplInt.md 69 | [`SplFloat`]: /assets/documentation/SplFloat.md 70 | [`SplEnum`]: /assets/documentation/SplEnum.md 71 | [`SplBool`]: /assets/documentation/SplBool.md 72 | [`SplString`]: /assets/documentation/SplString.md 73 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplString.md: -------------------------------------------------------------------------------- 1 | # [The SplString class](#The-SplString-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | The SplString class is used to enforce strong typing of the string type. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | SplString extends SplType { 14 | /* Constants */ 15 | const string __default = ''; 16 | /* Inherited methods */ 17 | SplType::__construct ([ mixed $initial_value [, bool $strict ]] ) 18 | } 19 | ``` 20 | 21 | ## [Predefined Constants](#Predefined-Constants) 22 | 23 | **SplString::__default** 24 | 25 | ## [Examples](#Examples) 26 | 27 | ### Example #1 SplString usage example 28 | 29 | ```php 30 | getMessage() . PHP_EOL; 37 | } 38 | 39 | var_dump($string); 40 | echo $string; // Outputs "Testing" 41 | ``` 42 | 43 | The above example will output: 44 | 45 | > ``` 46 | > Value not a string 47 | > object(SplString)#1 (1) { 48 | > ["__default"] => string(7) "Testing" 49 | > } 50 | > Testing 51 | > ``` 52 | 53 | ## [Table of Contents](#Table-of-Contents) 54 | 55 | - [SplType::__construct] — Creates a new value of some type 56 | 57 | ## [See Also](#See-Also) 58 | 59 | - [`SplType`] 60 | - [`SplFloat`] 61 | - [`SplEnum`] 62 | - [`SplBool`] 63 | - [`SplString`] 64 | 65 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 66 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 67 | [`SplType`]: /assets/documentation/SplType.md 68 | [`SplInt`]: /assets/documentation/SplInt.md 69 | [`SplFloat`]: /assets/documentation/SplFloat.md 70 | [`SplEnum`]: /assets/documentation/SplEnum.md 71 | [`SplBool`]: /assets/documentation/SplBool.md 72 | [`SplString`]: /assets/documentation/SplString.md 73 | -------------------------------------------------------------------------------- /tests/Unit/Metric/SecondsTest.php: -------------------------------------------------------------------------------- 1 | formatter = new Formatter(); 30 | } 31 | 32 | public function test_max_median_min_seconds_format_as_expected() 33 | { 34 | $objs = [ 35 | new MaxSeconds(), 36 | new MedianSeconds(), 37 | new MinSeconds() 38 | ]; 39 | 40 | foreach ($objs as $obj) { 41 | $this->assertSame('0.000', $obj->format(0, $this->formatter)); 42 | $this->assertSame('0.001', $obj->format(1, $this->formatter)); 43 | $this->assertSame('50.125', $obj->format(50125, $this->formatter)); 44 | $this->assertSame('100', $obj->format(100000, $this->formatter)); 45 | $this->assertSame('-100.55', $obj->format(-100550, $this->formatter)); 46 | } 47 | } 48 | 49 | public function test_max_median_min_seconds_format_with_exception() 50 | { 51 | $this->expectException(TypeError::class); 52 | 53 | $objs = [ 54 | new MaxSeconds(), 55 | new MedianSeconds(), 56 | new MinSeconds() 57 | ]; 58 | 59 | foreach ($objs as $obj) { 60 | $obj->format('test', $this->formatter); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/symfony/process/Exception/ProcessTimedOutException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Exception; 13 | 14 | use Symfony\Component\Process\Process; 15 | 16 | /** 17 | * Exception that is thrown when a process times out. 18 | * 19 | * @author Johannes M. Schmitt 20 | */ 21 | class ProcessTimedOutException extends RuntimeException 22 | { 23 | public const TYPE_GENERAL = 1; 24 | public const TYPE_IDLE = 2; 25 | 26 | private $process; 27 | private $timeoutType; 28 | 29 | public function __construct(Process $process, int $timeoutType) 30 | { 31 | $this->process = $process; 32 | $this->timeoutType = $timeoutType; 33 | 34 | parent::__construct(sprintf( 35 | 'The process "%s" exceeded the timeout of %s seconds.', 36 | $process->getCommandLine(), 37 | $this->getExceededTimeout() 38 | )); 39 | } 40 | 41 | public function getProcess() 42 | { 43 | return $this->process; 44 | } 45 | 46 | public function isGeneralTimeout() 47 | { 48 | return self::TYPE_GENERAL === $this->timeoutType; 49 | } 50 | 51 | public function isIdleTimeout() 52 | { 53 | return self::TYPE_IDLE === $this->timeoutType; 54 | } 55 | 56 | public function getExceededTimeout() 57 | { 58 | switch ($this->timeoutType) { 59 | case self::TYPE_GENERAL: 60 | return $this->process->getTimeout(); 61 | 62 | case self::TYPE_IDLE: 63 | return $this->process->getIdleTimeout(); 64 | 65 | default: 66 | throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | codecov: codecov/codecov@4.0.1 5 | coveralls: coveralls/coveralls@2.2.1 6 | 7 | # Define the jobs we want to run for this project 8 | jobs: 9 | test: 10 | docker: 11 | - image: cimg/php:7.4-node 12 | steps: 13 | - checkout 14 | - run: php --version 15 | # - run: sudo apt-get install libxslt1-dev 16 | 17 | - run: 18 | name: Install PHP Extensions 19 | command: sudo -E install-php-extensions zip intl 20 | 21 | #- run: 22 | # name: Install xDebug 23 | # command: sudo pecl install xdebug-3.1.5 && docker-php-ext-enable xdebug 24 | 25 | - run: echo -e "[Date]\ndate.timezone = Europe/Paris" | sudo tee /usr/local/etc/php/php.ini > /dev/null 26 | - run: echo -e "memory_limit = -1" | sudo tee -a /usr/local/etc/php/conf.d/docker-php-memlimit.ini 27 | 28 | # composer require 29 | - run: composer require --dev --update-with-all-dependencies php-coveralls/php-coveralls 30 | 31 | # composer cache 32 | - restore_cache: 33 | keys: 34 | # "composer.json" can be used if "composer.json" 35 | # is not committed to the repository. 36 | - composer-v1-{{ checksum "composer.lock" }} 37 | # fallback to using the latest cache if no exact match is found 38 | - composer-v1- 39 | - run: composer install -n --prefer-dist 40 | - save_cache: 41 | key: composer-v1-{{ checksum "composer.lock" }} 42 | paths: 43 | - vendor 44 | 45 | # tests 46 | - run: composer unittest 47 | - run: composer atoumtest 48 | 49 | #- run: 50 | # command: npm install && make test-coverage 51 | # name: Install and Make 52 | 53 | # Stay commented Managed in github actions 54 | #- coveralls/upload 55 | #- codecov/upload 56 | 57 | # Orchestrate our job run sequence 58 | workflows: 59 | workflow: 60 | jobs: 61 | - test: 62 | filters: 63 | branches: 64 | only: /5\..*/ 65 | -------------------------------------------------------------------------------- /vendor/symfony/process/ProcessUtils.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process; 13 | 14 | use Symfony\Component\Process\Exception\InvalidArgumentException; 15 | 16 | /** 17 | * ProcessUtils is a bunch of utility methods. 18 | * 19 | * This class contains static methods only and is not meant to be instantiated. 20 | * 21 | * @author Martin Hasoň 22 | */ 23 | class ProcessUtils 24 | { 25 | /** 26 | * This class should not be instantiated. 27 | */ 28 | private function __construct() 29 | { 30 | } 31 | 32 | /** 33 | * Validates and normalizes a Process input. 34 | * 35 | * @param string $caller The name of method call that validates the input 36 | * @param mixed $input The input to validate 37 | * 38 | * @return mixed 39 | * 40 | * @throws InvalidArgumentException In case the input is not valid 41 | */ 42 | public static function validateInput(string $caller, $input) 43 | { 44 | if (null !== $input) { 45 | if (\is_resource($input)) { 46 | return $input; 47 | } 48 | if (\is_string($input)) { 49 | return $input; 50 | } 51 | if (\is_scalar($input)) { 52 | return (string) $input; 53 | } 54 | if ($input instanceof Process) { 55 | return $input->getIterator($input::ITER_SKIP_ERR); 56 | } 57 | if ($input instanceof \Iterator) { 58 | return $input; 59 | } 60 | if ($input instanceof \Traversable) { 61 | return new \IteratorIterator($input); 62 | } 63 | 64 | throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); 65 | } 66 | 67 | return $input; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ducks-project/spl-types", 3 | "type": "library", 4 | "description": "Polyfill Module for SplType PHP extension. This extension aims at helping people making PHP a stronger typed language and can be a good alternative to scalar type hinting. It provides different typehandling classes as such as integer, float, bool, enum and string", 5 | "keywords": ["Enum", "SplTypes", "SplEnum", "enumerator", "POO", "SplBool", "SplFloat", "SplInt", "SplString", "SplType", "polyfill", "php", "compat"], 6 | "homepage": "https://github.com/ducks-project/spl-types/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Adrien Loyant", 11 | "email": "donald_duck@team-df.org", 12 | "homepage": "http://adrien.loyant.net", 13 | "role": "Owner" 14 | } 15 | ], 16 | "support": { 17 | "email": "adrien.loyant@gmail.com" 18 | }, 19 | "require": { 20 | "php": ">=7.2" 21 | }, 22 | "require-dev": { 23 | "atoum/atoum": "^4.0||^4.1||^4.2", 24 | "atoum/stubs": "^2.6", 25 | "friendsofphp/php-cs-fixer": "^2.19||^3.64", 26 | "phpbench/phpbench": "^1.1||^1.2", 27 | "phpstan/phpstan": "^1.12", 28 | "phpunit/phpunit": "^8.5||^9.6||^10.5||^11.3", 29 | "squizlabs/php_codesniffer": "^3.10", 30 | "vimeo/psalm": "^4.30||5.26" 31 | }, 32 | "autoload": { 33 | "psr-4": { 34 | "Ducks\\Component\\SplTypes\\": "" 35 | }, 36 | "files": [ 37 | "bootstrap.php" 38 | ], 39 | "exclude-from-classmap": [ 40 | "/Tests/" 41 | ] 42 | }, 43 | "scripts": { 44 | "test": [ 45 | "@unittest", 46 | "@atoumtest" 47 | ], 48 | "unittest": "XDEBUG_MODE=coverage ./vendor/bin/phpunit Tests/phpunit -c phpunit.xml.dist", 49 | "atoumtest": "XDEBUG_MODE=coverage ./vendor/bin/atoum -d Tests/atoum", 50 | "bench": "./vendor/bin/phpbench run Tests/benchmark/ --report=default" 51 | }, 52 | "scripts-descriptions": { 53 | "test": "Run all tests!" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | ## FAQ 2 | 3 | __How are the audits generated? Are any external services used?__ 4 | 5 | The audits are generated using Node.js in the background by running Googles Lighthouse tool against all the visited/tracked pages within the last 30 days. Everything is executed locally on your server, no data is transferred to external services. 6 | 7 | __How do I change to audit only mobile or only desktop environments of my site?__ 8 | 9 | Under `General Settings` > `Websites` > `Manage` click on the edit button of the site you want to change the setting of and scroll to the setting `Performance simulation environment` selection to change it. 10 | 11 | __I just installed the plugin or I just switched the website settings of the performance simulation environment and I cannot see any performance reports, why is that?__ 12 | 13 | You need to wait at least 24h until the reports are getting generated in the background with the scheduled tasks of your Matomo cron job. 14 | 15 | __I shutdown/restarted my server and now the performance reports won't get generated anymore, what can I do?__ 16 | 17 | If the site audit gets unexpectedly interrupted, so the plugin can't properly finish its code execution it will have a problem to restart. It would be possible to automatically fix this problematic state, but very long running site audits would run into issues then. So in this case you either wait until the next week starts (an internal plugin reset will happen then), or you can run the Matomo console command `console performanceaudit:clear-task-running-flag` which will reset the plugin state, so the audits will be scheduled correctly again at the next possible time. 18 | 19 | __I want to use a custom HTTP header for authentication, so the audit plugin can access my protected pages, how do I do that?__ 20 | 21 | Under `General Settings` > `Websites` > `Manage` click on the edit button of the site you want to change the setting of and scroll to the checkbox `Use Custom HTTP header` and activate it in order to change the HTTP header key and its value. The audit tool will send then the entered header value paired with the selected header key to the server with every request. 22 | 23 | __The plugin cannot install because Chromium cannot be installed due to a missing library?__ 24 | 25 | Make sure [all necessary dependencies](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-doesnt-launch-on-linux) for Chromium are installed. 26 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/assets/documentation/SplEnum.md: -------------------------------------------------------------------------------- 1 | # [The SplEnum class](#The-SplEnum-class) 2 | 3 | (PHP 5, PHP 7, PHP 8) 4 | Check for [pecl SPL_Types] 5 | 6 | ## [Introduction](#Introduction) 7 | 8 | SplEnum gives the ability to emulate and create enumeration objects natively in PHP. 9 | 10 | ## [Class synopsis](#Class-synopsis) 11 | 12 | ```php 13 | SplEnum extends SplType { 14 | /* Constants */ 15 | const NULL __default = null ; 16 | /* Methods */ 17 | public array getConstList ([ bool $include_default = false ] ) 18 | /* Inherited methods */ 19 | SplType::__construct ([ mixed $initial_value [, bool $strict ]] ) 20 | } 21 | ``` 22 | 23 | ## [Predefined Constants](#Predefined-Constants) 24 | 25 | **SplEnum::__default** 26 | 27 | ## [Examples](#Examples) 28 | 29 | ### Example #1 SplEnum usage example 30 | 31 | ```php 32 | getMessage() . PHP_EOL; 56 | } 57 | ``` 58 | 59 | The above example will output: 60 | 61 | > ``` 62 | > 6 63 | > Value not a const in enum Month 64 | > ``` 65 | 66 | ## [Table of Contents](#Table-of-Contents) 67 | 68 | - [SplType::__construct] — Creates a new value of some type 69 | - [SplEnum::getConstList] — Returns all consts (possible values) as an array. 70 | 71 | ## [See Also](#See-Also) 72 | 73 | - [`SplType`] 74 | - [`SplInt`] 75 | - [`SplFloat`] 76 | - [`SplBool`] 77 | - [`SplString`] 78 | 79 | [SplType::__construct]: ./SplType.construct.md#SplType::__construct 80 | [SplEnum::getConstList]: ./SplEnum.getConstList.md#SplEnum::getConstList 81 | [pecl SPL_Types]:https://pecl.php.net/package/SPL_Types 82 | [`SplType`]: /assets/documentation/SplType.md 83 | [`SplInt`]: /assets/documentation/SplInt.md 84 | [`SplFloat`]: /assets/documentation/SplFloat.md 85 | [`SplEnum`]: /assets/documentation/SplEnum.md 86 | [`SplBool`]: /assets/documentation/SplBool.md 87 | [`SplString`]: /assets/documentation/SplString.md 88 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/SplType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Ducks\Component\SplTypes; 13 | 14 | /** 15 | * Parent class for all SPL types. 16 | * 17 | * @see SplType http://php.net/manual/en/class.spltype.php 18 | * 19 | * @psalm-api 20 | */ 21 | abstract class SplType 22 | { 23 | /** 24 | * Default value. 25 | */ 26 | // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase 27 | public const __default = null; 28 | 29 | /** 30 | * Internal enum value. 31 | * 32 | * @var mixed 33 | */ 34 | // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore 35 | public $__default; 36 | 37 | /** 38 | * Creates a new value of some type. 39 | * 40 | * @param mixed $initial_value Type and default value depends on the extension class. 41 | * @param bool $strict Whether to set the object's sctrictness. 42 | * 43 | * @return void 44 | * 45 | * @throws \UnexpectedValueException if incompatible type is given. 46 | * 47 | * @phpstan-ignore-next-line 48 | */ 49 | public function __construct($initial_value = self::__default, bool $strict = true) 50 | { 51 | if (null === $initial_value) { 52 | $initial_value = static::__default; 53 | } 54 | $this->__default = $initial_value; 55 | } 56 | 57 | /** 58 | * Stringify object. 59 | * 60 | * @return string 61 | */ 62 | final public function __toString() 63 | { 64 | return (string) $this->__default; 65 | } 66 | 67 | /** 68 | * Export object. 69 | * 70 | * @param array $properties 71 | * 72 | * @return SplType 73 | */ 74 | final public static function __set_state(array $properties) 75 | { 76 | // @phpstan-ignore-next-line 77 | return new static($properties['__default']); 78 | } 79 | 80 | /** 81 | * Dumping object (php > 5.6.0). 82 | * 83 | * @return array 84 | */ 85 | final public function __debugInfo() 86 | { 87 | return [ 88 | '__default' => $this->__default, 89 | ]; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/devdavido/lighthouse/README.md: -------------------------------------------------------------------------------- 1 | # Lighthouse 2 | 3 | This package provide a php interface for [Google Lighthouse](https://github.com/GoogleChrome/lighthouse). 4 | 5 | Here's an example that will perform the default Lighthouse audits and store the result in `report.json` (You can use the [Lighthouse Viewer](https://googlechrome.github.io/lighthouse/viewer/) to open the report): 6 | 7 | ```php 8 | use DevDavido\Lighthouse\Lighthouse; 9 | 10 | (new Lighthouse()) 11 | ->setOutput('report.json') 12 | ->accessibility() 13 | ->bestPractices() 14 | ->performance() 15 | ->pwa() 16 | ->seo() 17 | ->audit('http://example.com'); 18 | ``` 19 | 20 | ### Output 21 | 22 | The `setOutput` method accepts a second argument that can be used to specify the format (json,html). 23 | If the format argument is missing then the file extension will be used to determine the output format. 24 | If the file extension does not specify an accepted format, then json will be used. 25 | 26 | You can output both the json and html reports by passing an array as the second argument. For the example 27 | the following code will create two reports `example.report.html` and `example.report.json`. 28 | 29 | ```php 30 | use DevDavido\Lighthouse\Lighthouse; 31 | 32 | (new Lighthouse()) 33 | ->setOutput('example', ['html', 'json']) 34 | ->performance() 35 | ->audit('http://example.com'); 36 | ``` 37 | 38 | ### Using a custom config 39 | 40 | You can provide your own configuration file using the `withConfig` method. 41 | ```php 42 | use DevDavido\Lighthouse\Lighthouse; 43 | 44 | (new Lighthouse()) 45 | ->withConfig('./my-config.js') 46 | ->audit('http://example.com'); 47 | ``` 48 | 49 | ### Customizing node and Lighthouse paths 50 | 51 | If you need to manually set these paths, you can do this by calling the `setNodeBinary` and `setLighthousePath` methods. 52 | 53 | ```php 54 | use DevDavido\Lighthouse\Lighthouse; 55 | 56 | (new Lighthouse()) 57 | ->setNodeBinary('/usr/bin/node') 58 | ->setLighthousePath('./lighthouse.js') 59 | ->audit('http://example.com'); 60 | ``` 61 | 62 | ### Passing flags to Chrome 63 | Use the `setChromeFlags` method to pass any flags to the Chrome instance. 64 | ```php 65 | use DevDavido\Lighthouse\Lighthouse; 66 | 67 | (new Lighthouse()) 68 | // these are the default flags used 69 | ->setChromeFlags(['--headless', '--disable-gpu', '--no-sandbox']) 70 | ->audit('http://example.com'); 71 | ``` 72 | -------------------------------------------------------------------------------- /Controller.php: -------------------------------------------------------------------------------- 1 | renderTemplate('version', [ 24 | 'pluginVersion' => $plugin->getVersion(), 25 | 'pluginName' => $plugin->getPluginName() 26 | ]); 27 | } 28 | 29 | /** 30 | * Render plugin check page. 31 | * 32 | * @return string 33 | * @throws Exception 34 | */ 35 | public function pluginCheck() 36 | { 37 | $installer = new NodeDependencyInstaller(); 38 | 39 | $error = ''; 40 | try { 41 | Helper::checkDirectoriesWriteable(['Audits', 'node_modules']); 42 | 43 | $installer->checkInternetAvailability(); 44 | $installer->checkNpm(); 45 | $installer->checkNpmDependencies(); 46 | } catch (Exception $exception) { 47 | $error = $exception->getMessage(); 48 | } 49 | 50 | return $this->renderTemplate('pluginCheck', [ 51 | 'checkStartUrl' => (new Menu())->getUrlForAction('pluginCheckStart'), 52 | 'error' => $error 53 | ]); 54 | } 55 | 56 | /** 57 | * Start plugin check. 58 | * 59 | * @return string 60 | * @throws Exception 61 | */ 62 | public function pluginCheckStart() 63 | { 64 | $tasks = new Tasks(); 65 | foreach (Site::getSites() as $site) { 66 | $tasks->auditSite((int) $site['idsite'], $debug = true); 67 | } 68 | 69 | $hasErrorInOutput = false; 70 | $logOutput = array_map('trim', array_map('stripslashes', $tasks->getLogOutput())); 71 | foreach ($logOutput as $logEntry) { 72 | if (stristr($logEntry, '[error]') || stristr($logEntry, '[warning]')) { 73 | $hasErrorInOutput = true; 74 | } 75 | } 76 | 77 | return $this->renderTemplate('pluginChecked', [ 78 | 'hasErrorInOutput' => $hasErrorInOutput, 79 | 'logOutput' => nl2br(implode("\n", $logOutput)) 80 | ]); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Reports/GetPerformanceScoreMobile.php: -------------------------------------------------------------------------------- 1 | metrics = $metrics; 34 | $this->processedMetrics = $metrics; 35 | $this->defaultSortColumn = (new MedianPercent())->getName(); 36 | $this->defaultSortOrderDesc = false; 37 | 38 | $this->name = Piwik::translate('PerformanceAudit_Report_Header_Score_Mobile'); 39 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_Score'); 40 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 41 | Piwik::translate('PerformanceAudit_Report_Score_Documentation_Information'), 42 | Piwik::translate('PerformanceAudit_EnvironmentMobile'), 43 | 'performance-scoring', 44 | 'Lighthouse Performance Score' 45 | ]); 46 | $this->order = 1; 47 | } 48 | 49 | /** 50 | * Configure view. 51 | * 52 | * @param ViewDataTable $view 53 | * @return void 54 | */ 55 | public function configureView(ViewDataTable $view) 56 | { 57 | parent::configureView($view); 58 | 59 | $view->requestConfig->filter_sort_column = (new MedianPercent())->getName(); 60 | $view->requestConfig->filter_sort_order = Sort::ORDER_ASC; 61 | } 62 | 63 | /** 64 | * Configure widget. 65 | * 66 | * @param WidgetsList $widgetsList 67 | * @param ReportWidgetFactory $factory 68 | * @return void 69 | */ 70 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 71 | { 72 | parent::configureWidgetsMobile($widgetsList, $factory, 'Score'); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Reports/GetPerformanceScoreDesktop.php: -------------------------------------------------------------------------------- 1 | metrics = $metrics; 34 | $this->processedMetrics = $metrics; 35 | $this->defaultSortColumn = (new MedianPercent())->getName(); 36 | $this->defaultSortOrderDesc = false; 37 | 38 | $this->name = Piwik::translate('PerformanceAudit_Report_Header_Score_Desktop'); 39 | $this->subcategoryId = Piwik::translate('PerformanceAudit_SubCategory_Score'); 40 | $this->documentation = Piwik::translate('PerformanceAudit_Report_Documentation', [ 41 | Piwik::translate('PerformanceAudit_Report_Score_Documentation_Information'), 42 | Piwik::translate('PerformanceAudit_EnvironmentDesktop'), 43 | 'performance-scoring', 44 | 'Lighthouse Performance Score' 45 | ]); 46 | $this->order = 1; 47 | } 48 | 49 | /** 50 | * Configure view. 51 | * 52 | * @param ViewDataTable $view 53 | * @return void 54 | */ 55 | public function configureView(ViewDataTable $view) 56 | { 57 | parent::configureView($view); 58 | 59 | $view->requestConfig->filter_sort_column = (new MedianPercent())->getName(); 60 | $view->requestConfig->filter_sort_order = Sort::ORDER_ASC; 61 | } 62 | 63 | /** 64 | * Configure widget. 65 | * 66 | * @param WidgetsList $widgetsList 67 | * @param ReportWidgetFactory $factory 68 | * @return void 69 | */ 70 | public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory) 71 | { 72 | parent::configureWidgetsDesktop($widgetsList, $factory, 'Score'); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php: -------------------------------------------------------------------------------- 1 | 'i̇', 5 | 'µ' => 'μ', 6 | 'ſ' => 's', 7 | 'ͅ' => 'ι', 8 | 'ς' => 'σ', 9 | 'ϐ' => 'β', 10 | 'ϑ' => 'θ', 11 | 'ϕ' => 'φ', 12 | 'ϖ' => 'π', 13 | 'ϰ' => 'κ', 14 | 'ϱ' => 'ρ', 15 | 'ϵ' => 'ε', 16 | 'ẛ' => 'ṡ', 17 | 'ι' => 'ι', 18 | 'ß' => 'ss', 19 | 'ʼn' => 'ʼn', 20 | 'ǰ' => 'ǰ', 21 | 'ΐ' => 'ΐ', 22 | 'ΰ' => 'ΰ', 23 | 'և' => 'եւ', 24 | 'ẖ' => 'ẖ', 25 | 'ẗ' => 'ẗ', 26 | 'ẘ' => 'ẘ', 27 | 'ẙ' => 'ẙ', 28 | 'ẚ' => 'aʾ', 29 | 'ẞ' => 'ss', 30 | 'ὐ' => 'ὐ', 31 | 'ὒ' => 'ὒ', 32 | 'ὔ' => 'ὔ', 33 | 'ὖ' => 'ὖ', 34 | 'ᾀ' => 'ἀι', 35 | 'ᾁ' => 'ἁι', 36 | 'ᾂ' => 'ἂι', 37 | 'ᾃ' => 'ἃι', 38 | 'ᾄ' => 'ἄι', 39 | 'ᾅ' => 'ἅι', 40 | 'ᾆ' => 'ἆι', 41 | 'ᾇ' => 'ἇι', 42 | 'ᾈ' => 'ἀι', 43 | 'ᾉ' => 'ἁι', 44 | 'ᾊ' => 'ἂι', 45 | 'ᾋ' => 'ἃι', 46 | 'ᾌ' => 'ἄι', 47 | 'ᾍ' => 'ἅι', 48 | 'ᾎ' => 'ἆι', 49 | 'ᾏ' => 'ἇι', 50 | 'ᾐ' => 'ἠι', 51 | 'ᾑ' => 'ἡι', 52 | 'ᾒ' => 'ἢι', 53 | 'ᾓ' => 'ἣι', 54 | 'ᾔ' => 'ἤι', 55 | 'ᾕ' => 'ἥι', 56 | 'ᾖ' => 'ἦι', 57 | 'ᾗ' => 'ἧι', 58 | 'ᾘ' => 'ἠι', 59 | 'ᾙ' => 'ἡι', 60 | 'ᾚ' => 'ἢι', 61 | 'ᾛ' => 'ἣι', 62 | 'ᾜ' => 'ἤι', 63 | 'ᾝ' => 'ἥι', 64 | 'ᾞ' => 'ἦι', 65 | 'ᾟ' => 'ἧι', 66 | 'ᾠ' => 'ὠι', 67 | 'ᾡ' => 'ὡι', 68 | 'ᾢ' => 'ὢι', 69 | 'ᾣ' => 'ὣι', 70 | 'ᾤ' => 'ὤι', 71 | 'ᾥ' => 'ὥι', 72 | 'ᾦ' => 'ὦι', 73 | 'ᾧ' => 'ὧι', 74 | 'ᾨ' => 'ὠι', 75 | 'ᾩ' => 'ὡι', 76 | 'ᾪ' => 'ὢι', 77 | 'ᾫ' => 'ὣι', 78 | 'ᾬ' => 'ὤι', 79 | 'ᾭ' => 'ὥι', 80 | 'ᾮ' => 'ὦι', 81 | 'ᾯ' => 'ὧι', 82 | 'ᾲ' => 'ὰι', 83 | 'ᾳ' => 'αι', 84 | 'ᾴ' => 'άι', 85 | 'ᾶ' => 'ᾶ', 86 | 'ᾷ' => 'ᾶι', 87 | 'ᾼ' => 'αι', 88 | 'ῂ' => 'ὴι', 89 | 'ῃ' => 'ηι', 90 | 'ῄ' => 'ήι', 91 | 'ῆ' => 'ῆ', 92 | 'ῇ' => 'ῆι', 93 | 'ῌ' => 'ηι', 94 | 'ῒ' => 'ῒ', 95 | 'ῖ' => 'ῖ', 96 | 'ῗ' => 'ῗ', 97 | 'ῢ' => 'ῢ', 98 | 'ῤ' => 'ῤ', 99 | 'ῦ' => 'ῦ', 100 | 'ῧ' => 'ῧ', 101 | 'ῲ' => 'ὼι', 102 | 'ῳ' => 'ωι', 103 | 'ῴ' => 'ώι', 104 | 'ῶ' => 'ῶ', 105 | 'ῷ' => 'ῶι', 106 | 'ῼ' => 'ωι', 107 | 'ff' => 'ff', 108 | 'fi' => 'fi', 109 | 'fl' => 'fl', 110 | 'ffi' => 'ffi', 111 | 'ffl' => 'ffl', 112 | 'ſt' => 'st', 113 | 'st' => 'st', 114 | 'ﬓ' => 'մն', 115 | 'ﬔ' => 'մե', 116 | 'ﬕ' => 'մի', 117 | 'ﬖ' => 'վն', 118 | 'ﬗ' => 'մխ', 119 | ]; 120 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/PhpToken.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Php80; 13 | 14 | /** 15 | * @author Fedonyuk Anton 16 | * 17 | * @internal 18 | */ 19 | class PhpToken implements \Stringable 20 | { 21 | /** 22 | * @var int 23 | */ 24 | public $id; 25 | 26 | /** 27 | * @var string 28 | */ 29 | public $text; 30 | 31 | /** 32 | * @var int 33 | */ 34 | public $line; 35 | 36 | /** 37 | * @var int 38 | */ 39 | public $pos; 40 | 41 | public function __construct(int $id, string $text, int $line = -1, int $position = -1) 42 | { 43 | $this->id = $id; 44 | $this->text = $text; 45 | $this->line = $line; 46 | $this->pos = $position; 47 | } 48 | 49 | public function getTokenName(): ?string 50 | { 51 | if ('UNKNOWN' === $name = token_name($this->id)) { 52 | $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; 53 | } 54 | 55 | return $name; 56 | } 57 | 58 | /** 59 | * @param int|string|array $kind 60 | */ 61 | public function is($kind): bool 62 | { 63 | foreach ((array) $kind as $value) { 64 | if (\in_array($value, [$this->id, $this->text], true)) { 65 | return true; 66 | } 67 | } 68 | 69 | return false; 70 | } 71 | 72 | public function isIgnorable(): bool 73 | { 74 | return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); 75 | } 76 | 77 | public function __toString(): string 78 | { 79 | return (string) $this->text; 80 | } 81 | 82 | /** 83 | * @return static[] 84 | */ 85 | public static function tokenize(string $code, int $flags = 0): array 86 | { 87 | $line = 1; 88 | $position = 0; 89 | $tokens = token_get_all($code, $flags); 90 | foreach ($tokens as $index => $token) { 91 | if (\is_string($token)) { 92 | $id = \ord($token); 93 | $text = $token; 94 | } else { 95 | [$id, $text, $line] = $token; 96 | } 97 | $tokens[$index] = new static($id, $text, $line, $position); 98 | $position += \strlen($text); 99 | } 100 | 101 | return $tokens; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /vendor/symfony/process/PhpExecutableFinder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process; 13 | 14 | /** 15 | * An executable finder specifically designed for the PHP executable. 16 | * 17 | * @author Fabien Potencier 18 | * @author Johannes M. Schmitt 19 | */ 20 | class PhpExecutableFinder 21 | { 22 | private $executableFinder; 23 | 24 | public function __construct() 25 | { 26 | $this->executableFinder = new ExecutableFinder(); 27 | } 28 | 29 | /** 30 | * Finds The PHP executable. 31 | * 32 | * @return string|false 33 | */ 34 | public function find(bool $includeArgs = true) 35 | { 36 | if ($php = getenv('PHP_BINARY')) { 37 | if (!is_executable($php) && !$php = $this->executableFinder->find($php)) { 38 | return false; 39 | } 40 | 41 | if (@is_dir($php)) { 42 | return false; 43 | } 44 | 45 | return $php; 46 | } 47 | 48 | $args = $this->findArguments(); 49 | $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; 50 | 51 | // PHP_BINARY return the current sapi executable 52 | if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { 53 | return \PHP_BINARY.$args; 54 | } 55 | 56 | if ($php = getenv('PHP_PATH')) { 57 | if (!@is_executable($php) || @is_dir($php)) { 58 | return false; 59 | } 60 | 61 | return $php; 62 | } 63 | 64 | if ($php = getenv('PHP_PEAR_PHP_BIN')) { 65 | if (@is_executable($php) && !@is_dir($php)) { 66 | return $php; 67 | } 68 | } 69 | 70 | if (@is_executable($php = \PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) { 71 | return $php; 72 | } 73 | 74 | $dirs = [\PHP_BINDIR]; 75 | if ('\\' === \DIRECTORY_SEPARATOR) { 76 | $dirs[] = 'C:\xampp\php\\'; 77 | } 78 | 79 | return $this->executableFinder->find('php', false, $dirs); 80 | } 81 | 82 | /** 83 | * Finds the PHP executable arguments. 84 | * 85 | * @return array 86 | */ 87 | public function findArguments() 88 | { 89 | $arguments = []; 90 | if ('phpdbg' === \PHP_SAPI) { 91 | $arguments[] = '-qrr'; 92 | } 93 | 94 | return $arguments; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /vendor/symfony/process/PhpProcess.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process; 13 | 14 | use Symfony\Component\Process\Exception\LogicException; 15 | use Symfony\Component\Process\Exception\RuntimeException; 16 | 17 | /** 18 | * PhpProcess runs a PHP script in an independent process. 19 | * 20 | * $p = new PhpProcess(''); 21 | * $p->run(); 22 | * print $p->getOutput()."\n"; 23 | * 24 | * @author Fabien Potencier 25 | */ 26 | class PhpProcess extends Process 27 | { 28 | /** 29 | * @param string $script The PHP script to run (as a string) 30 | * @param string|null $cwd The working directory or null to use the working dir of the current PHP process 31 | * @param array|null $env The environment variables or null to use the same environment as the current PHP process 32 | * @param int $timeout The timeout in seconds 33 | * @param array|null $php Path to the PHP binary to use with any additional arguments 34 | */ 35 | public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) 36 | { 37 | if (null === $php) { 38 | $executableFinder = new PhpExecutableFinder(); 39 | $php = $executableFinder->find(false); 40 | $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments()); 41 | } 42 | if ('phpdbg' === \PHP_SAPI) { 43 | $file = tempnam(sys_get_temp_dir(), 'dbg'); 44 | file_put_contents($file, $script); 45 | register_shutdown_function('unlink', $file); 46 | $php[] = $file; 47 | $script = null; 48 | } 49 | 50 | parent::__construct($php, $cwd, $env, $script, $timeout); 51 | } 52 | 53 | /** 54 | * {@inheritdoc} 55 | */ 56 | public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, $input = null, ?float $timeout = 60) 57 | { 58 | throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); 59 | } 60 | 61 | /** 62 | * {@inheritdoc} 63 | */ 64 | public function start(?callable $callback = null, array $env = []) 65 | { 66 | if (null === $this->getCommandLine()) { 67 | throw new RuntimeException('Unable to find the PHP executable.'); 68 | } 69 | 70 | parent::start($callback, $env); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lang/cs.json: -------------------------------------------------------------------------------- 1 | { 2 | "PerformanceAudit": { 3 | "BrowserFamilies": "Rodiny prohlížečů", 4 | "Category": "Výkon", 5 | "CoreAdminHome_MenuPerformance": "Výkon", 6 | "CoreAdminHome_PluginPerformance": "Zásuvný modul PerformanceAudit", 7 | "CoreAdminHome_VersionPerformance": "V současné době používáte verzi %1$s%2$s%3$s zásuvného modulu %4$s.", 8 | "Donate_BuyMeACoffee": "Kupte mi kávu", 9 | "EnvironmentDesktop": "desktop", 10 | "EnvironmentMobile": "mobil", 11 | "Metrics_Max_Percent": "Nejvyšší %", 12 | "Metrics_Max_Percent_Documentation": "Maximální procento, kterého stránka dosáhla v této výkonnostní kategorii.", 13 | "Metrics_Max_Seconds": "Max. Sekundy", 14 | "Metrics_Max_Seconds_Documentation": "Horní hranice v sekundách, kterou stránka zabrala v této výkonnostní kategorii.", 15 | "Metrics_Median_Percent": "Median %", 16 | "Metrics_Median_Percent_Documentation": "Celkový medián procent, kterého stránka dosáhla v této výkonnostní kategorii.", 17 | "Metrics_Median_Seconds": "Median Sekund", 18 | "Metrics_Median_Seconds_Documentation": "Celkový medián v sekundách, který stránka v této kategorii výkonu potřebovala.", 19 | "Metrics_Min_Percent": "Nejnižší %", 20 | "Metrics_Min_Percent_Documentation": "Minimální procento, kterého stránka dosáhla v této výkonnostní kategorii.", 21 | "Metrics_Min_Seconds": "Min. Sekundy", 22 | "Metrics_Min_Seconds_Documentation": "Spodní hranice v sekundách, kterou stránka v této výkonnostní kategorii zabrala.", 23 | "Metrics_Tooltip": "%1$s%2$s je klasifikováno jako %3$s! \n Do této klasifikační skupiny patří hodnoty v rozmezí %4$s%2$s - %5$s%2$s.", 24 | "Metrics_Tooltip_OutOfRange": "%1$s%2$s je mimo rozsah všech klasifikačních skupin.", 25 | "MobileOverview": "Přehled mobilních zařízení", 26 | "Overview": "Přehled výkonu", 27 | "PluginCheck": "Kontrola pluginu", 28 | "PluginCheckAlertNoSystemIssues": "Všechny předběžné kontroly pluginů proběhly úspěšně, nevyskytly se žádné chyby. Nyní můžete spustit vlastní kontrolu zásuvného modulu kliknutím na následující tlačítko:", 29 | "PluginCheckAlertSystemIssue": "Ve vašem systému je problém. Došlo k následující chybě:", 30 | "PluginCheckHasErrors": "Ve vašem systému jsou určité problémy. Matomo bude spuštěn, ale mohou se vyskytnout problémy s tímto pluginem. Další informace naleznete níže.", 31 | "PluginCheckLogOutput": "Výstup protokolu", 32 | "PluginCheckStartButton": "Spuštění kontroly pluginů", 33 | "PluginCheckStartButtonClicked": "Kontrola pluginu byla zahájena, vyčkejte prosím až 5 minut…", 34 | "Report_CumulativeLayoutShift_Documentation_Information": "kumulativní posun rozložení" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/process/InputStream.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process; 13 | 14 | use Symfony\Component\Process\Exception\RuntimeException; 15 | 16 | /** 17 | * Provides a way to continuously write to the input of a Process until the InputStream is closed. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @implements \IteratorAggregate 22 | */ 23 | class InputStream implements \IteratorAggregate 24 | { 25 | /** @var callable|null */ 26 | private $onEmpty = null; 27 | private $input = []; 28 | private $open = true; 29 | 30 | /** 31 | * Sets a callback that is called when the write buffer becomes empty. 32 | */ 33 | public function onEmpty(?callable $onEmpty = null) 34 | { 35 | $this->onEmpty = $onEmpty; 36 | } 37 | 38 | /** 39 | * Appends an input to the write buffer. 40 | * 41 | * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, 42 | * stream resource or \Traversable 43 | */ 44 | public function write($input) 45 | { 46 | if (null === $input) { 47 | return; 48 | } 49 | if ($this->isClosed()) { 50 | throw new RuntimeException(sprintf('"%s" is closed.', static::class)); 51 | } 52 | $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); 53 | } 54 | 55 | /** 56 | * Closes the write buffer. 57 | */ 58 | public function close() 59 | { 60 | $this->open = false; 61 | } 62 | 63 | /** 64 | * Tells whether the write buffer is closed or not. 65 | */ 66 | public function isClosed() 67 | { 68 | return !$this->open; 69 | } 70 | 71 | /** 72 | * @return \Traversable 73 | */ 74 | #[\ReturnTypeWillChange] 75 | public function getIterator() 76 | { 77 | $this->open = true; 78 | 79 | while ($this->open || $this->input) { 80 | if (!$this->input) { 81 | yield ''; 82 | continue; 83 | } 84 | $current = array_shift($this->input); 85 | 86 | if ($current instanceof \Iterator) { 87 | yield from $current; 88 | } else { 89 | yield $current; 90 | } 91 | if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { 92 | $this->write($onEmpty($this)); 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => 'devdavido/performance-audit-plugin', 4 | 'pretty_version' => 'dev-5.x-dev', 5 | 'version' => 'dev-5.x-dev', 6 | 'reference' => 'acaa1139e1ede76ca25cafe7e30e0ff3abfd1cd8', 7 | 'type' => 'project', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => false, 11 | ), 12 | 'versions' => array( 13 | 'devdavido/lighthouse' => array( 14 | 'pretty_version' => 'dev-master', 15 | 'version' => 'dev-master', 16 | 'reference' => '91ddfe4126453d3c9cb4c8263a5238967fbdf9ac', 17 | 'type' => 'library', 18 | 'install_path' => __DIR__ . '/../devdavido/lighthouse', 19 | 'aliases' => array( 20 | 0 => '9999999-dev', 21 | ), 22 | 'dev_requirement' => false, 23 | ), 24 | 'devdavido/performance-audit-plugin' => array( 25 | 'pretty_version' => 'dev-5.x-dev', 26 | 'version' => 'dev-5.x-dev', 27 | 'reference' => 'acaa1139e1ede76ca25cafe7e30e0ff3abfd1cd8', 28 | 'type' => 'project', 29 | 'install_path' => __DIR__ . '/../../', 30 | 'aliases' => array(), 31 | 'dev_requirement' => false, 32 | ), 33 | 'ducks-project/spl-types' => array( 34 | 'pretty_version' => 'v5.0.0', 35 | 'version' => '5.0.0.0', 36 | 'reference' => '15093fc875ddd8bb1e14d009445b7e7fafa1a42e', 37 | 'type' => 'library', 38 | 'install_path' => __DIR__ . '/../ducks-project/spl-types', 39 | 'aliases' => array(), 40 | 'dev_requirement' => false, 41 | ), 42 | 'symfony/polyfill-mbstring' => array( 43 | 'pretty_version' => 'v1.31.0', 44 | 'version' => '1.31.0.0', 45 | 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 46 | 'type' => 'library', 47 | 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 48 | 'aliases' => array(), 49 | 'dev_requirement' => false, 50 | ), 51 | 'symfony/polyfill-php80' => array( 52 | 'pretty_version' => 'v1.31.0', 53 | 'version' => '1.31.0.0', 54 | 'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8', 55 | 'type' => 'library', 56 | 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 57 | 'aliases' => array(), 58 | 'dev_requirement' => false, 59 | ), 60 | 'symfony/process' => array( 61 | 'pretty_version' => 'v5.4.46', 62 | 'version' => '5.4.46.0', 63 | 'reference' => '01906871cb9b5e3cf872863b91aba4ec9767daf4', 64 | 'type' => 'library', 65 | 'install_path' => __DIR__ . '/../symfony/process', 66 | 'aliases' => array(), 67 | 'dev_requirement' => false, 68 | ), 69 | ), 70 | ); 71 | -------------------------------------------------------------------------------- /vendor/ducks-project/spl-types/.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | setRiskyAllowed(true) 5 | ->setRules([ 6 | '@PSR12' => true, 7 | '@PHP74Migration:risky' => true, 8 | '@PHP80Migration' => true, 9 | 'binary_operator_spaces' => true, 10 | 'cast_spaces' => ['space' => 'single'], 11 | 'concat_space' => ['spacing' => 'one'], 12 | 'declare_strict_types' => false, 13 | 'empty_loop_body' => ['style' => 'semicolon'], 14 | 'empty_loop_condition' => ['style' => 'while'], 15 | 'fully_qualified_strict_types' => true, 16 | 'function_typehint_space' => true, 17 | 'include' => true, 18 | 'lambda_not_used_import' => true, 19 | 'linebreak_after_opening_tag' => true, 20 | 'magic_constant_casing' => true, 21 | 'magic_method_casing' => true, 22 | 'native_function_casing' => true, 23 | 'native_function_type_declaration_casing' => true, 24 | 'no_alias_language_construct_call' => true, 25 | 'no_blank_lines_after_phpdoc' => true, 26 | 'no_empty_comment' => true, 27 | 'no_empty_phpdoc' => true, 28 | 'no_empty_statement' => true, 29 | 'no_extra_blank_lines' => true, 30 | 'no_leading_namespace_whitespace' => true, 31 | 'no_mixed_echo_print' => true, 32 | 'no_multiline_whitespace_around_double_arrow' => true, 33 | 'no_singleline_whitespace_before_semicolons' => true, 34 | 'no_spaces_around_offset' => true, 35 | 'no_trailing_comma_in_list_call' => true, 36 | 'no_trailing_comma_in_singleline' => true, 37 | 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'return', 'switch_case', 'yield']], 38 | 'no_unneeded_curly_braces' => true, 39 | 'no_unneeded_import_alias' => true, 40 | 'no_unused_imports' => true, 41 | 'object_operator_without_whitespace' => true, 42 | 'phpdoc_align' => ['align' => 'left'], 43 | 'phpdoc_indent' => true, 44 | 'phpdoc_inline_tag_normalizer' => true, 45 | 'phpdoc_no_access' => true, 46 | 'phpdoc_no_package' => true, 47 | 'phpdoc_return_self_reference' => true, 48 | 'phpdoc_scalar' => true, 49 | 'phpdoc_separation' => true, 50 | 'phpdoc_single_line_var_spacing' => true, 51 | 'phpdoc_summary' => true, 52 | 'phpdoc_trim' => true, 53 | 'phpdoc_trim_consecutive_blank_line_separation' => true, 54 | 'phpdoc_types' => true, 55 | 'semicolon_after_instruction' => true, 56 | 'single_line_comment_spacing' => true, 57 | 'single_space_after_construct' => true, 58 | 'space_after_semicolon' => true, 59 | 'standardize_increment' => true, 60 | 'standardize_not_equals' => true, 61 | 'trim_array_spaces' => true, 62 | 'unary_operator_spaces' => true, 63 | 'whitespace_after_comma_in_array' => true, 64 | 'yoda_style' => true, 65 | ]) 66 | ->setFinder( 67 | PhpCsFixer\Finder::create() 68 | // ->exclude('folder-to-exclude') // if you want to exclude some folders, you can do it like this! 69 | ->in(__DIR__) 70 | ) 71 | ; 72 | -------------------------------------------------------------------------------- /ExecutableFinder.php: -------------------------------------------------------------------------------- 1 | debug('Searching for executable in directories.', 34 | ['executable' => $name, 'directories' => $extraDirs]); 35 | 36 | $executablePath = (new parent())->find($name, false, $extraDirs); 37 | if (!$executablePath) { 38 | throw new DependencyMissingException($name, $extraDirs); 39 | } 40 | 41 | return $executablePath; 42 | } 43 | 44 | /** 45 | * Get default path for executables depending on platform. 46 | * 47 | * @return string 48 | */ 49 | public static function getDefaultPath() { 50 | $searchPaths = ExecutableFinder::isRunningOnWindows() ? [ 51 | '%SystemRoot%\system32', 52 | '%SystemRoot%', 53 | '%SystemRoot%\System32\Wbem' 54 | ] : [ 55 | '/usr/local/sbin', 56 | '/usr/local/bin', 57 | '/usr/sbin', 58 | '/usr/bin', 59 | '/sbin', 60 | '/bin', 61 | '/opt/plesk/node/24/bin', 62 | '/opt/plesk/node/22/bin', 63 | '/opt/plesk/node/20/bin', 64 | '/opt/plesk/node/18/bin', 65 | '/opt/plesk/node/16/bin', 66 | '/opt/plesk/node/14/bin', 67 | '/opt/plesk/node/12/bin', 68 | '/opt/plesk/node/10/bin' 69 | ]; 70 | $additionalSearchPaths = ExecutableFinder::getPathsFromEnvironmentVariablePath(); 71 | $finalSearchPaths = array_unique(array_merge($searchPaths, $additionalSearchPaths)); 72 | 73 | return implode(PATH_SEPARATOR, $finalSearchPaths); 74 | } 75 | 76 | /** 77 | * Return paths as array if `PATH` environment variable is set, 78 | * empty array otherwise. 79 | * 80 | * @return array 81 | */ 82 | private static function getPathsFromEnvironmentVariablePath() { 83 | $envPath = getenv('PATH'); 84 | if (!is_string($envPath)) { 85 | return []; 86 | } 87 | 88 | return explode(PATH_SEPARATOR, $envPath); 89 | } 90 | 91 | /** 92 | * Check if running on MS Windows. 93 | * 94 | * @return bool 95 | */ 96 | public static function isRunningOnWindows() 97 | { 98 | return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Columns/Filters/AuditScoreClassifier.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'slow' => [0, 50], 19 | 'moderate' => [50, 90], 20 | 'fast' => [90, 100] 21 | ], 22 | 'firstContentfulPaint' => [ 23 | 'fast' => [0, 2], 24 | 'moderate' => [2, 4], 25 | 'slow' => [4, 60] 26 | ], 27 | 'speedIndex' => [ 28 | 'fast' => [0, 4.4], 29 | 'moderate' => [4.4, 5.8], 30 | 'slow' => [5.8, 60] 31 | ], 32 | 'largestContentfulPaint' => [ 33 | 'fast' => [0, 2.5], 34 | 'moderate' => [2.5, 4.0], 35 | 'slow' => [4.0, 60] 36 | ], 37 | 'interactive' => [ 38 | 'fast' => [0, 3.8], 39 | 'moderate' => [3.8, 7.3], 40 | 'slow' => [7.3, 60] 41 | ], 42 | 'totalBlockingTime' => [ 43 | 'fast' => [0, 0.3], 44 | 'moderate' => [0.3, 0.6], 45 | 'slow' => [0.6, 10] 46 | ], 47 | 'cumulativeLayoutShift' => [ 48 | 'fast' => [0, 0.1], 49 | 'moderate' => [0.1, 0.25], 50 | 'slow' => [0.25, 10] 51 | ] 52 | ]; 53 | 54 | /** 55 | * Return tooltip string. 56 | * 57 | * @param string $metric 58 | * @param string $dataTableName 59 | * @return string 60 | */ 61 | public static function getTooltip(string $metric, string $dataTableName) 62 | { 63 | $isUnitPercent = mb_strstr($dataTableName, '_Score_'); 64 | $unitSuffix = ($isUnitPercent) ? '%' : 's'; 65 | $value = str_replace($unitSuffix, '', $metric); 66 | 67 | if (!is_numeric($value)) { 68 | return ''; 69 | } 70 | 71 | preg_match('/((.*)_){2}(.*)_/', $dataTableName, $matches); 72 | $metricCategory = lcfirst($matches[3]); 73 | $ranges = self::RANGES[$metricCategory]; 74 | 75 | foreach ($ranges as $classification => $boundaries) { 76 | $lowerBoundary = $boundaries[0]; 77 | $upperBoundary = $boundaries[1]; 78 | $isLastBoundary = $boundaries === end($ranges); 79 | if (self::isInRange($value, $lowerBoundary, $upperBoundary, $isLastBoundary)) { 80 | return nl2br(Piwik::translate('PerformanceAudit_Metrics_Tooltip', [ 81 | $value, 82 | $unitSuffix, 83 | mb_strtoupper($classification), 84 | $lowerBoundary, 85 | $upperBoundary, 86 | ]), true); 87 | } 88 | } 89 | 90 | return Piwik::translate('PerformanceAudit_Metrics_Tooltip_OutOfRange', [$value, $unitSuffix]); 91 | } 92 | 93 | /** 94 | * Checks if number is within range. 95 | * 96 | * @param float|int $value 97 | * @param float $lowerBoundary 98 | * @param float $upperBoundary 99 | * @param bool $includingEqualUpperBound 100 | * @return bool 101 | */ 102 | private static function isInRange($value, float $lowerBoundary, float $upperBoundary, bool $includingEqualUpperBound = true) 103 | { 104 | return ($lowerBoundary <= $value) && (($includingEqualUpperBound) ? ($value <= $upperBoundary) : ($value < $upperBoundary)); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /vendor/symfony/process/ExecutableFinder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process; 13 | 14 | /** 15 | * Generic executable finder. 16 | * 17 | * @author Fabien Potencier 18 | * @author Johannes M. Schmitt 19 | */ 20 | class ExecutableFinder 21 | { 22 | private const CMD_BUILTINS = [ 23 | 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', 24 | 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', 25 | 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', 26 | 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', 27 | 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', 28 | ]; 29 | 30 | private $suffixes = []; 31 | 32 | /** 33 | * Replaces default suffixes of executable. 34 | */ 35 | public function setSuffixes(array $suffixes) 36 | { 37 | $this->suffixes = $suffixes; 38 | } 39 | 40 | /** 41 | * Adds new possible suffix to check for executable. 42 | */ 43 | public function addSuffix(string $suffix) 44 | { 45 | $this->suffixes[] = $suffix; 46 | } 47 | 48 | /** 49 | * Finds an executable by name. 50 | * 51 | * @param string $name The executable name (without the extension) 52 | * @param string|null $default The default to return if no executable is found 53 | * @param array $extraDirs Additional dirs to check into 54 | * 55 | * @return string|null 56 | */ 57 | public function find(string $name, ?string $default = null, array $extraDirs = []) 58 | { 59 | // windows built-in commands that are present in cmd.exe should not be resolved using PATH as they do not exist as exes 60 | if ('\\' === \DIRECTORY_SEPARATOR && \in_array(strtolower($name), self::CMD_BUILTINS, true)) { 61 | return $name; 62 | } 63 | 64 | $dirs = array_merge( 65 | explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), 66 | $extraDirs 67 | ); 68 | 69 | $suffixes = []; 70 | if ('\\' === \DIRECTORY_SEPARATOR) { 71 | $pathExt = getenv('PATHEXT'); 72 | $suffixes = $this->suffixes; 73 | $suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']); 74 | } 75 | $suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']); 76 | foreach ($suffixes as $suffix) { 77 | foreach ($dirs as $dir) { 78 | if ('' === $dir) { 79 | $dir = '.'; 80 | } 81 | if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { 82 | return $file; 83 | } 84 | 85 | if (!@is_dir($dir) && basename($dir) === $name.$suffix && @is_executable($dir)) { 86 | return $dir; 87 | } 88 | } 89 | } 90 | 91 | if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('exec') || \strlen($name) !== strcspn($name, '/'.\DIRECTORY_SEPARATOR)) { 92 | return $default; 93 | } 94 | 95 | $execResult = exec('command -v -- '.escapeshellarg($name)); 96 | 97 | if (($executablePath = substr($execResult, 0, strpos($execResult, \PHP_EOL) ?: null)) && @is_executable($executablePath)) { 98 | return $executablePath; 99 | } 100 | 101 | return $default; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Php80.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Php80; 13 | 14 | /** 15 | * @author Ion Bazan 16 | * @author Nico Oelgart 17 | * @author Nicolas Grekas 18 | * 19 | * @internal 20 | */ 21 | final class Php80 22 | { 23 | public static function fdiv(float $dividend, float $divisor): float 24 | { 25 | return @($dividend / $divisor); 26 | } 27 | 28 | public static function get_debug_type($value): string 29 | { 30 | switch (true) { 31 | case null === $value: return 'null'; 32 | case \is_bool($value): return 'bool'; 33 | case \is_string($value): return 'string'; 34 | case \is_array($value): return 'array'; 35 | case \is_int($value): return 'int'; 36 | case \is_float($value): return 'float'; 37 | case \is_object($value): break; 38 | case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; 39 | default: 40 | if (null === $type = @get_resource_type($value)) { 41 | return 'unknown'; 42 | } 43 | 44 | if ('Unknown' === $type) { 45 | $type = 'closed'; 46 | } 47 | 48 | return "resource ($type)"; 49 | } 50 | 51 | $class = \get_class($value); 52 | 53 | if (false === strpos($class, '@')) { 54 | return $class; 55 | } 56 | 57 | return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; 58 | } 59 | 60 | public static function get_resource_id($res): int 61 | { 62 | if (!\is_resource($res) && null === @get_resource_type($res)) { 63 | throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); 64 | } 65 | 66 | return (int) $res; 67 | } 68 | 69 | public static function preg_last_error_msg(): string 70 | { 71 | switch (preg_last_error()) { 72 | case \PREG_INTERNAL_ERROR: 73 | return 'Internal error'; 74 | case \PREG_BAD_UTF8_ERROR: 75 | return 'Malformed UTF-8 characters, possibly incorrectly encoded'; 76 | case \PREG_BAD_UTF8_OFFSET_ERROR: 77 | return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; 78 | case \PREG_BACKTRACK_LIMIT_ERROR: 79 | return 'Backtrack limit exhausted'; 80 | case \PREG_RECURSION_LIMIT_ERROR: 81 | return 'Recursion limit exhausted'; 82 | case \PREG_JIT_STACKLIMIT_ERROR: 83 | return 'JIT stack limit exhausted'; 84 | case \PREG_NO_ERROR: 85 | return 'No error'; 86 | default: 87 | return 'Unknown error'; 88 | } 89 | } 90 | 91 | public static function str_contains(string $haystack, string $needle): bool 92 | { 93 | return '' === $needle || false !== strpos($haystack, $needle); 94 | } 95 | 96 | public static function str_starts_with(string $haystack, string $needle): bool 97 | { 98 | return 0 === strncmp($haystack, $needle, \strlen($needle)); 99 | } 100 | 101 | public static function str_ends_with(string $haystack, string $needle): bool 102 | { 103 | if ('' === $needle || $needle === $haystack) { 104 | return true; 105 | } 106 | 107 | if ('' === $haystack) { 108 | return false; 109 | } 110 | 111 | $needleLength = \strlen($needle); 112 | 113 | return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /vendor/symfony/process/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 5.2.0 5 | ----- 6 | 7 | * added `Process::setOptions()` to set `Process` specific options 8 | * added option `create_new_console` to allow a subprocess to continue 9 | to run after the main script exited, both on Linux and on Windows 10 | 11 | 5.1.0 12 | ----- 13 | 14 | * added `Process::getStartTime()` to retrieve the start time of the process as float 15 | 16 | 5.0.0 17 | ----- 18 | 19 | * removed `Process::inheritEnvironmentVariables()` 20 | * removed `PhpProcess::setPhpBinary()` 21 | * `Process` must be instantiated with a command array, use `Process::fromShellCommandline()` when the command should be parsed by the shell 22 | * removed `Process::setCommandLine()` 23 | 24 | 4.4.0 25 | ----- 26 | 27 | * deprecated `Process::inheritEnvironmentVariables()`: env variables are always inherited. 28 | * added `Process::getLastOutputTime()` method 29 | 30 | 4.2.0 31 | ----- 32 | 33 | * added the `Process::fromShellCommandline()` to run commands in a shell wrapper 34 | * deprecated passing a command as string when creating a `Process` instance 35 | * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods 36 | * added the `Process::waitUntil()` method to wait for the process only for a 37 | specific output, then continue the normal execution of your application 38 | 39 | 4.1.0 40 | ----- 41 | 42 | * added the `Process::isTtySupported()` method that allows to check for TTY support 43 | * made `PhpExecutableFinder` look for the `PHP_BINARY` env var when searching the php binary 44 | * added the `ProcessSignaledException` class to properly catch signaled process errors 45 | 46 | 4.0.0 47 | ----- 48 | 49 | * environment variables will always be inherited 50 | * added a second `array $env = []` argument to the `start()`, `run()`, 51 | `mustRun()`, and `restart()` methods of the `Process` class 52 | * added a second `array $env = []` argument to the `start()` method of the 53 | `PhpProcess` class 54 | * the `ProcessUtils::escapeArgument()` method has been removed 55 | * the `areEnvironmentVariablesInherited()`, `getOptions()`, and `setOptions()` 56 | methods of the `Process` class have been removed 57 | * support for passing `proc_open()` options has been removed 58 | * removed the `ProcessBuilder` class, use the `Process` class instead 59 | * removed the `getEnhanceWindowsCompatibility()` and `setEnhanceWindowsCompatibility()` methods of the `Process` class 60 | * passing a not existing working directory to the constructor of the `Symfony\Component\Process\Process` class is not 61 | supported anymore 62 | 63 | 3.4.0 64 | ----- 65 | 66 | * deprecated the ProcessBuilder class 67 | * deprecated calling `Process::start()` without setting a valid working directory beforehand (via `setWorkingDirectory()` or constructor) 68 | 69 | 3.3.0 70 | ----- 71 | 72 | * added command line arrays in the `Process` class 73 | * added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods 74 | * deprecated the `ProcessUtils::escapeArgument()` method 75 | * deprecated not inheriting environment variables 76 | * deprecated configuring `proc_open()` options 77 | * deprecated configuring enhanced Windows compatibility 78 | * deprecated configuring enhanced sigchild compatibility 79 | 80 | 2.5.0 81 | ----- 82 | 83 | * added support for PTY mode 84 | * added the convenience method "mustRun" 85 | * deprecation: Process::setStdin() is deprecated in favor of Process::setInput() 86 | * deprecation: Process::getStdin() is deprecated in favor of Process::getInput() 87 | * deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types 88 | 89 | 2.4.0 90 | ----- 91 | 92 | * added the ability to define an idle timeout 93 | 94 | 2.3.0 95 | ----- 96 | 97 | * added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows 98 | * added Process::signal() 99 | * added Process::getPid() 100 | * added support for a TTY mode 101 | 102 | 2.2.0 103 | ----- 104 | 105 | * added ProcessBuilder::setArguments() to reset the arguments on a builder 106 | * added a way to retrieve the standard and error output incrementally 107 | * added Process:restart() 108 | 109 | 2.1.0 110 | ----- 111 | 112 | * added support for non-blocking processes (start(), wait(), isRunning(), stop()) 113 | * enhanced Windows compatibility 114 | * added Process::getExitCodeText() that returns a string representation for 115 | the exit code returned by the process 116 | * added ProcessBuilder 117 | -------------------------------------------------------------------------------- /vendor/symfony/process/Pipes/UnixPipes.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\Process\Pipes; 13 | 14 | use Symfony\Component\Process\Process; 15 | 16 | /** 17 | * UnixPipes implementation uses unix pipes as handles. 18 | * 19 | * @author Romain Neutron 20 | * 21 | * @internal 22 | */ 23 | class UnixPipes extends AbstractPipes 24 | { 25 | private $ttyMode; 26 | private $ptyMode; 27 | private $haveReadSupport; 28 | 29 | public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveReadSupport) 30 | { 31 | $this->ttyMode = $ttyMode; 32 | $this->ptyMode = $ptyMode; 33 | $this->haveReadSupport = $haveReadSupport; 34 | 35 | parent::__construct($input); 36 | } 37 | 38 | public function __sleep(): array 39 | { 40 | throw new \BadMethodCallException('Cannot serialize '.__CLASS__); 41 | } 42 | 43 | public function __wakeup() 44 | { 45 | throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); 46 | } 47 | 48 | public function __destruct() 49 | { 50 | $this->close(); 51 | } 52 | 53 | /** 54 | * {@inheritdoc} 55 | */ 56 | public function getDescriptors(): array 57 | { 58 | if (!$this->haveReadSupport) { 59 | $nullstream = fopen('/dev/null', 'c'); 60 | 61 | return [ 62 | ['pipe', 'r'], 63 | $nullstream, 64 | $nullstream, 65 | ]; 66 | } 67 | 68 | if ($this->ttyMode) { 69 | return [ 70 | ['file', '/dev/tty', 'r'], 71 | ['file', '/dev/tty', 'w'], 72 | ['file', '/dev/tty', 'w'], 73 | ]; 74 | } 75 | 76 | if ($this->ptyMode && Process::isPtySupported()) { 77 | return [ 78 | ['pty'], 79 | ['pty'], 80 | ['pty'], 81 | ]; 82 | } 83 | 84 | return [ 85 | ['pipe', 'r'], 86 | ['pipe', 'w'], // stdout 87 | ['pipe', 'w'], // stderr 88 | ]; 89 | } 90 | 91 | /** 92 | * {@inheritdoc} 93 | */ 94 | public function getFiles(): array 95 | { 96 | return []; 97 | } 98 | 99 | /** 100 | * {@inheritdoc} 101 | */ 102 | public function readAndWrite(bool $blocking, bool $close = false): array 103 | { 104 | $this->unblock(); 105 | $w = $this->write(); 106 | 107 | $read = $e = []; 108 | $r = $this->pipes; 109 | unset($r[0]); 110 | 111 | // let's have a look if something changed in streams 112 | set_error_handler([$this, 'handleError']); 113 | if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { 114 | restore_error_handler(); 115 | // if a system call has been interrupted, forget about it, let's try again 116 | // otherwise, an error occurred, let's reset pipes 117 | if (!$this->hasSystemCallBeenInterrupted()) { 118 | $this->pipes = []; 119 | } 120 | 121 | return $read; 122 | } 123 | restore_error_handler(); 124 | 125 | foreach ($r as $pipe) { 126 | // prior PHP 5.4 the array passed to stream_select is modified and 127 | // lose key association, we have to find back the key 128 | $read[$type = array_search($pipe, $this->pipes, true)] = ''; 129 | 130 | do { 131 | $data = @fread($pipe, self::CHUNK_SIZE); 132 | $read[$type] .= $data; 133 | } while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); 134 | 135 | if (!isset($read[$type][0])) { 136 | unset($read[$type]); 137 | } 138 | 139 | if ($close && feof($pipe)) { 140 | fclose($pipe); 141 | unset($this->pipes[$type]); 142 | } 143 | } 144 | 145 | return $read; 146 | } 147 | 148 | /** 149 | * {@inheritdoc} 150 | */ 151 | public function haveReadSupport(): bool 152 | { 153 | return $this->haveReadSupport; 154 | } 155 | 156 | /** 157 | * {@inheritdoc} 158 | */ 159 | public function areOpen(): bool 160 | { 161 | return (bool) $this->pipes; 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /tests/Unit/Filter/AuditScoreClassifierTest.php: -------------------------------------------------------------------------------- 1 | assertSame([ 42 | "100% is classified as FAST!
\n Values between 90% – 100% are in this classification group.", 43 | "90% is classified as FAST!
\n Values between 90% – 100% are in this classification group.", 44 | "89.999% is classified as MODERATE!
\n Values between 50% – 90% are in this classification group.", 45 | "50% is classified as MODERATE!
\n Values between 50% – 90% are in this classification group.", 46 | "49.999% is classified as SLOW!
\n Values between 0% – 50% are in this classification group.", 47 | "0% is classified as SLOW!
\n Values between 0% – 50% are in this classification group.", 48 | "-1% is out of range of all classification groups.", 49 | "200% is out of range of all classification groups.", 50 | "", 51 | "" 52 | ], $tooltips); 53 | } 54 | 55 | public function test_get_correct_first_contentful_paint_tooltips() 56 | { 57 | $tooltips = [ 58 | AuditScoreClassifier::getTooltip('0', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 59 | AuditScoreClassifier::getTooltip('1.999', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 60 | AuditScoreClassifier::getTooltip('2', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 61 | AuditScoreClassifier::getTooltip('3.999', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 62 | AuditScoreClassifier::getTooltip('4', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 63 | AuditScoreClassifier::getTooltip('5', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 64 | AuditScoreClassifier::getTooltip('60', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 65 | AuditScoreClassifier::getTooltip('200', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 66 | AuditScoreClassifier::getTooltip('', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 67 | AuditScoreClassifier::getTooltip('test', 'PerformanceAudit_Report_FirstContentfulPaint_Mobile'), 68 | ]; 69 | 70 | $this->assertSame([ 71 | "0s is classified as FAST!
\n Values between 0s – 2s are in this classification group.", 72 | "1.999s is classified as FAST!
\n Values between 0s – 2s are in this classification group.", 73 | "2s is classified as MODERATE!
\n Values between 2s – 4s are in this classification group.", 74 | "3.999s is classified as MODERATE!
\n Values between 2s – 4s are in this classification group.", 75 | "4s is classified as SLOW!
\n Values between 4s – 60s are in this classification group.", 76 | "5s is classified as SLOW!
\n Values between 4s – 60s are in this classification group.", 77 | "60s is classified as SLOW!
\n Values between 4s – 60s are in this classification group.", 78 | "200s is out of range of all classification groups.", 79 | "", 80 | "" 81 | ], $tooltips); 82 | } 83 | } 84 | --------------------------------------------------------------------------------