PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.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
wp-optimize / vendor / mrclay / minify / builder / ocCheck.php

ocCheck.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.7.0, at vendor/mrclay/minify/builder/ocCheck.php

37 lines 812 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * AJAX checks for zlib.output_compression
4 *
5 * @package Minify
6 */
7
8 $app = (require __DIR__ . '/../bootstrap.php');
9 /* @var \Minify\App $app */
10
11 $_oc = ini_get('zlib.output_compression');
12
13 // allow access only if builder is enabled
14 if (!$app->config->enableBuilder) {
15 header('Location: /');
16 exit;
17 }
18
19 if ($app->env->get('hello')) {
20 // echo 'World!'
21
22 // try to prevent double encoding (may not have an effect)
23 ini_set('zlib.output_compression', '0');
24
25 HTTP_Encoder::$encodeToIe6 = true; // just in case
26 $he = new HTTP_Encoder(array(
27 'content' => str_repeat('0123456789', 500),
28 'method' => 'deflate',
29 ));
30 $he->encode();
31 $he->sendAll();
32 } else {
33 // echo status "0" or "1"
34 header('Content-Type: text/plain');
35 echo (int)$_oc;
36 }
37