# wp-optimize/4.7.0/templates/cache/gzip-compression-control-panel.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 4.7.0. 81 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/templates/cache/gzip-compression-control-panel.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/4.7.0/raw/templates/cache/gzip-compression-control-panel.php
- Modified: 2026-09-21T13:29:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/templates/cache/gzip-compression-control-panel.php#L10-L20`.

```php
<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>

<div class="wpo_shade hidden">
	<div class="wpo_shade_inner">
		<span class="dashicons dashicons-update-alt wpo-rotate"></span>
	</div>
</div>
<?php
if (is_wp_error($wpo_gzip_headers_information)) {
	?>
	<div class="notice notice-error">
		<p>
			<b><?php esc_html_e('Error: Unable to Check GZIP Compression.', 'wp-optimize'); ?></b>
			<?php esc_html_e('We encountered a problem while checking if GZIP compression is enabled.', 'wp-optimize'); ?>
		</p>
		<p><?php echo wp_kses_post($wpo_gzip_headers_information->get_error_message()); ?></p>
	</div>
	<?php
} else {
	?>
	<?php if ($wpo_gzip_compression_enabled && !is_wp_error($wpo_gzip_compression_enabled) && !$wpo_gzip_compression_enabled_by_wpo) : ?>
		<div class="wpo-fieldgroup wpo-gzip-already-enabled">
			<p><span class="dashicons dashicons-yes"></span> 
			<?php if (is_array($wpo_gzip_headers_information) && 'brotli' === $wpo_gzip_headers_information['compression']) { ?>
				<?php esc_html_e('Your server uses Brotli compression instead of Gzip, which is good.', 'wp-optimize'); ?>
			<?php } else { ?>
				<?php esc_html_e('Gzip compression is already enabled.', 'wp-optimize'); ?>
			<?php } ?>
			<?php if ($is_cloudflare_site) { ?>
				<em><?php esc_html_e('It seems to be handled by Cloudflare.', 'wp-optimize'); ?></em>
			<?php } ?>

			</p>
		</div>
	<?php else : ?>
		<div class="wpo-fieldgroup">
			<p id="wpo_gzip_compression_status" class="<?php echo esc_attr($class_name); ?>">
				<strong class="wpo-enabled"><?php esc_html_e('Gzip compression is currently ENABLED.', 'wp-optimize'); ?></strong>
				<strong class="wpo-disabled"><?php esc_html_e('Gzip compression is currently DISABLED.', 'wp-optimize'); ?></strong>
				<?php if (!$wp_optimize->is_apache_server() || ($wpo_gzip_compression_enabled && false === $wpo_gzip_compression_settings_added)) : ?>
					<a href="#" class="wpo-refresh-gzip-status" title="<?php esc_attr_e('Press this to see if any changes were made to your Gzip configuration', 'wp-optimize'); ?>"><?php esc_html_e('Check status again', 'wp-optimize'); ?> <img class="wpo_spinner display-none" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="..."></a>
				<?php endif; ?>

				<?php if ($wp_optimize->is_apache_server() && $wpo_gzip_compression_partially_enabled) : ?>
					<div>
					<?php
						// translators: %1$s and %2$s is a list of content types HTML, CSS, JS.
						printf(esc_html__('Gzip is already enabled for %1$s files but you can make loading faster by enabling gzip compression with WP-Optimize for %2$s and other static files', 'wp-optimize'), esc_html(join('/', $wpo_gzip_compression_content_types['enabled'])), esc_html(join(', ', $wpo_gzip_compression_content_types['disabled'])));
					?>
					</div>
				<?php endif; ?>
			</p>
			<br>
			<?php

			// add gzip compression section only if gzip compression disabled or we added cache settings to .htaccess.
			if (is_wp_error($wpo_gzip_compression_enabled) || false === $wpo_gzip_compression_enabled || $wpo_gzip_compression_settings_added) {

				if ($wp_optimize->is_apache_server()) {
					$button_text = $wpo_gzip_compression_settings_added ? __('Disable', 'wp-optimize') : __('Enable', 'wp-optimize');
					?>
					<form>
						<button class="button-primary" type="button"
							id="wp_optimize_gzip_compression_enable" data-enable="<?php echo $wpo_gzip_compression_settings_added ? '0' : '1'; ?>"><?php echo esc_html($button_text); ?></button>
							<img class="wpo_spinner display-none" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>"
						width="20" height="20" alt="...">
						<br>
					</form>
				<?php
				} else {
					printf('<a href="%s" target="_blank">%s</a>', esc_url($faq_link), esc_html__('Follow this link to read the article about how to enable Gzip compression with your server software.', 'wp-optimize'));
				}
			}
			?>

		</div>

	<?php endif; ?>

<?php }

```
