• Resolved tz1603

    (@tz1603)


    This code is causing a timeout after activating this plugin if the site has lots of users.

    /funnel-builder/admin/db/wffn-updater-functions.php

    if ( ! 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

    (@supportfunnelkit)

    Hi @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

    (@supportfunnelkit)

    Hi @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

    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)
  • You must be logged in to reply to this topic.