Title: get_plugins every call?
Last modified: August 22, 2016

---

# get_plugins every call?

 *  Resolved [Texiwill](https://wordpress.org/support/users/texiwill/)
 * (@texiwill)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/)
 * Hello,
 * get_plugins has some pretty serious performance issues, is it possible instead
   to only call this on the administration screens and set an option that cptch_contact_form_options
   could look at instead? This way get_plugins is not necessary to call every time.
   Perhaps a mode that selects I am using the plugins in question with those values
   changing as needed once the admin screens are accessed.
 * Trying to eliminate some performance issues.
 * Thoughts?
    Edward
 * [https://wordpress.org/plugins/captcha/](https://wordpress.org/plugins/captcha/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426604)
 * Hi,
 * We have received your query and it is now being processed. We will get back to
   you on this forum as soon as we can.
 * Regards,
    BestWebSoft Support Team
 *  [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426627)
 * Hi,
 * The following functions: cptch_contact_form_options() together with get_plugins()
   are launched only on the plugin settings page (admin screen), and once when changing
   the theme.
 * That is why we do not think that the function is called each time. As far as 
   we understood, you want our plugin to use a separate option for checking the 
   installation/activity of our Contact Form plugin, and update it in case of the
   appropriate changes?
 * The case is, since the plugin can be deleted through the FTP, and then installed
   through the FTP, the values in this option can lose their applicability. Hence,
   incorrect data will be displayed on the plugin settings page. To avoid such problems,
   we use get_plugins() function, yet we do it only on the plugin settings page,
   so that the performance is not decreased.
 * Regards,
    BestWebSoft Support Team
 *  Thread Starter [Texiwill](https://wordpress.org/support/users/texiwill/)
 * (@texiwill)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426629)
 * Hello,
 * `captcha.php:1541:add_action( 'after_setup_theme', 'cptch_contact_form_options');`
 * This is added as an action and forces a call after every theme load, not just
   on a theme update. Every time there is a comment on the system get_plugins appears
   to get called. We see this being called anytime there is a comment on the system.
   We are using New Relic to look at transaction traces. The Admin user is just 
   not involved at this time.
 *  [Will Earnhardt](https://wordpress.org/support/users/earnjam/)
 * (@earnjam)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426633)
 * Texiwill is correct, `after_setup_theme` fires on each page load, so probably
   not the best action hook to use.
 * [http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme](http://codex.wordpress.org/Plugin_API/Action_Reference/after_setup_theme)
 * Maybe you were looking for `switch_theme` ?
 * [http://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme](http://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme)
 *  [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426647)
 * Dear Texiwill,
 * You are absolutely right. We will examine this issue and make the necessary changes
   to the plugin.
 * Regards,
    BestWebSoft Support Team
 *  [Dan & Jennifer](https://wordpress.org/support/users/danstuff/)
 * (@danstuff)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426677)
 * Hi there!
 * Just wanted to see if this call was corrected in the latest version?
 * I would really like to run the Captcha plugin, but concerned about performance
   of this call on every page view. 🙂
 * Thanks!
    Dan
 *  [Dan & Jennifer](https://wordpress.org/support/users/danstuff/)
 * (@danstuff)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426683)
 * Hi guys!
 * Just following up on this. 🙂
 * Thanks!
 *  [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426684)
 * Dear Dan,
 * Yes, we have changed the code in “cptch_contact_form_options” function. Now the
   function “get_plugins()” is no longer called in this function and in the frontend.
 * Regards,
    BestWebSoft Support Team
 *  [Dan & Jennifer](https://wordpress.org/support/users/danstuff/)
 * (@danstuff)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426685)
 * That’s great to hear, thank you! 🙂
 *  [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426686)
 * Dear Dan,
 * You are welcome! Please feel free to contact us with any questions in future.
 * Regards,
    BestWebSoft Support Team

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘get_plugins every call?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/captcha_92b6c9.svg)
 * [Captcha](https://wordpress.org/plugins/captcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/captcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/captcha/)
 * [Active Topics](https://wordpress.org/support/plugin/captcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/captcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/captcha/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/get_plugins-every-call/#post-5426686)
 * Status: resolved