Title: get_users will cause timeout
Last modified: March 11, 2025

---

# get_users will cause timeout

 *  Resolved [tz1603](https://wordpress.org/support/users/tz1603/)
 * (@tz1603)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/get_users-will-cause-timeout/)
 * This code is causing a timeout after activating this plugin if the site has lots
   of users.
 *     ```wp-block-code
       /funnel-builder/admin/db/wffn-updater-functions.phpif ( ! function_exists( 'wffn_update_email_default_settings' ) ) {/*** Function to set the default settings for notification settings** @return void*/function wffn_update_email_default_settings() {    $new_settings = array(        'bwf_enable_notification'    => true,        'bwf_notification_frequency' => array( 'weekly', 'monthly' ),        'bwf_notification_time'      => array(            'hours'   => '10',            'minutes' => '00',            'ampm'    => 'am',        ),        'bwf_external_user'          => array(),    );    $users         = get_users( array( 'role' => 'administrator' ) );    $user_selector = array();    foreach ( $users as $user ) {        $user_selector[] = array(            'id'   => $user->ID,            'name' => $user->display_name . ' ( ' . $user->user_email . ' )',        );    }    $new_settings['bwf_notification_user_selector'] = $user_selector;    WFFN_Email_Notification::save_settings( $new_settings );}}
       ```
   

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

 *  Plugin Support [Funnelkit Support](https://wordpress.org/support/users/supportfunnelkit/)
 * (@supportfunnelkit)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/get_users-will-cause-timeout/#post-18357428)
 * Hi [@tz1603](https://wordpress.org/support/users/tz1603/),
 * Thanks for using the Funnelkit Builder and for reaching out to us.
 * We wanted to inform you that our team has scheduled an internal review on this
   to ensure everything is working as expected. We’ll be sure to keep you updated
   and informed of any progress or changes.
 * We appreciate your patience and will get back to you as soon as we have more 
   information.
   Thanks Team Funnelkit
 *  Plugin Support [Funnelkit Support](https://wordpress.org/support/users/supportfunnelkit/)
 * (@supportfunnelkit)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/get_users-will-cause-timeout/#post-18366839)
 * Hi [@tz1603](https://wordpress.org/support/users/tz1603/),
 * Hope you are doing well.
 * <span style=”box-sizing: border-box; margin: 0px; padding: 0px;”>We use WordPress’s**
   get_users() **function to retrieve</span> users with the Administrator role and
   configure FunnelKit email notifications. While most sites have a limited number
   of administrators, this specific site has multiple users. 
   Since get_users() 
   can take time to execute, it should be optimized to retrieve data efficiently.
   To ensure optimal performance, we’ve set a maximum limit of 10 for fetching users
   with the Administrator role and configuring notifications. This limit is sufficient
   for any site.
 * Here is the updated zip of Funnelkit Builder, and we will push this change in
   the next version of the Funnelkit Builder for all the users.
 * [https://www.dropbox.com/scl/fi/pxj2ujhpascn44jiach1v/funnel-builder-vfix_7256-1742212343.zip?rlkey=91u67kmfzjds0slvr7exolxp5&dl=0](https://www.dropbox.com/scl/fi/pxj2ujhpascn44jiach1v/funnel-builder-vfix_7256-1742212343.zip?rlkey=91u67kmfzjds0slvr7exolxp5&dl=0)
   
   Keep us posted if you have any other feedback. Marking this thread as resolved
   for now.Thanks Team Funnelkit

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

The topic ‘get_users will cause timeout’ is closed to new replies.

 * ![](https://ps.w.org/funnel-builder/assets/icon-256x256.gif?rev=3317101)
 * [FunnelKit - Funnel Builder for WooCommerce Checkout](https://wordpress.org/plugins/funnel-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/funnel-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/funnel-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/funnel-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/funnel-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/funnel-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Funnelkit Support](https://wordpress.org/support/users/supportfunnelkit/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/get_users-will-cause-timeout/#post-18366839)
 * Status: resolved