Set PHP Script Timeout
Most of the times the PHP script timeout is set by default by your hosting company to 30 seconds. This means that after 30 seconds of running, your script is immediately killed, which means that all the actions are not completed successfully (if they take more than 30 seconds). You may easily increase this limit