Performance Enhancement Suggestion for MU Plugin

Hi there Kinsta.

While profiling my site WordPress site hosted with you, I noticed that the check_wp_rocket_version() function within the plugin MU plugin is taking a significant amount of time per request — approximately 12-16 milliseconds as profiled by New Relic. Granted, this isn’t that long, but in conjunction with other plugins, it accumulates. This happens on every page load, and the function cannot be disabled.

Moreover, I observed that this function might not be necessary for all users, particularly those who have not installed WP Rocket. To enhance the performance, I suggest the following modification:

Optimization Suggestion: It would be more efficient to first check if WP Rocket is actively installed on the site using is_plugin_active(). If confirmed, the plugin’s details could be directly retrieved using get_plugin_data(), avoiding the need to scan through the entire plugin directory with get_plugins(). Additionally, it would be beneficial to avoid multiple calls to get_plugins() by assigning the result of the first call to a variable, which can then be reused.

Thank you for considering this suggestion.

Regards: Casper Holten.

Hi Casper! Welcome to the Kinsta community!

Thank you for your post and for sharing this suggestion! I have forwarded this feedback to our development team for consideration. We really do appreciate hearing feedback from our customers! If you do have any further suggestions you’d like to share always feel free to do so!

Best regards

My WordPress dashboard felt slow again this week. Checking the active plugins first showed one old plugin eating memory, though you usually have to clear your site cache right after deleting one to see the speed jump. I removed it and the dashboard sped up. I audit plugins once a month now.

Ten to fifteen milliseconds burned on every uncached PHP request looks harmless on a single blog, then adds up fast on high-traffic WooCommerce checkouts and logged-in membership dashboards.

Most agency teams never even spot MU-plugin overhead until they turn on APM traces during a seasonal spike and realize PHP workers are spending real time re-running version checks that never change between deploys.

Caching plugin compatibility flags in an object cache or transient that only refreshes on plugin activation is such a clean win compared to paying for extra PHP worker tiers.

Are you seeing that hit mostly on uncached WooCommerce or logged-in client portal routes?

Caching the compatibility flag is sensible, but activation alone isn’t enough—plugin updates can change the version without firing activation. I’d also invalidate the cache or transient on upgrader_process_complete or the updated_plugin hook, and key the cached value by plugin version. That keeps the fast path while avoiding stale WP Rocket version checks after an automatic update.