Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage lock TTL can be reduced or eliminated for admin users #1829

Closed
westonruter opened this issue Jan 27, 2025 · 0 comments · Fixed by #1835
Closed

Storage lock TTL can be reduced or eliminated for admin users #1829

westonruter opened this issue Jan 27, 2025 · 0 comments · Fixed by #1835
Assignees
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@westonruter
Copy link
Member

westonruter commented Jan 27, 2025

Feature Description

As of #1788, URL Metric collection is no longer disabled for administrators and URL Metrics for administrators will now apply to page loads for non-administrators since URL Metrics are now no longer varied by authentication state. However, the storage lock persists for admin users. Nevertheless, this is not necessary since admin users are expected to do database writes. So it seems that admin users should have the default storage lock of 1 minute reduced to zero. This will allow an admin user to quickly gather URL Metrics for their site manually just by browsing around.

This can currently be achieved with the following plugin code:

add_filter( 'od_metrics_storage_lock_ttl', static function ( int $ttl ): int {
    return current_user_can( 'customize' ) ? 0 : $ttl;
} );

But this should be made the default when the user has the customize capability.

This will also be relevant to #1311 in that there won't be a need to load pages without authentication while at the same time ensuring the storage lock is disabled. (That being said, it would still be preferable to bulk/batch gather URL Metrics while simulating a logged-out user since the analyzed page would more likely be reflective of what a regular visitor would see.)

@westonruter westonruter added [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature labels Jan 27, 2025
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2025 Jan 27, 2025
@westonruter westonruter moved this from Not Started/Backlog 📆 to To Do 🔧 in WP Performance 2025 Jan 27, 2025
@westonruter westonruter self-assigned this Jan 29, 2025
@westonruter westonruter moved this from To Do 🔧 to In Progress 🚧 in WP Performance 2025 Jan 29, 2025
@westonruter westonruter moved this from In Progress 🚧 to Code Review 👀 in WP Performance 2025 Jan 29, 2025
@github-project-automation github-project-automation bot moved this from Code Review 👀 to Done 😃 in WP Performance 2025 Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Done 😃
Development

Successfully merging a pull request may close this issue.

1 participant