'ids' ) ); foreach ( $sites as $site_id ) { switch_to_blog( $site_id ); self::activate_single_site(); restore_current_blog(); } return; } self::activate_single_site(); } /** * Per-site activation tasks. * * @return void */ private static function activate_single_site() { $repository = new LogRepository(); $repository->maybe_create_table(); if ( false === get_option( 'noorsmtp_settings' ) ) { add_option( 'noorsmtp_settings', array( 'mailer' => '', 'from_email' => get_option( 'admin_email' ), 'from_name' => get_bloginfo( 'name' ), 'force_from' => false, 'logging_enabled' => true, ) ); } if ( ! wp_next_scheduled( 'noorsmtp_prune_logs' ) ) { wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', 'noorsmtp_prune_logs' ); } } }