1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 06:57:53 +00:00
Files
matomo/plugins/SEO/config/ui-test.php
Stefan Giehl 2409cb1709 Remove Google Indexed Pages from SEO widget (#23052)
* Remove Google Indexed Pages from SEO widget

* updates expected UI test file

---------

Co-authored-by: caddoo <matthew.caddoo@gmail.com>
2025-02-24 10:23:15 +13:00

19 خطوط
1.1 KiB
PHP

<?php
return [
'observers.global' => \Piwik\DI::add([
['Http.sendHttpRequest',\Piwik\DI::value(function ($aUrl, $httpEventParams, &$response, &$status, &$headers) {
// fake responses for SEO metric requests
if (strpos($aUrl, 'www.bing.com')) {
$response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/bing_response.html');
} elseif (strpos($aUrl, 'archive.org')) {
$response = '{"timestamp": "19900101", "url": "matomo.org", "archived_snapshots": {"closest": {"timestamp": "20180109155124", "available": true, "status": "200", "url": "http://web.archive.org/web/20180109155124/https://matomo.org"}}}';
} elseif (strpos($aUrl, 'www.who.is')) {
$response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/whois_response.html');
} elseif (strpos($aUrl, 'www.whois.com')) {
$response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/whoiscom_response.html');
}
})]
]),
];