[wp-hackers] wp_redirect extremly slow

24/7 24-7 at gmx.net
Wed Jan 12 22:48:04 UTC 2011


Hi,

i work with my own little framework and got some sort of small setup
procedure. Therefore i question if the setup process is already done
or if there should be a redirect to the setup page. My problem is,
that the redirect via wp_redirect often ends up needing 30sec.+ Has
someone any explanation for this?

<?php
// Note: Just example code. Typing errors happened in here

class myInit() {
function __construct() {
   if ( empty($setup) ) {
       // do stuff
   }
   else {
       add_action( 'init', array(&$this, 'redirect'), 0);
   }

   public static function redirect() {
       wp_redirect( get_bloginfo('url').'/wp-admin/admin.php?
page=setup.php', 301 );
   }
}
}

Thanks!
-K.


More information about the wp-hackers mailing list