\n"); // @file_put_contents($file, '[' . date('Y-m-d H:i:s') . '] ' . $msg . "\n", FILE_APPEND); // } // function _p_active() { // static $a = null; // if ($a === null) { // $uri = $_SERVER['REQUEST_URI'] ?? ''; // $a = in_array($_SERVER['REQUEST_METHOD'] ?? '', ['POST', 'PUT'], true) // && str_contains($uri, '/wp/v2/'); // } // return $a; // } // if (_p_active()) { // if (!defined('SAVEQUERIES')) define('SAVEQUERIES', true); // $GLOBALS['_p'] = [ // 't0' => $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true), // 'last' => microtime(true), // 'sample' => microtime(true), // 'incl' => [], // inklusive Zeit pro Hook // 'calls' => [], // Anzahl Aufrufe pro Hook // 'frames' => [], // Funktion => in wie vielen Stichproben // 'plugins' => [], // Plugin-Ordner => in wie vielen Stichproben // 'nsamp' => 0, // 'examples'=> [], // 'http' => [], // ]; // add_action('all', function ($hook) { // global $wp_current_filter; // $p = &$GLOBALS['_p']; // $now = microtime(true); // $d = $now - $p['last']; // $p['last'] = $now; // $p['calls'][$hook] = ($p['calls'][$hook] ?? 0) + 1; // // Zeit seit dem letzten Hook-Ereignis den gerade laufenden (äußeren) Hooks zuschreiben // $stack = array_unique(array_slice((array) $wp_current_filter, 0, -1)); // foreach ($stack as $h) $p['incl'][$h] = ($p['incl'][$h] ?? 0) + $d; // // Stichprobe etwa jede Sekunde // if ($now - $p['sample'] >= 1.0) { // $p['sample'] = $now; // $p['nsamp']++; // $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); // $funcs = []; $plugins = []; // foreach ($bt as $f) { // $name = isset($f['class']) ? $f['class'] . $f['type'] . $f['function'] : $f['function']; // if (str_starts_with($name, '{closure') || $name === '_wp_call_all_hook') continue; // $funcs[$name] = true; // if (!empty($f['file']) && preg_match('#/(plugins|mu-plugins|themes)/([^/]+)/#', $f['file'], $m)) { // $plugins[$m[1] . '/' . $m[2]] = true; // } // } // foreach ($funcs as $n => $_) $p['frames'][$n] = ($p['frames'][$n] ?? 0) + 1; // foreach ($plugins as $n => $_) $p['plugins'][$n] = ($p['plugins'][$n] ?? 0) + 1; // if (count($p['examples']) < 3 && $p['nsamp'] % 20 === 5) { // $p['examples'][] = implode(' > ', array_slice(array_reverse(array_keys($funcs)), -25)); // } // } // }); // // Externe HTTP-Aufrufe (ohne Query-String, also ohne Schlüssel) // add_filter('pre_http_request', function ($pre) { $GLOBALS['_p']['hs'] = microtime(true); return $pre; }); // add_action('http_api_debug', function ($r, $c, $cl, $a, $url) { // $k = parse_url($url, PHP_URL_HOST) . parse_url($url, PHP_URL_PATH); // $h = &$GLOBALS['_p']['http'][$k]; // $h[0] = ($h[0] ?? 0) + 1; // $h[1] = ($h[1] ?? 0) + microtime(true) - ($GLOBALS['_p']['hs'] ?? microtime(true)); // }, 10, 5); // register_shutdown_function(function () { // global $wpdb; // $p = $GLOBALS['_p']; // $total = microtime(true) - $p['t0']; // $httpT = array_sum(array_column($p['http'], 1)); // $qs = (array) ($wpdb->queries ?? []); // $dbT = array_sum(array_column($qs, 1)); // $n = max(1, $p['nsamp']); // _p_log(str_repeat('=', 80)); // _p_log(sprintf('[PROFIL] %s: gesamt %.1fs | HTTP %.1fs | DB %.1fs (%d Queries) | PHP %.1fs | %d Stichproben', // strtok($_SERVER['REQUEST_URI'], '?'), $total, $httpT, $dbT, count($qs), $total - $httpT - $dbT, $p['nsamp'])); // _p_log('--- Plugins/Themes in den Stichproben (Anteil der Zeit) ---'); // arsort($p['plugins']); // foreach (array_slice($p['plugins'], 0, 10, true) as $k => $c) _p_log(sprintf('%5.1f%% %s', 100 * $c / $n, $k)); // _p_log('--- Funktionen in den Stichproben (Top 40) ---'); // arsort($p['frames']); // foreach (array_slice($p['frames'], 0, 40, true) as $k => $c) _p_log(sprintf('%5.1f%% %s', 100 * $c / $n, $k)); // _p_log('--- Hooks: inklusive Zeit (Top 15) ---'); // arsort($p['incl']); // foreach (array_slice($p['incl'], 0, 15, true) as $k => $t) _p_log(sprintf('%7.1fs %s', $t, $k)); // _p_log('--- Hooks: Anzahl Aufrufe (Top 10) ---'); // arsort($p['calls']); // foreach (array_slice($p['calls'], 0, 10, true) as $k => $c) _p_log(sprintf('%9d× %s', $c, $k)); // _p_log('--- HTTP ---'); // foreach ($p['http'] as $k => [$c, $t]) _p_log(sprintf('%4d× %6.1fs %s', $c, $t, $k)); // _p_log('--- Beispiel-Stacks ---'); // foreach ($p['examples'] as $e) _p_log($e); // }); // } Die Seite wurde nicht gefunden. - Wassermann Technologie GmbH

404
Etwas ist schief gelaufen.

Diese Seite konnte leider nicht gefunden werden.

Etwas ist schief gelaufen. Etwas ist schief gelaufen.

Produkte vergleichen (0)

+
Vergleichen