Title: Calling get_plugins() function too early
Last modified: March 3, 2020

---

# Calling get_plugins() function too early

 *  [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * (@stiofansisland)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/calling-get_plugins-function-too-early/)
 * You are calling the get_plugins() function immediately on your plugin load, it
   is recommended to call this on the ‘after_setup_theme’ hook or later.
 * The issue is that the function caches the result of the function call on its 
   first call, hence any plugin or theme using its filters will be unsuccessful 
   as the data is already cached by your early call, rendering the filters useless.
 * Please fix this issue.

The topic ‘Calling get_plugins() function too early’ is closed to new replies.

 * ![](https://ps.w.org/heartbeat-control/assets/icon-256x256.png?rev=2952275)
 * [Heartbeat Control](https://wordpress.org/plugins/heartbeat-control/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/heartbeat-control/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/heartbeat-control/)
 * [Active Topics](https://wordpress.org/support/plugin/heartbeat-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/heartbeat-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/heartbeat-control/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Stiofan](https://wordpress.org/support/users/stiofansisland/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/calling-get_plugins-function-too-early/)
 * Status: not resolved