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
wp-optimize / vendor / mrclay / minify / lib / Minify / DebugDetector.php

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

31 lines 784 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Detect whether request should be debugged
5 *
6 * @package Minify
7 * @author Stephen Clay <[email protected]>
8 */
9 class Minify_DebugDetector
10 {
11 public static function shouldDebugRequest(Minify_Env $env)
12 {
13 if ($env->get('debug') !== null) {
14 return true;
15 }
16
17 $cookieValue = $env->cookie('minifyDebug');
18 if ($cookieValue) {
19 foreach (preg_split('/\\s+/', $cookieValue) as $debugUri) {
20 $pattern = '@' . preg_quote($debugUri, '@') . '@i';
21 $pattern = str_replace(array('\\*', '\\?'), array('.*', '.'), $pattern);
22 if (preg_match($pattern, $env->getRequestUri())) {
23 return true;
24 }
25 }
26 }
27
28 return false;
29 }
30 }
31