How to place random widgets in the WordPress sidebar?

Here comes the workaround solution discussed in the comments: functions.php: add_action( ‘widgets_init’, ‘talfluxive_register_sidebars’ ); function talfluxive_register_sidebars() { // register five random widget areas register_sidebars( 5, array( ‘name’ => ‘Random Widget Area %d’ ) ); // register two fixed widget areas register_sidebars( 2, array( ‘name’ => ‘Fixed Widget Area %d’ ) ); } sidebar.php dynamic_sidebar( ‘Fixed … Read more

Long running action from plugin

You could use WordPress’ pseudo-cron and wp_schedule_single_event. <?php // add the action. add_action(‘wpse71941_cron’, ‘wpse71941_long_running’); function wpse71941_long_running($args) { // might need to call `set_time_limit` here set_time_limit(0); // do long running stuff here // return normal time limit if($l = ini_get(‘max_execution_time’)) set_time_limit($l); } // schedule the event for right now wp_schedule_single_event( time(), ‘wpse71941_cron’, array(‘args’ => ‘for’, ‘callback’ … Read more