Skip to content

wpr-beacon.min.js is added even if DONOTROCKETOPTIMIZE is set to true #6972

@alfonso100

Description

@alfonso100

Before submitting an issue please check that you’ve completed the following steps:
Yes - Made sure you’re on the latest version
Yes - Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
wpr-beacon.min.js is added even if DONOTROCKETOPTIMIZE is set to true. So when you visit a page, the script is added, the detection triggers, and the entry is added into the wpr_above_the_fold table.
 
OCI will only obey the filter: add_filter( 'rocket_above_the_fold_optimization', '__return_false' );

To Reproduce
Steps to reproduce the behavior:

  1. add define('DONOTROCKETOPTIMIZE', true);
  2. Visit a page in incognito
  3. See the beacon script injected
  4. See the entry being added to the database

Expected behavior
DONOTROCKETOPTIMIZE should stop all the optimizations including Optimize Critical Images.
And maybe Lazy Render Content in 3.17. That's the logic for other optimizations

Screenshots
3K7V2lP

https://i.imgur.com/3K7V2lP.png

Additional context
related slack thread: https://wp-media.slack.com/archives/C43T1AYMQ/p1726159393548059

Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming

Metadata

Metadata

Labels

effort: [XS]< 1 day of estimated development timetype: enhancementImprovements that slightly enhance existing functionality and are fast to implement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions