%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom495844/wp-content/mu-plugins/object-cache-pro/src/Plugin/templates/widgets/tools/
Upload File :
Create Path :
Current File : /dom495844/wp-content/mu-plugins/object-cache-pro/src/Plugin/templates/widgets/tools/commands.phtml

<?php

global $wp_object_cache;

try {
    $info = $wp_object_cache->connection()->info('commandstats');
} catch (Throwable $th) {
    $error = $th->getMessage();
    $info = false;
}

$stats = [];

if (is_array($info)) {
    foreach ($info as $key => $value) {
        $command = strtoupper(str_replace(['cmdstat_', '|'], ['', ' '], $key));

        $stats[$command] = array_reduce(explode(',', $value), static function ($carry, $item) {
            [$key, $value] = explode('=', $item);
            $carry[$key] = (float) $value;

            return $carry;
        }, [
            'rejected_calls' => 0.0,
            'failed_calls' => 0.0,
        ]);
    }

    uasort($stats, function($a, $b) {
        return $b['usec_per_call'] <=> $a['usec_per_call'];
    });
}

?>

<div class="objectcache:widget objectcache:commands-widget objectcache:flushlog-widget">

    <?php if ($info === false): ?>

        <p class="inset">Unable to retrieve command statistics (<?php echo esc_html($error); ?>).</p>

    <?php elseif (! count($stats)) : ?>

        <p class="inset">No command statistics have been logged, yet.</p>

    <?php else : ?>

        <?php foreach ($stats as $key => $value): ?>

            <details
                data-calls="<?php echo esc_attr($value['calls']); ?>"
                data-rejected="<?php echo esc_attr($value['rejected_calls']); ?>"
                data-failed="<?php echo esc_attr($value['failed_calls']); ?>"
                data-usec="<?php echo esc_attr($value['usec']); ?>"
            >
                <summary>
                    <span class="dashicons dashicons-arrow-right-alt2"></span>
                    <code>
                        <?php echo esc_html($key); ?>
                    </code>
                    <time title="Average CPU time consumed per call">
                        <?php if ($value['usec_per_call'] < 100): ?>
                            <?php echo round($value['usec_per_call'], 0); ?> μs
                        <?php else: ?>
                            <?php echo round($value['usec_per_call'] / 1000, 2); ?> ms
                        <?php endif; ?>
                    </time>
                </summary>

                <ul>
                    <li title="Number of executed calls" data-sort="calls">
                        <span class="dashicons dashicons-controls-play"></span>
                        <time>
                            <?php echo number_format_i18n($value['calls']); ?>
                        </time>
                    </li>
                    <li title="Number of rejected calls" data-sort="rejected">
                        <span class="dashicons dashicons-undo"></span>
                        <time>
                            <?php echo number_format_i18n($value['rejected_calls']); ?>
                        </time>
                    </li>
                    <li title="Number of failed calls" data-sort="failed">
                        <span class="dashicons dashicons-dismiss"></span>
                        <time>
                            <?php echo number_format_i18n($value['failed_calls']); ?>
                        </time>
                    </li>
                    <li title="Total CPU time consumed by the command" data-sort="usec">
                        <span class="dashicons dashicons-clock"></span>
                        <time>
                            <?php if ($value['usec'] < 100): ?>
                                <?php echo round($value['usec'], 0); ?> μs
                            <?php elseif ($value['usec'] < (1000 * 1000)): ?>
                                <?php echo round($value['usec'] / 1000, 2); ?> ms
                            <?php else: ?>
                                <?php echo round($value['usec'] / 1000 / 1000, 2); ?> sec
                            <?php endif; ?>
                        </time>
                    </li>
                </ul>
            </details>
        <?php endforeach; ?>

        <script>
            (function ($) {
                var $widget = $('#objectcache_commandstats');

                if (! $widget.length) {
                    return;
                }

                $widget.find('.handle-actions').prepend(
                    '<button class="handle-reset" data-href="<?php echo esc_url(get_rest_url(null, 'objectcache/v1/commands')); ?>">' +
                    '    <span class="screen-reader-text">Reset</span>' +
                    '    <span class="reset-indicator" aria-hidden="true"></span>' +
                    '</button>'
                );
            })(jQuery);
        </script>

    <?php endif; ?>

</div>

Zerion Mini Shell 1.0
Page not found - Broad Street Financial
[et_pb_section fb_built=”1″ theme_builder_area=”post_content” _builder_version=”4.20.0″ _module_preset=”default”][et_pb_row _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content”][et_pb_column _builder_version=”4.20.0″ _module_preset=”default” type=”4_4″ theme_builder_area=”post_content”][et_pb_text _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content” hover_enabled=”0″ sticky_enabled=”0″]

Page Not Found

Sorry the requested page you are looking for is missing or has been moved.

Please check out our site and see if you can find what you are looking for.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]