WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
363 stars 98 forks source link

Add ability to prime URL metrics across a site upon installation of Optimization Detective #1311

Open westonruter opened 4 months ago

westonruter commented 4 months ago

Feature Description

When activating Optimization Detective, it starts gathering URL metrics from visitors to the site. However, it has a storage locking mechanism to prevent a user (by hashed IP address) from submitting URL metrics once every 60 seconds. Additionally, URL metrics are not collected for administrator users since pages often include additional elements for admins which will make the URL metrics not applicable to non-admins. All this means that if a site does not get much traffic it can take a few days (or longer) to gather enough URL metrics to apply the optimizations. We could speed up this process by providing a way for an administrator to initiate a site-wide collection of URL metrics. A new query parameter could be introduced which (1) loads the page as a non-admin and (2) disables any storage locking for URL metrics. Then given a list of URLs on the site (e.g. from the sitemaps), each one could be loaded up in an iframe for each breakpoint. A progress bar could also be shown. The process could be interrupted at any time, and if the user wants to start again they could either initiate collection only for URLs for which there are no URL metrics gathered or else to start again from scratch.

westonruter commented 2 months ago

This would be cool to implement as a CLI tool as well, using Puppeteer.

westonruter commented 2 weeks ago

This would make sense to do in a hidden iframe in the post editor screen whenever a post has been updated. This would not require any new UI (which we've avoided until now) and it would ensure that posts get fresh URL metrics immediately.