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.