[wp-hackers] wp_redirect extremly slow

24/7 24-7 at gmx.net
Wed Jan 12 23:08:38 UTC 2011


Hi Nacin,

thanks for your quick answer. Mea culpa. I simply forgot it in the
sample above. There's of course an exit() included. So the code looks
similar to this one:

<?php
// Note: Just example code. Typing errors (and similar) 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 );
       exit();
   }
}
}
?>

I also tried using status_header(301) before the wp_redirect and
setting other header states, but i always run into a timeout.

-K.


More information about the wp-hackers mailing list