从大型XML文件WordPress导入数据时防止站点关闭

It's not a duplicate, I asked on wordpress stackexchange network, but no one answered. So think to migrate here.

Scenario :

I am using WordPress multisite. I have created plugin which imports sample data from theme folder (I have pattern given in plugin which fetches file)

And then I have defined default theme for new blogs, so when someone creates blog and logs into admin panel, plugin starts working.

Problem :

When importing large files (around 15MB or more) which have causes site down until server process that file. Only after success or an error I am able to open site.

Till it shows loading page. And I have checked site from isup.me , it shows site is down.

Question :

So Is there any other way to work around to prevent site down until it process importing. Or Can I show maintenance mode till successful import operation ?

Try to split your file using WXR Splitter or gzip it by opening your terminal and typing:

gzip /pathtofile/file.xml

you can also combine WXR Splitter and gzip that way:

gzip /pathtofiles/*

this command will zip all your files.