You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filters the sample size for a breakpoint's URL Metrics on a given URL. The sample size must be greater than zero. In plugin development mode, the default is 1. You can increase the sample size if you want better guarantees that the applied optimizations will be accurate:
107
+
Filters the sample size for a breakpoint's URL Metrics on a given URL. The sample size must be greater than zero. You can increase the sample size if you want better guarantees that the applied optimizations will be accurate. During development, it may be helpful to reduce the sample size to 1:
108
108
109
109
`
110
110
<?php
111
111
add_filter( 'od_url_metrics_breakpoint_sample_size', function (): int {
112
-
return 10;
112
+
return 1;
113
113
} );
114
114
`
115
115
@@ -126,7 +126,7 @@ add_filter( 'od_metrics_storage_lock_ttl', function ( int $ttl ): int {
126
126
127
127
**Filter:** `od_url_metric_freshness_ttl` (default: 1 day in seconds)
128
128
129
-
Filters the freshness age (TTL) for a given URL Metric. The freshness TTL must be at least zero, in which it considers URL Metrics to always be stale. In practice, the value should be at least an hour. In plugin development mode, this is set to zero by default. If your site content does not change frequently, you may want to increase the TTL to a week:
129
+
Filters the freshness age (TTL) for a given URL Metric. The freshness TTL must be at least zero, in which it considers URL Metrics to always be stale. In practice, the value should be at least an hour. If your site content does not change frequently, you may want to increase the TTL to a week:
130
130
131
131
`
132
132
<?php
@@ -135,17 +135,33 @@ add_filter( 'od_url_metric_freshness_ttl', static function (): int {
135
135
} );
136
136
`
137
137
138
+
During development, this can be useful to set to zero:
139
+
140
+
`
141
+
<?php
142
+
add_filter( 'od_url_metric_freshness_ttl', static function (): int {
Filters the minimum allowed viewport aspect ratio for URL Metrics.
141
150
142
-
The 0.4 value is intended to accommodate the phone with the greatest known aspect ratio at 21:9 when rotated 90 degrees to 9:21 (0.429). When in plugin development mode, the default value is 0; this is to account for Dev Tools likely being open.
151
+
The 0.4 value is intended to accommodate the phone with the greatest known aspect ratio at 21:9 when rotated 90 degrees to 9:21 (0.429). During development you may want to set this to 0 to account Dev Tools likely being open and docked to the right:
152
+
153
+
`
154
+
<?php
155
+
add_filter( 'od_minimum_viewport_aspect_ratio', static function (): int {
Filters the maximum allowed viewport aspect ratio for URL Metrics.
147
163
148
-
The 2.5 value is intended to accommodate the phone with the greatest known aspect ratio at 21:9 (2.333). When in plugin development mode, the default value is PHP_INT_MAX; this is to account for Dev Tools likely being open.
164
+
The 2.5 value is intended to accommodate the phone with the greatest known aspect ratio at 21:9 (2.333).
149
165
150
166
During development when you have the DevTools console open on the bottom, for example, the viewport aspect ratio larger than normal. In this case, you may want to increase the maximum aspect ratio:
Copy file name to clipboardExpand all lines: plugins/optimization-detective/storage/class-od-storage-lock.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,6 @@ final class OD_Storage_Lock {
23
23
* Gets the TTL (in seconds) for the URL Metric storage lock.
24
24
*
25
25
* @since 0.1.0
26
-
* @since n.e.x.t The TTL is zero when in 'plugin' development mode.
27
26
* @access private
28
27
*
29
28
* @return int TTL in seconds, greater than or equal to zero. A value of zero means that the storage lock should be disabled and thus that transients must not be used.
@@ -44,7 +43,7 @@ public static function get_ttl(): int {
0 commit comments