-
Notifications
You must be signed in to change notification settings - Fork 138
Closed as not planned
Closed as not planned
Copy link
Labels
[Plugin] Optimization DetectiveIssues for the Optimization Detective pluginIssues for the Optimization Detective plugin[Type] BugAn existing feature is brokenAn existing feature is broken
Description
Looking at a site in the wild I see the following in the page source:
"minViewportAspectRatio":0.40000000000000002220446049250313080847263336181640625,"maxViewportAspectRatio":2.5
This is a laughable minViewportAspectRatio. Nevertheless, the values 0.4 and 2.5 are what show up in the source:
| return (float) apply_filters( 'od_minimum_viewport_aspect_ratio', 0.4 ); |
| return (float) apply_filters( 'od_maximum_viewport_aspect_ratio', 2.5 ); |
Aren't floating point numbers fun.
I'm not sure how having such a long decimal would be prevented, as the return value of the functions there is sent straight to be exported as JSON here:
performance/plugins/optimization-detective/detection.php
Lines 91 to 93 in ebec285
| $detect_args = array( | |
| 'minViewportAspectRatio' => od_get_minimum_viewport_aspect_ratio(), | |
| 'maxViewportAspectRatio' => od_get_maximum_viewport_aspect_ratio(), |
| wp_json_encode( $detect_args ) |
Not a big issue.
Metadata
Metadata
Assignees
Labels
[Plugin] Optimization DetectiveIssues for the Optimization Detective pluginIssues for the Optimization Detective plugin[Type] BugAn existing feature is brokenAn existing feature is broken
Type
Projects
Status
Done 😃