WordPress.org

Ready to get started?Download WordPress

Forums

Urgent do_action('init') - Slowing down blog to hault (5 posts)

  1. kenitech
    Member
    Posted 6 years ago #

    I have a blog that typically ran rather slow. Today it slowed to a hault (40 second page loads). I comnbed through the code and by process of elimination removed the following from wp-settings.php and the site runs perfectly fine now (front end and back end)

    do_action('init');

    What is going on here??!

  2. Michael
    Member
    Posted 6 years ago #

    Sounds like a plugin is causing an issue. Disable any plugins.

  3. kenitech
    Member
    Posted 6 years ago #

    Hi,
    That was actually the first thing I tried. That did not help. Then I used wp-cache after that to temporarily fix it while I was troubleshooting elsewhere. When I removed do_action('init')from wp-settings.php it started loading super fast. I couldn't figure out what this function was trying to call. Does anyone know and if so is it a bad thing that I removed it?
    thanks!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    do_action('init') calls any functions that have hooked the init handle. Generally, these are plugins. Removing that will probably make them not work.

    Your problem is probably wp_cron being called by init. In 2.1 and up, the cron process is called externally, so one thing that could be your problem is the DNS resolution not working on your webserver to find its own address.

    Regardless of that, you *cannot* remove the init action hook. Too many things rely on it. Akismet, widgets, wp_cron, kses... You will find really odd things going on without the init hook.

    To find out what is relying on init, search your codebase for add_action('init',... and find what's hooking itself to the init call.

  5. kenitech
    Member
    Posted 6 years ago #

    Thanks! This is very useful. We actually just physically moved the server that it's on along with an entirely different IP address. I am troubleshooting this now.

Topic Closed

This topic has been closed to new replies.

About this Topic