rtCamp\WP\Nginx\Helper::add_timestamps PHP Method

add_timestamps() public method

public add_timestamps ( )
        function add_timestamps()
        {
            if ($this->options['enable_purge'] != 1) {
                return;
            }
            if ($this->options['enable_stamp'] != 1) {
                return;
            }
            if (is_admin()) {
                return;
            }
            foreach (headers_list() as $header) {
                list($key, $value) = explode(':', $header, 2);
                if ($key == 'Content-Type' && strpos(trim($value), 'text/html') !== 0) {
                    return;
                }
                if ($key == 'Content-Type') {
                    break;
                }
            }
            if (defined('DOING_AJAX') && DOING_AJAX) {
                return;
            }
            if (defined('DOING_CRON') && DOING_CRON) {
                return;
            }
            if (defined('WP_CLI') && WP_CLI) {
                return;
            }
            $timestamps = "\n<!--" . "Cached using Nginx-Helper on " . current_time('mysql') . ". " . "It took " . get_num_queries() . " queries executed in " . timer_stop() . " seconds." . "-->\n" . "<!--Visit http://wordpress.org/extend/plugins/nginx-helper/faq/ for more details-->";
            echo $timestamps;
        }