PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 4.2.15
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v4.2.15
4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 All 136 releases
← All changes | inc/filters.php +4 -2 3.11.1 → 4.2.15 View file →
@@ -25,9 +25,12 @@
25 25 return true;
26 26 }
27 27
28 28 $check_against = [ $_SERVER['REQUEST_URI'] ];
29 - if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
29 + // This code is designed to handle ajax requests on pages that are excluded.
30 + // For ajax requests, the referer is set to the page URL and they use a POST method.
31 + // If an ajax request uses a GET method, it can be managed using the available exclusion rules.
32 + if ( isset( $_SERVER['HTTP_REFERER'] ) && $_SERVER['REQUEST_METHOD'] === 'POST' ) {
30 33 $check_against[] = $_SERVER['HTTP_REFERER'];
31 34 }
32 35 foreach ( $check_against as $check ) {
33 36 foreach ( $match_flags as $rule_flag => $status ) {
@@ -64,9 +67,8 @@
64 67 }
65 68 }
66 69
67 70 return true;
68 -
69 71 }
70 72
71 73 /**
72 74 *