PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | templates/cache/gzip-compression.php +18 -67 4.5.2 → 4.7.0 View file →
@@ -12,76 +12,27 @@
12 12 <?php printf('<a href="%s" target="_blank">%s</a>', esc_url($info_link), esc_html__('Follow this link to get more information about Gzip compression.', 'wp-optimize')); ?>
13 13 </span>
14 14 </p>
15 15
16 - <?php
17 - if (is_wp_error($wpo_gzip_headers_information)) {
18 - ?>
19 - <div class="notice notice-error">
20 - <p>
21 - <b><?php esc_html_e('Error: Unable to Check GZIP Compression.', 'wp-optimize'); ?></b>
22 - <?php esc_html_e('We encountered a problem while checking if GZIP compression is enabled.', 'wp-optimize'); ?>
23 - </p>
24 - <p><?php echo wp_kses_post($wpo_gzip_headers_information->get_error_message()); ?></p>
25 - </div>
26 - <?php
27 - } else {
28 - ?>
29 - <?php if ($wpo_gzip_compression_enabled && !is_wp_error($wpo_gzip_compression_enabled) && !$wpo_gzip_compression_enabled_by_wpo) : ?>
30 - <div class="wpo-fieldgroup wpo-gzip-already-enabled">
31 - <p><span class="dashicons dashicons-yes"></span>
32 - <?php if (is_array($wpo_gzip_headers_information) && 'brotli' === $wpo_gzip_headers_information['compression']) { ?>
33 - <?php esc_html_e('Your server uses Brotli compression instead of Gzip, which is good.', 'wp-optimize'); ?>
34 - <?php } else { ?>
35 - <?php esc_html_e('Gzip compression is already enabled.', 'wp-optimize'); ?>
36 - <?php } ?>
37 - <?php if ($is_cloudflare_site) { ?>
38 - <em><?php esc_html_e('It seems to be handled by Cloudflare.', 'wp-optimize'); ?></em>
39 - <?php } ?>
16 + <div id="wpo_gzip_control_panel">
17 + <?php echo wp_kses_post($gzip_compression_control_panel); ?>
18 + </div>
40 19
41 - </p>
42 - </div>
43 - <?php else : ?>
44 - <div class="wpo-fieldgroup">
45 - <p id="wpo_gzip_compression_status" class="<?php echo esc_attr($class_name); ?>">
46 - <strong class="wpo-enabled"><?php esc_html_e('Gzip compression is currently ENABLED.', 'wp-optimize'); ?></strong>
47 - <strong class="wpo-disabled"><?php esc_html_e('Gzip compression is currently DISABLED.', 'wp-optimize'); ?></strong>
48 - <?php if (!$wp_optimize->is_apache_server() || ($wpo_gzip_compression_enabled && false === $wpo_gzip_compression_settings_added)) : ?>
49 - <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>
50 - <?php endif; ?>
51 - </p>
52 - <br>
53 - <?php
20 + <div class="wpo-fieldgroup">
21 + <strong><?php esc_html_e('Gzip compression test', 'wp-optimize'); ?></strong> <span tabindex="0" data-tooltip="<?php esc_attr_e('This section displays the current compression status for different resources such as HTML, CSS, and JS.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
22 + <a href="javascript:;" id="wpo_gzip_compression_test_btn" class="wpo-refresh-button"><span class="dashicons dashicons-image-rotate"></span><?php esc_html_e('Test again', 'wp-optimize'); ?></a>
23 + <br>
24 + <p id="wpo_gzip_compression_details">
25 + <?php echo $compression_test_results_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped ?>
26 + </p>
27 + </div>
54 28
55 - // add gzip compression section only if gzip compression disabled or we added cache settings to .htaccess.
56 - if (is_wp_error($wpo_gzip_compression_enabled) || false === $wpo_gzip_compression_enabled || $wpo_gzip_compression_settings_added) {
57 -
58 - if ($wp_optimize->is_apache_server()) {
59 - $button_text = (!is_wp_error($wpo_gzip_compression_enabled) && $wpo_gzip_compression_enabled) ? __('Disable', 'wp-optimize') : __('Enable', 'wp-optimize');
60 - ?>
61 - <form>
62 - <button class="button-primary" type="button"
63 - id="wp_optimize_gzip_compression_enable" data-enable="<?php echo $wpo_gzip_compression_enabled ? '0' : '1'; ?>"><?php echo esc_html($button_text); ?></button>
64 - <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 ?>"
65 - width="20" height="20" alt="...">
66 - <br>
67 - </form>
68 - <?php
69 - } else {
70 - 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'));
71 - }
72 - }
73 - ?>
74 - </div>
75 -
76 - <div id="wpo_gzip_compression_error_message">
77 - <?php
78 - if (is_wp_error($wpo_gzip_compression_enabled)) {
29 + <div id="wpo_gzip_compression_error_message">
30 + <?php
31 + if (is_wp_error($wpo_gzip_compression_enabled)) {
79 32 echo esc_html($wpo_gzip_compression_enabled->get_error_message());
80 - }
81 - ?>
82 - </div>
83 - <pre id="wpo_gzip_compression_output" style="display: none;"></pre>
33 + }
34 + ?>
35 + </div>
36 + <pre id="wpo_gzip_compression_output" style="display: none;"></pre>
84 37
85 - <?php endif; ?>
86 - <?php } ?>
87 38 </div>