• Resolved denis24

    (@denis24)


    I’m using Query Monitor to identify and fix issues that may be slowing down this site.

    I’ve found that the init hook triggers 25 identical actions in WPForms Lite:

    wp-content/plugins/wpforms-lite/src/WPForms.php:418

    That line 418 is:

    $callback = function () use ( $full_name, $id, $run, $hook ) {
                if ( ! class_exists( $full_name ) ) {
                    return;
                }
    
                // Instantiate class.
                $instance = new $full_name();
    
                $this->register_instance( $id, $instance );
    
                if ( $run && method_exists( $instance, $run ) ) {
                    $instance->{$run}();
                }
            };

    How can this be prevented?

    I thought that my contact form was corrupted, so I deleted it, and then deactivated and removed the plugin entirely (first checking the box to remove all forms & data upon removal). I then reinstalled WPForms and recreated my form. The issue remains.

    PHP 8.3
    WordPress 6.9.4
    WPForms Lite 1.10.0.4 

    • This topic was modified 3 weeks, 3 days ago by denis24.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Amjad Ali

    (@amjadali688)

    Hi @denis24 ,

    Thanks for reaching out.

    To check this and assist you further, could you please share a screenshot from Query Monitor showing the 25 actions triggered on the init hook? This will help us take a closer look at what’s being reported.

    Once we have that, we’ll be able to guide you better.

    Thanks!

    Thread Starter denis24

    (@denis24)

    Here’s a screenshot of part of the Query Monitor results. As I said, there are 25 identical actions in WPForms Lite. They didn’t all fit on my screen.

    https://drive.google.com/file/d/1_sBJbdeQZCzGwlwWr6XnaJj5fmnxiR0h/view?usp=drive_link

    Plugin Support Amjad Ali

    (@amjadali688)

    Hi @denis24 ,

    Thanks a lot for sharing the screenshot.

    What you’re seeing in Query Monitor can look a bit confusing at first, but it’s actually expected behavior.

    Those 25 callbacks all point to the same line because they’re registered through the same method, but they’re not duplicates. Each one is a separate callback that loads a different part of WPForms, such as different field types like Address, Date/Time, File Upload, Phone, and others.

    These are intentionally hooked into init so everything loads at the right time, once WordPress is fully ready for things like localization and core functionality. Query Monitor groups them under the same source line, which is why they appear identical even though they’re doing different jobs.

    So in this case, there’s nothing to fix or prevent, this is part of how WPForms initializes its features.

    Hope that helps!

    Plugin Support Amjad Ali

    (@amjadali688)

    Hi @denis24 ,

    We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

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

You must be logged in to reply to this topic.