diff --git a/inc/Engine/Common/PerformanceHints/Frontend/Processor.php b/inc/Engine/Common/PerformanceHints/Frontend/Processor.php index 9a46c3cbcb..d690fcf518 100644 --- a/inc/Engine/Common/PerformanceHints/Frontend/Processor.php +++ b/inc/Engine/Common/PerformanceHints/Frontend/Processor.php @@ -95,10 +95,6 @@ public function maybe_apply_optimizations( string $html ): string { * @return string The modified HTML content with the beacon script injected just before the closing body tag. */ private function inject_beacon( $html, $url, $is_mobile ): string { - if ( rocket_get_constant( 'DONOTROCKETOPTIMIZE' ) ) { - return $html; - } - $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; if ( ! $this->filesystem->exists( rocket_get_constant( 'WP_ROCKET_ASSETS_JS_PATH' ) . 'wpr-beacon' . $min . '.js' ) ) { diff --git a/tests/Fixtures/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php b/tests/Fixtures/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php index bd18707c7d..ba531000f4 100644 --- a/tests/Fixtures/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php +++ b/tests/Fixtures/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php @@ -68,19 +68,6 @@ ], 'expected' => $html_input, ], - 'shouldReturnOriginalWhenDonotoptimize' => [ - 'config' => [ - 'donotrocketoptimize' => true, - 'html' => $html_input, - 'atf' => [ - 'row' => null, - ], - 'lrc' => [ - 'row' => null, - ], - ], - 'expected' => $html_input, - ], 'shouldAddBeaconToPage' => [ 'config' => [ 'html' => $html_input, diff --git a/tests/Integration/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php b/tests/Integration/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php index 6b69955ce7..dda3411799 100644 --- a/tests/Integration/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php +++ b/tests/Integration/inc/Engine/Common/PerformanceHints/Frontend/Subscriber/maybe_apply_optimizations.php @@ -56,7 +56,6 @@ public function tear_down() { public function testShouldReturnAsExpected( $config, $expected ) { $this->config = $config; $this->cached_user = $config['user_cache_enabled'] ?? false; - $this->donotrocketoptimize = $config['donotrocketoptimize'] ?? null; if ( isset( $config['query_string'] ) ) { $_GET[ $config['query_string'] ] = 1;