| @@ -40,9 +40,9 @@ | ||
| 40 | 40 | * |
| 41 | 41 | * @return bool |
| 42 | 42 | */ |
| 43 | 43 | public function should_process() { |
| 44 | - return ($this->is_delay_js_enabled() || $this->is_preload_js_enabled()) && !$this->is_edit_mode(); | |
| 44 | + return ($this->is_delay_js_enabled() || $this->is_preload_js_enabled()) && !WPO_Page_Builder_Compatibility::is_edit_mode(); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Main processing function to manage JavaScript optimizations. |
| @@ -373,18 +373,8 @@ | ||
| 373 | 373 | * @return string |
| 374 | 374 | */ |
| 375 | 375 | private function get_scripts_pattern() { |
| 376 | 376 | return '/<script(.*)>(.*)<\/script>/Uis'; |
| 377 | - } | |
| 378 | - | |
| 379 | - /** | |
| 380 | - * Determines whether the page is in edit mode using page builders | |
| 381 | - * Beaver Builder, Divi Theme, Elementor, and Oxygen Builder | |
| 382 | - * | |
| 383 | - * @return bool | |
| 384 | - */ | |
| 385 | - private function is_edit_mode() { | |
| 386 | - return isset($_GET['fl_builder']) || isset($_GET['et_fb']) || isset($_GET['elementor-preview']) || isset($_GET['oxygen']) || isset($_GET['ct_builder']); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are not using any global values, only checking for existence | |
| 387 | 377 | } |
| 388 | 378 | } |
| 389 | 379 | |
| 390 | 380 | endif; |